Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS profile not working #321

Open
quentin9696 opened this issue Mar 26, 2024 · 0 comments
Open

AWS profile not working #321

quentin9696 opened this issue Mar 26, 2024 · 0 comments
Labels

Comments

@quentin9696
Copy link

Jenkins and plugins versions report

Environment
Jenkins: 2.440.2
OS: Linux - 6.7.7-200.fc39.x86_64
Java: 17.0.10 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
ansicolor:1.0.4
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
asm-api:9.6-3.v2e1fa_b_338cd7
authentication-tokens:1.53.v1c90fd9191a_b_
authorize-project:1.7.1
aws-credentials:218.v1b_e9466ec5da_
aws-java-sdk-cloudformation:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-ec2:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-ecr:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-elasticbeanstalk:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-iam:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-minimal:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-secretsmanager:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-sns:1.12.671-445.ve02f9b_558f2e
aws-java-sdk-sqs:1.12.671-445.ve02f9b_558f2e
aws-secrets-manager-secret-source:1.72.v61781b_35c542
bitbucket:241.v6d24a_57f9359
bootstrap5-api:5.3.3-1
bouncycastle-api:2.30.1.77-225.v26ea_c9455fd9
branch-api:2.1152.v6f101e97dd77
build-timeout:1.32
caffeine-api:3.1.8-133.v17b_1ff2e0599
checks-api:2.0.2
cloudbees-bitbucket-branch-source:880.vcf4056c5a_71f
cloudbees-folder:6.901.vb_4c7a_da_75da_3
command-launcher:107.v773860566e2e
commons-lang3-api:3.13.0-62.v7d18e55f51e2
commons-text-api:1.11.0-95.v22a_d30ee5d36
configuration-as-code:1775.v810dc950b_514
credentials:1337.v60b_d7b_c7b_c9f
credentials-binding:657.v2b_19db_7d6e6d
dark-theme:439.vdef09f81f85e
display-url-api:2.200.vb_9327d658781
docker-commons:439.va_3cb_0a_6a_fb_29
docker-workflow:572.v950f58993843
durable-task:550.v0930093c4b_a_6
ec2:1648.vf3d852e00486
echarts-api:5.5.0-1
font-awesome-api:6.5.1-3
git:5.2.1
git-client:4.7.0
gson-api:2.10.1-15.v0d99f670e0a_7
handy-uri-templates-2-api:2.1.8-30.v7e777411b_148
instance-identity:185.v303dc7c645f9
ionicons-api:56.v1b_1c8c49374e
jackson2-api:2.17.0-379.v02de8ec9f64c
jakarta-activation-api:2.1.3-1
jakarta-mail-api:2.1.3-1
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.9-1
jdk-tool:73.vddf737284550
job-dsl:1.87
joda-time-api:2.12.7-29.v5a_b_e3a_82269a_
jquery3-api:3.7.1-2
jsch:0.2.16-86.v42e010d9484b_
json-api:20240303-41.v94e11e6de726
json-path-api:2.9.0-58.v62e3e85b_a_655
junit:1265.v65b_14fa_f12f0
mailer:472.vf7c289a_4b_420
mask-passwords:173.v6a_077a_291eb_5
matrix-auth:3.2.2
matrix-project:822.824.v14451b_c0fd42
mercurial:1260.vdfb_723cdcc81
mina-sshd-api-common:2.12.0-99.vdb_f07841c2db_
mina-sshd-api-core:2.12.0-99.vdb_f07841c2db_
node-iterator-api:55.v3b_77d4032326
pipeline-aws:1.44
pipeline-build-step:540.vb_e8849e1a_b_d8
pipeline-graph-analysis:216.vfd8b_ece330ca_
pipeline-groovy-lib:704.vc58b_8890a_384
pipeline-input-step:491.vb_07d21da_1a_fb_
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2184.v0b_358b_953e69
pipeline-model-definition:2.2184.v0b_358b_953e69
pipeline-model-extensions:2.2184.v0b_358b_953e69
pipeline-rest-api:2.34
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2184.v0b_358b_953e69
pipeline-stage-view:2.34
plain-credentials:179.vc5cb_98f6db_38
plugin-util-api:4.1.0
prism-api:1.29.0-13
resource-disposer:0.23
role-strategy:713.vb_3837801b_8cc
saml:4.464.vea_cb_75d7f5e0
scm-api:689.v237b_6d3a_ef7f
script-security:1326.vdb_c154de8669
simple-theme-plugin:176.v39740c03a_a_f5
snakeyaml-api:2.2-111.vc6598e30cc65
ssh-credentials:326.v7fcb_a_ef6194b_
ssh-slaves:2.948.vb_8050d697fec
sshd:3.322.v159e91f6a_550
structs:337.v1b_04ea_4df7c8
theme-manager:215.vc1ff18d67920
timestamper:1.26
token-macro:400.v35420b_922dcb_
trilead-api:2.142.v748523a_76693
variant:60.v7290fc0eb_b_cd
workflow-aggregator:596.v8c21c963d92d
workflow-api:1291.v51fd2a_625da_7
workflow-basic-steps:1049.v257a_e6b_30fb_d
workflow-cps:3889.v937e0b_3412d3
workflow-durable-task-step:1331.vc8c2fed35334
workflow-job:1400.v7fd111b_ec82f
workflow-multibranch:773.vc4fe1378f1d5
workflow-scm-step:427.v4ca_6512e7df1
workflow-step-api:657.v03b_e8115821b_
workflow-support:881.v7663695646cf
ws-cleanup:0.45

