Closed emilioziniades closed 4 months ago
To add more context, I am using the the jenkins configuration as code plugin (https://github.com/jenkinsci/configuration-as-code-plugin) and the groovy configuration as code plugin (https://github.com/jenkinsci/configuration-as-code-groovy-plugin).
The above errors are during setup, when a groovy script runs and tries to access AWS credentials.
Closing this issue. I don't think it was this plugin that was misbehaving in isolation. The issue was simply accessing credentials in the setup.groovy script, which I'm guessing is out of scope for this plugin.
Jenkins and plugins versions report
Environment
```text Jenkins: 2.452.2 OS: Linux - 5.14.0-427.22.1.el9_4.x86_64 Java: 17.0.11 - Eclipse Adoptium (OpenJDK 64-Bit Server VM) --- antisamy-markup-formatter:162.v0e6ec0fcfcf6 apache-httpcomponents-client-4-api:4.5.14-208.v438351942757 asm-api:9.7-33.v4d23ef79fcc8 authentication-tokens:1.113.v81215a_241826 aws-java-sdk-minimal:1.12.730-457.v3403b_37d2170 aws-java-sdk-secretsmanager:1.12.730-457.v3403b_37d2170 aws-secrets-manager-credentials-provider:1.214.va_0a_d8268d068 azure-ad:484.v5fd019a_39b_18 azure-sdk:174.va_89c1df897d2 bitbucket:241.v6d24a_57f9359 bootstrap5-api:5.3.3-1 bouncycastle-api:2.30.1.78.1-233.vfdcdeb_0a_08a_a_ branch-api:2.1169.va_f810c56e895 caffeine-api:3.1.8-133.v17b_1ff2e0599 checks-api:2.2.0 cloudbees-bitbucket-branch-source:883.v041fa_695e9c2 cloudbees-folder:6.928.v7c780211d66e command-launcher:107.v773860566e2e commons-compress-api:1.26.1-2 commons-lang3-api:3.14.0-76.vda_5591261cfe commons-text-api:1.12.0-119.v73ef73f2345d configuration-as-code:1810.v9b_c30a_249a_4c configuration-as-code-groovy:1.1 credentials:1337.v60b_d7b_c7b_c9f credentials-binding:677.vdc9d38cb_254d display-url-api:2.204.vf6fddd8a_8b_e9 durable-task:555.v6802fe0f0b_82 echarts-api:5.5.0-1 eddsa-api:0.3.0-4.v84c6f0f4969e font-awesome-api:6.5.2-1 git:5.2.2 git-client:5.0.0 gson-api:2.11.0-41.v019fcf6125dc handy-uri-templates-2-api:2.1.8-30.v7e777411b_148 instance-identity:185.v303dc7c645f9 ionicons-api:74.v93d5eb_813d5f 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-7 javax-mail-api:1.6.2-9 jaxb:2.3.9-1 jdk-tool:73.vddf737284550 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 junit:1265.v65b_14fa_f12f0 kubernetes:4246.v5a_12b_1fe120e kubernetes-client-api:6.10.0-240.v57880ce8b_0b_2 kubernetes-credentials:174.va_36e093562d9 mailer:472.vf7c289a_4b_420 matrix-auth:3.2.2 matrix-project:832.va_66e270d2946 mercurial:1260.vdfb_723cdcc81 metrics:4.2.21-451.vd51df8df52ec mina-sshd-api-common:2.12.1-113.v4d3ea_5eb_7f72 mina-sshd-api-core:2.12.1-113.v4d3ea_5eb_7f72 okhttp-api:4.11.0-172.vda_da_1feeb_c6e pipeline-graph-analysis:216.vfd8b_ece330ca_ pipeline-graph-view:304.va_f2a_16b_e4964 pipeline-groovy-lib:727.ve832a_9244dfa_ pipeline-input-step:495.ve9c153f6067b_ pipeline-model-api:2.2198.v41dd8ef6dd56 pipeline-model-definition:2.2198.v41dd8ef6dd56 pipeline-model-extensions:2.2198.v41dd8ef6dd56 pipeline-rest-api:2.34 pipeline-stage-step:312.v8cd10304c27a_ pipeline-stage-tags-metadata:2.2198.v41dd8ef6dd56 pipeline-stage-view:2.34 pipeline-utility-steps:2.17.0 plain-credentials:182.v468b_97b_9dcb_8 plugin-util-api:4.1.0 prism-api:1.29.0-15 purge-build-queue-plugin:88.v23b_97b_f2c7a_d resource-disposer:0.23 scm-api:690.vfc8b_54395023 script-security:1341.va_2819b_414686 snakeyaml-api:2.2-111.vc6598e30cc65 ssh-credentials:337.v395d2403ccd4 sshd:3.322.v159e91f6a_550 structs:337.v1b_04ea_4df7c8 timestamper:1.27 trilead-api:2.147.vb_73cc728a_32e variant:60.v7290fc0eb_b_cd workflow-api:1316.v33eb_726c50b_a_ workflow-basic-steps:1058.vcb_fc1e3a_21a_9 workflow-cps:3903.v48a_8836749e9 workflow-durable-task-step:1353.v1891a_b_01da_18 workflow-job:1400.v7fd111b_ec82f workflow-multibranch:783.787.v50539468395f workflow-scm-step:427.v4ca_6512e7df1 workflow-step-api:657.v03b_e8115821b_ workflow-support:907.v6713a_ed8a_573 ws-cleanup:0.46 ```What Operating System are you using (both controller, and any agents involved in the problem)?
Linux, using jenkins-lts container image
Reproduction steps
This is a jenkins server running inside an on-premises kubernetes cluster.
I have an
unclassified.yml
configuration file as follows (omitting sensitive or irrelevant data)The server fails to start up, here is an excerpt of the logs before it dies:
Server Logs
``` 2024-06-26 13:17:01.741+0000 [id=32] WARNING c.a.util.EC2MetadataUtils#getItems: Unable to retrieve the requested metadata (/latest/dynamic/instance-identity/document). Failed to connect to service endpoint: java.net.SocketTimeoutException: Connect timed out at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(Unknown Source) at java.base/sun.nio.ch.NioSocketImpl.connect(Unknown Source) at java.base/java.net.Socket.connect(Unknown Source) at java.base/sun.net.NetworkClient.doConnect(Unknown Source) at java.base/sun.net.www.http.HttpClient.openServer(Unknown Source) at java.base/sun.net.www.http.HttpClient.openServer(Unknown Source) at java.base/sun.net.www.http.HttpClient.Expected Results
The region is parsed from the plugin configuration.
Actual Results
The region is not discovered via the plugin configuration, and it falls back to using ec2 metadata to determine the region, but it is not running in AWS
Anything else?
No response
Are you interested in contributing a fix?
Yes, but I have limited java experience.