jenkinsci/plugin-installation-manager-tool

Provider "jar" not found

Closed this issue · 3 comments

Jenkins and plugins versions report

Environment
OS: Linux - 6.1.91-060191-generic
Java: 17.0.11 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
ant:497.v94e7d9fffa_b_9
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
asm-api:9.7-33.v4d23ef79fcc8
bootstrap5-api:5.3.3-1
bouncycastle-api:2.30.1.78.1-248.ve27176eb_46cb_
branch-api:2.1169.va_f810c56e895
build-timeout:1.33
caffeine-api:3.1.8-133.v17b_1ff2e0599
checks-api:2.2.0
cloudbees-folder:6.942.vb_43318a_156b_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
credentials:1361.v56f5ca_35d21c
credentials-binding:681.vf91669a_32e45
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
github:1.39.0
github-api:1.318-461.v7a_c09c9fa_d63
github-branch-source:1789.v5b_0c0cea_18c3
gradle:2.12
gson-api:2.11.0-41.v019fcf6125dc
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-10
jaxb:2.3.9-1
jjwt-api:0.11.5-112.ve82dfb_224b_a_d
joda-time-api:2.12.7-29.v5a_b_e3a_82269a_
jquery3-api:3.7.1-2
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
matrix-auth:3.2.2
matrix-project:832.va_66e270d2946
metrics:4.2.21-451.vd51df8df52ec
mina-sshd-api-common:2.13.1-117.v2f1a_b_66ff91d
mina-sshd-api-core:2.13.1-117.v2f1a_b_66ff91d
okhttp-api:4.11.0-172.vda_da_1feeb_c6e
pipeline-build-step:540.vb_e8849e1a_b_d8
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-milestone-step:119.vdfdc43fc3b_9a_
pipeline-model-api:2.2203.v89fa_170c2b_f5
pipeline-model-definition:2.2203.v89fa_170c2b_f5
pipeline-model-extensions:2.2203.v89fa_170c2b_f5
pipeline-rest-api:2.34
pipeline-stage-step:312.v8cd10304c27a_
pipeline-stage-tags-metadata:2.2203.v89fa_170c2b_f5
pipeline-stage-view:2.34
plain-credentials:183.va_de8f1dd5a_2b_
plugin-util-api:4.1.0
prism-api:1.29.0-15
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
ssh-slaves:2.973.v0fa_8c0dea_f9f
sshd:3.330.vc866a_8389b_58
structs:338.v848422169819
timestamper:1.27
token-macro:400.v35420b_922dcb_
trilead-api:2.147.vb_73cc728a_32e
variant:60.v7290fc0eb_b_cd
workflow-aggregator:600.vb_57cdd26fdd7
workflow-api:1316.v33eb_726c50b_a_
workflow-basic-steps:1058.vcb_fc1e3a_21a_9
workflow-cps:3903.v48a_8836749e9
workflow-durable-task-step:1360.v82d13453da_a_f
workflow-job:1426.v2ecb_a_a_42fd46
workflow-multibranch:791.v28fb_f74dfca_e
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/Docker

Reproduction steps

Build an image through this Dockerfile thanks to docker build ..

Expected Results

No error.

Actual Results

 => ERROR [10/11] RUN which jenkins-plugin-cli && jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt                                                                       6.6s
------
 > [10/11] RUN which jenkins-plugin-cli && jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt:
0.120 /usr/bin/jenkins-plugin-cli
6.416 Provider "jar" not found
------
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:45
--------------------
  43 |
  44 |     # We use the Jenkins plugin CLI to install the plugins listed in the plugins.txt file.
  45 | >>> RUN which jenkins-plugin-cli && jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt
  46 |
  47 |     # We copy a pre-configured Jenkins configuration file to the Jenkins ref directory in the image.
--------------------
ERROR: failed to solve: process "/bin/sh -c which jenkins-plugin-cli && jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt" did not complete successfully: exit code: 1

Anything else?

No response

Are you interested in contributing a fix?

Yes.

I tried to build the current main branch in my Docker container and got:

247.9 [INFO] Running io.jenkins.tools.pluginmanager.impl.ChecksumTest
247.9 [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s -- in io.jenkins.tools.pluginmanager.impl.ChecksumTest
247.9 [INFO] Running io.jenkins.tools.pluginmanager.config.LogOutputTest
247.9 [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s -- in io.jenkins.tools.pluginmanager.config.LogOutputTest
248.2 [INFO]
248.2 [INFO] Results:
248.2 [INFO]
248.2 [ERROR] Failures:
248.2 [ERROR]   CacheManagerTest.cacheManagerWithNonReadableJsonFileForKey:159
248.2 Expecting actual:
248.2   ""
248.2 to start with:
248.2   "Cache ignored file the-cache-key.json because it cannot be read.
248.2 java.nio.file.AccessDeniedException:"
248.2
248.2 [ERROR]   CacheManagerTest.cacheReturnsNullWhenCachedFileCannotBeRead:148
248.2 expected: null
248.2  but was: {}
248.2 [ERROR] Errors:
248.2 [ERROR]   PluginManagerTest.startNoDirectoryNoPluginDirTest:143 » ProviderNotFound Provider "jar" not found
248.2 [INFO]
248.2 [ERROR] Tests run: 151, Failures: 2, Errors: 1, Skipped: 3
248.2 [INFO]
248.2 [INFO] ------------------------------------------------------------------------
248.2 [INFO] Reactor Summary for plugin-management-parent-pom 2.13.1-SNAPSHOT:
248.2 [INFO]
248.2 [INFO] plugin-management-parent-pom ....................... SUCCESS [02:21 min]
248.2 [INFO] plugin-management-library .......................... FAILURE [01:33 min]
248.2 [INFO] plugin-management-cli .............................. SKIPPED
248.2 [INFO] ------------------------------------------------------------------------
248.2 [INFO] BUILD FAILURE

It builds correctly on the same machine without Docker for JDK 17 and 21. 🤔

Thanks to the assistance of @MarkEWaite, we've identified and resolved the issue with the Docker image that was causing problems with the Jenkins WAR file.

Root Cause

The problem stemmed from an incorrect ENV variable declaration in the Dockerfile. Specifically:

  • I mistakenly used {} in the ENV variable declaration.
  • This resulted in an empty WAR file, rendering Jenkins unusable.

Solution

The issue was resolved by correcting the ENV declaration in the Dockerfile:

  • Removed the {} from the ENV variable declaration.
  • After this correction, everything began functioning properly.

Lessons Learned

  1. Pay close attention to syntax in Dockerfile ENV declarations.
  2. Avoid using {} in ENV variables within Dockerfiles.

Next Steps

  1. We can consider closing this issue.
  2. Alternatively, we could keep it open to improve the error message:
    • Current message: "jar: Provider not found"
    • While this gave us some clues, a more descriptive error message could be helpful.

Reflection

Although it's unlikely that others will encounter this specific error, improving error messages can always benefit users and troubleshooting processes.

Acknowledgment

I take responsibility for this oversight. Thank you to everyone involved in helping diagnose and resolve this issue.