What Operating System are you using (both controller, and any agents involved in the problem)?

Master: fedora CoreOs latest version
Slave: ubuntu 22.04LTS

Reproduction steps

  1. Setup the Retrieve credentials from node flag on global config
  2. Create an AWS config file on the slave ~/.aws/config with a profile
  3. Try to use it like in a pipeline, like
node {
    withAWS(profile: "prod") {
      awsIdentity()
    }
}
  1. Get the error

java.lang.IllegalArgumentException: profile file cannot be null

Expected Results

No errors

Actual Results

Setting AWS profile prod
Setting AWS region us-east-1
[Pipeline] {
[Pipeline] awsIdentity
[Pipeline] }
[Pipeline] // withAWS
Retrieving credentials from node.
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 9cafd92e-f663-42d6-bf05-3cae75e40579
java.lang.IllegalArgumentException: profile file cannot be null
at com.amazonaws.util.ValidationUtils.assertNotNull(ValidationUtils.java:37)
at com.amazonaws.auth.profile.ProfilesConfigFile.(ProfilesConfigFile.java:142)
at com.amazonaws.auth.profile.ProfilesConfigFile.(ProfilesConfigFile.java:133)
at com.amazonaws.auth.profile.ProfilesConfigFile.(ProfilesConfigFile.java:100)
at com.amazonaws.auth.profile.ProfileCredentialsProvider.getCredentials(ProfileCredentialsProvider.java:135)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.getCredentialsFromContext(AmazonHttpClient.java:1269)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.runBeforeRequestHandlers(AmazonHttpClient.java:845)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:794)
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.securitytoken.AWSSecurityTokenServiceClient.doInvoke(AWSSecurityTokenServiceClient.java:1731)
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.invoke(AWSSecurityTokenServiceClient.java:1698)
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.invoke(AWSSecurityTokenServiceClient.java:1687)
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.executeGetCallerIdentity(AWSSecurityTokenServiceClient.java:1298)
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.getCallerIdentity(AWSSecurityTokenServiceClient.java:1266)
at de.taimos.pipeline.aws.AWSIdentityStep$Execution.run(AWSIdentityStep.java:86)
at de.taimos.pipeline.aws.AWSIdentityStep$Execution.run(AWSIdentityStep.java:77)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

Anything else?

I try with both useNode: true and without.
I also try to setup the AWS_CONFIG_FILE environment variable.
When I run it using the role: <my_role_name>, it works as excepted.

Are you interested in contributing a fix?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant