You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Operating System are you using (both controller, and any agents involved in the problem)?
Environment is deployed into aws eks v1.23
Controller - jenkins/jenkins:2.361.2-jdk11
Agent - jenkins/inbound-agent:latest
Reproduction steps
We are now getting a forbidden error when using s3DoesObjectExist, this has been working for some time but recently randomly broke- I presume this just lists the file?
I have given the bucket and iam role in use here full s3:* permissions
Can list and push using aws cli in pipeline
Can push using s3Upload function in pipeline
Example pipeline
pipeline {
agent any
stages {
stage('Test') {
steps {
script {
sh "aws s3 ls s3://test-bucket-here/test"
s3ChartExist = s3DoesObjectExist(bucket:"test-bucket-here", path:"test")
}
}
}
}
}
Example output
Running on test-8-j4zkb-0qrpl-qqjmb in /home/jenkins/agent/workspace/test
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] script
[Pipeline] {
[Pipeline] sh
+ aws s3 ls s3://test-bucket-here/test
2022-10-20 11:43:05 0 test
[Pipeline] s3DoesObjectExist
Searching s3://test-bucket-here for object:'test'
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
com.amazonaws.services.s3.model.AmazonS3Exception: Forbidden (Service: Amazon S3; Status Code: 403; Error Code: 403 Forbidden; Request ID: ; S3 Extended Request ID: ; Proxy: null), S3 Extended Request ID:
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1879)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleServiceErrorResponse(AmazonHttpClient.java:1418)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1387)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1157)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:814)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:781)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:755)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:715)
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:697)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:561)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:541)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5456)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5403)
at com.amazonaws.services.s3.AmazonS3Client.getObjectMetadata(AmazonS3Client.java:1372)
at com.amazonaws.services.s3.AmazonS3Client.getObjectMetadata(AmazonS3Client.java:1346)
at com.amazonaws.services.s3.AmazonS3Client.doesObjectExist(AmazonS3Client.java:1427)
at de.taimos.pipeline.aws.S3DoesObjectExistStep$Execution.run(S3DoesObjectExistStep.java:115)
at de.taimos.pipeline.aws.S3DoesObjectExistStep$Execution.run(S3DoesObjectExistStep.java:93)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Finished: FAILURE
Expected Results
s3DoesObjectExist to confirm if object exist and not be forbidden even though full permissions are given
One detail worth noting - I'm seeing the exception when using s3DoesObjectExistin a different AWS account. If the object is found, it returns true. If the object is not found, it throws the 403 exception.
However, if I use s3DoesObjectExist on the same object with an IAM user with the same permissions but from the same account, it returns false as expected.
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Environment is deployed into aws eks v1.23
Controller - jenkins/jenkins:2.361.2-jdk11
Agent - jenkins/inbound-agent:latest
Reproduction steps
We are now getting a forbidden error when using s3DoesObjectExist, this has been working for some time but recently randomly broke- I presume this just lists the file?
Example pipeline
Example output
Expected Results
s3DoesObjectExist to confirm if object exist and not be forbidden even though full permissions are given
Actual Results
com.amazonaws.services.s3.model.AmazonS3Exception: Forbidden
Anything else?
No response
The text was updated successfully, but these errors were encountered: