-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Red Hat Enterprise Linux release 9.3 (Plow)
jenkins v2.426.2
artifactory plugin v4.0.1
-
Powered by SuggestiMate
artifactory plugin v4.0.1 -> ERR
[Pipeline] newBuildInfo
[Pipeline] artifactoryMavenBuild
[Pipeline]
[Pipeline] // stage
[Pipeline] echo
Mark pipeline as FAILED due to exception: java.lang.RuntimeException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /PATH_WORKSPACE@tmp/artifactory/buildInfo16773654138834561428.properties
artifactory plugin v4.0.0 -> OK
[Pipeline] newBuildInfo
[Pipeline] artifactoryMavenBuild
Jenkins Artifactory Plugin version: 4.0.0
Artifactory integration is enabled
[JENKINS-72471] artifactory buildInfo file not found
We also encountered this issue.
On Linux based slave nodes it seems that the buildinfoXXXXX.properties file is created but its size is 0 byte.
On Windows slave nodes, the file is not created and the error looks to fail silently since we don't see error in pipeline as if we were on linux; but then we have issues later when we try to promote a build, because builds ( ora at least build infos) are not on artifactory
We have to downgrade back to version 4.0.0 wainting for this to be fixed
EDIT:
To be more precise, we use JDK 17 and Gradle 7.6. The build info task is like:
build Info:
stage ('Config Build Info') { steps { script { env.CURRENT_STATUS = "${STAGE_NAME}" } echo ("Current status: ${env.CURRENT_STATUS}") rtBuildInfo ( captureEnv: true, includeEnvPatterns: ["*"], excludeEnvPatterns: ["DONT_COLLECT*"], buildName: "<BUILD_NAME>" ) } }
Then we publish:
stage ('Publish artifacts & build Info') { steps { echo ('Publishing artifacts...') rtGradleRun ( usesPlugin: true, useWrapper: true, rootDir: "${env.WORKSPACE}", tasks: "artifactoryPublish", deployerId: "GRADLE_DEPLOYER", resolverId: "GRADLE_RESOLVER", buildName: "<BUILD_NAME>" ) rtPublishBuildInfo ( serverId: "AR1", buildName: "<BUILD_NAME>" ) } }
and we got the error:
java.nio.file.NoSuchFileException: /home/jenkins/workspace/<PIPELINE_NAME>@tmp/artifactory/buildInfo4734844661446051754.properties at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219) at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478) at java.base/java.nio.file.Files.newOutputStream(Files.java:220) at org.jfrog.hudson.util.ExtractorUtils.savePropertiesToFile(ExtractorUtils.java:598) Caused: java.lang.RuntimeException at org.jfrog.hudson.util.ExtractorUtils.savePropertiesToFile(ExtractorUtils.java:609) at org.jfrog.hudson.util.ExtractorUtils.persistConfiguration(ExtractorUtils.java:577) at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.persistConfiguration(EnvExtractor.java:96) at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.execute(EnvExtractor.java:75) Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 4862f2a1-a6ff-4303-a67a-e2371fae8252 Caused: java.lang.RuntimeException at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.execute(EnvExtractor.java:77) at org.jfrog.hudson.pipeline.common.executors.GradleExecutor.execute(GradleExecutor.java:73) at org.jfrog.hudson.pipeline.declarative.steps.gradle.GradleStep$Execution.runStep(GradleStep.java:128) at org.jfrog.hudson.pipeline.declarative.steps.gradle.GradleStep$Execution.runStep(GradleStep.java:113) at org.jfrog.hudson.pipeline.ArtifactorySynchronousNonBlockingStepExecution.run(ArtifactorySynchronousNonBlockingStepExecution.java:55) 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
but the file is there, just 0 byte.
On windows (a slightly different project but same pipeline structure, always JDK 17 and Gradle 7.6 ) we do something similar:
BuildInfo -> No Error
Publish Artifact -> No Error
Promotion:
stage('Promote to Integration stage') { steps { echo ('Promoting to integration stage...') rtPromote ( buildName: "<BUILD_NAME>", buildNumber: "${env.BUILD_NUMBER}", serverId: 'AR1', targetRepo: 'libs-integration-local', comment: 'Build promoted to INTEGRATION stage', status: 'INT_STAGE_PROMOTION', sourceRepo: 'libs-snapshot-local', includeDependencies: false, failFast: true, copy: false ) } }
Got Error:
19:41:25 Promoting to integration stage... [Pipeline] rtPromote 19:41:25 Promoting '<BUILD_NAME>' #306 to 'libs-integration-local' from 'libs-snapshot-local', with status: 'INT_STAGE_PROMOTION', with comment: 'Build promoted to INTEGRATION stage', failing on first error. 19:41:25 Performing dry run promotion (no changes are made during dry run) ... 19:41:25 ERROR: IOException: JFrog service failed. Received 400: { 19:41:25 "errors" : [ { 19:41:25 "status" : 400, 19:41:25 "message" : "Unable to find artifacts of build '<BUILD_NAME>' #306 from artifactory-build-info repo: aborting promotion." 19:41:25 } ] 19:41:25 }
and Build info and artifact are simply not on artifactory, even if Publish Artifact task completed without errors.
Same problem here. Also performed a downgrade to 4.0.0. That fixed it so our CI/CD works again.
Pieces of our logging:
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-install-plugin:2.4:install (default-install) @ xxxx --- [main] INFO org.codehaus.plexus.PlexusContainer - Installing e:\jenkinsworkspaces\build Java xxxx\trunk\java-modules\xxxxx\target\xxxx-7.179.0-SNAPSHOT.jar to E:\maven-proxy-repository\xxxx\7.179.0-SNAPSHOT\xxxxx-7.179.0-SNAPSHOT.jar [main] INFO org.codehaus.plexus.PlexusContainer - Installing e:\jenkinsworkspaces\build Java xxxxx\trunk\java-modules\xxxxx\pom.xml to E:\maven-proxy-repository\xxxxx\7.179.0-SNAPSHOT\xxxxx-7.179.0-SNAPSHOT.pom [main] INFO org.codehaus.plexus.PlexusContainer - Installing e:\jenkinsworkspaces\build Java xxxxx\trunk\java-modules\xxxxx\target\xxxxx-7.179.0-SNAPSHOT-sources.jar to E:\maven-proxy-repository\xxxxx\7.179.0-SNAPSHOT\xxxxx-7.179.0-SNAPSHOT-sources.jar [main] INFO org.jfrog.build.extractor.maven.BuildDeploymentHelper - Artifactory Build Info Recorder: Saving Build Info to 'e:\jenkinsworkspaces\build Java xxxxx\trunk\java-modules\xxxxx\target\build-info.json' [main] INFO org.jfrog.build.extractor.maven.ArtifactoryManagerBuilder - Deploying artifact: https://jenkins-xxxxx.nl:9101/artifactory/geo_snapshot_local/xxxxx/7.179.0-SNAPSHOT/xxxxx-7.179.0-SNAPSHOT.jar [main] INFO org.jfrog.build.extractor.maven.ArtifactoryManagerBuilder - Deploying artifact: https://jenkins-xxxxx.nl:9101/artifactory/geo_snapshot_local/xxxxx/7.179.0-SNAPSHOT/xxxxx-7.179.0-SNAPSHOT-sources.jar [main] INFO org.jfrog.build.extractor.maven.ArtifactoryManagerBuilder - Deploying artifact: https://jenkins-xxxxx.nl:9101/artifactory/geo_snapshot_local/xxxxx/7.179.0-SNAPSHOT/xxxxx-7.179.0-SNAPSHOT.pom [main] INFO org.jfrog.build.extractor.maven.BuildDeploymentHelper - Artifactory Build Info Recorder: Deploying build info ... [main] INFO org.jfrog.build.extractor.maven.ArtifactoryManagerBuilder - Deploying build info... [main] ERROR org.jfrog.build.extractor.maven.ArtifactoryManagerBuilder - Could not build the build-info object. [main] ERROR org.jfrog.build.extractor.maven.BuildInfoRecorder - org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: java.lang.RuntimeException: java.io.IOException: JFrog service failed. Received 404: Could not locate artifact 'artifactory-build-info:build Java xxxxx/5687-1704375973615.json'. at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:83) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:74) at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:160) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296) at org.apache.maven.cli.MavenCli.main (MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.io.IOException: JFrog service failed. Received 404: Could not locate artifact 'artifactory-build-info:build Java xxxxx/5687-1704375973615.json'. at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.throwException (JFrogService.java:49) at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.PublishBuildInfo.handleUnsuccessfulResponse (PublishBuildInfo.java:36) at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.execute (JFrogService.java:121) at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.PublishBuildInfo.execute (PublishBuildInfo.java:59) at org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager.publishBuildInfo (ArtifactoryManager.java:158) at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:65) at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:56) at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:60) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:81) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:74) at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:160) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296) at org.apache.maven.cli.MavenCli.main (MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [main] ERROR org.apache.maven.cli.MavenCli - Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: java.io.IOException: JFrog service failed. Received 404: Could not locate artifact 'artifactory-build-info:build Java xxxxx/5687-1704375973615.json'. -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:121) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296) at org.apache.maven.cli.MavenCli.main (MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:169) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296) at org.apache.maven.cli.MavenCli.main (MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.RuntimeException: java.io.IOException: JFrog service failed. Received 404: Could not locate artifact 'artifactory-build-info:build Java xxxxx/5687-1704375973615.json'. at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:83) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:74) at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:160) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296) at org.apache.maven.cli.MavenCli.main (MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.io.IOException: JFrog service failed. Received 404: Could not locate artifact 'artifactory-build-info:build Java xxxxx/5687-1704375973615.json'. at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.throwException (JFrogService.java:49) at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.PublishBuildInfo.handleUnsuccessfulResponse (PublishBuildInfo.java:36) at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.execute (JFrogService.java:121) at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.PublishBuildInfo.execute (PublishBuildInfo.java:59) at org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager.publishBuildInfo (ArtifactoryManager.java:158) at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:65) at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:56) at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:60) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:81) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:74) at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:160) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296) at org.apache.maven.cli.MavenCli.main (MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [main] ERROR org.apache.maven.cli.MavenCli - [main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch. [main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging. [main] ERROR org.apache.maven.cli.MavenCli - [main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles: [main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException ERROR: Couldn't execute Maven task. RuntimeException: Maven build failed with exit code 1 ERROR: Build step failed with exception java.lang.RuntimeException: Maven build failed with exit code 1 at org.jfrog.hudson.pipeline.common.Utils.launch(Utils.java:280) Caused: java.lang.RuntimeException: Maven build failed. Couldn't execute Maven task. RuntimeException: Maven build failed with exit code 1 at org.jfrog.hudson.pipeline.common.Utils.launch(Utils.java:285) at org.jfrog.hudson.maven3.Maven3Builder.RunMaven(Maven3Builder.java:121) at org.jfrog.hudson.maven3.Maven3Builder.perform(Maven3Builder.java:101) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:164) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526) at hudson.model.Run.execute(Run.java:1895) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Build step 'Invoke Artifactory Maven 3' marked build as failure Sending e-mails to: xxxxx Started calculate disk usage of build Finished Calculation of disk usage of build in 0 seconds Started calculate disk usage of workspace Finished Calculation of disk usage of workspace in 1 second Finished: FAILURE
I hope this helps...
I believe the issue is with ArtifactoryClientConfiguration.persistToPropertiesFile.
The body of that method uses java.io.File, which is unaware of remote vs local paths (Unlike hudson.FilePath). The file is given to it via configuration.setPropertiesFile(propertiesFile.getRemote());
The getRemote() call strips the information about which agent it runs on and returns a plain path, which is only valid on the same computer as that file.
--------------------
Note that ArtifactoryClientConfiguration.persistToEncryptedPropertiesFile likely doesn't have the same issue, as it uses an OutputStream directly.
I think that if I set skipEncryption to false (via usesPlugin: false?) then it is likely 4.0.3 would work for me. Perhaps this is how it slipped through testing? This bug requires a remote build agent && gradle build && usesPlugin: true.
Haven't been able to fully test this theory, but it seems sound so far.
Has anyone upgraded Artifactory Jenkins Plugin to 4.0.3 and checked if this issue has been resolved?
I am getting this issue using 4.0.3 too.
Verified reverting to 4.0.0 resolved the issue.
leoqa , have you tried to clear all agents' cache before running with 4.0.3? it is located in the workspace directory inside the Jenkins home directory. You will find the cache for all your agents there.
Do you mean the workspace for the pipeline I'm running on the agent? If so, the pipeline is configured to clean that workspace out at the end of each run. I've verified that that workspace folder is empty after every run.
Example:
- /opt/jenkins/workspace/TEST_JOB_NAME
If you mean what stored in directory '/opt/jenkins/caches/ ' that is also empty.
Additional update:
I did find a "/opt/jenkins/workspace/TEST_JOB_NAME@tmp" directory that did have the following file in it:
- /opt/jenkins/workspace/TEST_JOB_NAME@tmp/artifactory/artifactory-pipeline-cache/9/rtBuildInfo_TGVlX2FydGlmYWN0b3J5X2JpdGJ1Y2tldF90ZXN0LXNuYXBzaG90Xzk
I then proceeded to clear out the entire /opt/jenkins/workspace directory and tried running the pipeline again using the 4.0.3 version of the plugin.
This did generate an empty file: /opt/jenkins/workspace/TEST_JOB_NAME@tmp/artifactory/buildInfo5255470384553647519.properties
It still failed with the same issue noted previously though.
I then downgraded the plugin to 4.0.0 again, re-ran the pipeline and it once again completed successfully.
leoqa , Thanks for your input! I appreciate your help.
Unfortunately, I couldn't replicate this in my project example. Would you be willing to run your Jenkins job on my project example and see if it works for you?
https://github.com/jfrog/project-examples/tree/master/gradle-examples/gradle-example-publish
Same here with an additional oddity:
We have a Windows Master and Linux Slaves. The error on the slave misses a file at "c:\home\..." - so a mix of Windows File System and Path on Linux Machine.
Lee Leibke , Thanks for your input! I appreciate your help. Unfortunately, I couldn't replicate this in my project example. Would you be willing to run your Jenkins job on my project example and see if it works for you? https://github.com/jfrog/project-examples/tree/master/gradle-examples/gradle-example-publish
What's the jenkins job look like?
ortil sorry, but I won't have much time to try testing with your project for a while in our environments.
I am curious to how you tried to replicate this though. Did you:
- Create/use an environment (I used both Jenkins v 2.426.2 and 2.426.3 ) with the Artifactory 4.0.0 plugin installed first.
- Ran a pipeline that successfully published to Artifactory.
- Update the plugin to 4.0.3.
- Then run the same pipeline to see if you could replicate the issue.
Also if it helps, here is basically what the stage of our pipeline looks like that is trying to publish to Artifactory:
stage('Publish to Artifactory'){ steps { echo "Beginning: ${env.STAGE_NAME} Stage" sh "chmod +x gradlew" withCredentials( [ [ $class: 'UsernamePasswordMultiBinding', credentialsId: 'SOME_JENKINS_CREDENTIAL_ID_HERE', passwordVariable: 'ORG_GRADLE_PROJECT_artifactory_password', usernameVariable: 'ORG_GRADLE_PROJECT_artifactory_user' ] ] ) { rtBuildInfo ( captureEnv: true, buildName: "${env.JOB_NAME.replaceAll("/", " :: ")}-snapshot", buildNumber: BUILD_NUMBER ) rtGradleDeployer ( id: 'snapshot-deployer', serverId: ARTIFACTORY_SERVER_ID_HERE, repo: ARTIFACTORY_REPO_NAME_HERE ) rtGradleRun ( deployerId: 'snapshot-deployer', usesPlugin: true, useWrapper: true, buildFile: 'build.gradle', tasks: "clean artifactoryPublish", buildName: "${env.JOB_NAME.replaceAll("/", " :: ")}-snapshot", buildNumber: BUILD_NUMBER ) rtPublishBuildInfo ( serverId: ARTIFACTORY_SERVER_ID_HERE, buildName: "${env.JOB_NAME.replaceAll("/", " :: ")}-snapshot", buildNumber: BUILD_NUMBER ) } } }
Same issue with us and downgrading helped though. This looks to be issue with only gradle.
swamygoud18 No, not only with gradle. We have java jobs and have the same problem.
leoqa, I followed the exact steps you provided, but unfortunately, I couldn't replicate the issue on my end. I strongly believe that the problem might be related to cache issues, possibly caused by remnants of the old Artifactory plugin still persisting in the cache. Could you please try running this in a new Jenkins application and see if it reproduces the same issue?
ortil - we uses the dynamic slave configuration and new slave with every build is also causing the same issue and as you suggested we also created new master and has the same issue. for some reason as I said - we only seeing this error with gradle in our case and using the publish code is same as leoqa mentioned.
Here is the full error/exception details ortil :
12:30:00 java.io.FileNotFoundException: /home/jenkins/agent/workspace/java-gradle-lib-reg-test@tmp/artifactory/buildInfo1268983877369591775.properties (No such file or directory)12:30:00 at java.base/java.io.FileOutputStream.open0(Native Method)12:30:00 at java.base/java.io.FileOutputStream.open(Unknown Source)12:30:00 at java.base/java.io.FileOutputStream.<init>(Unknown Source)12:30:00 at java.base/java.io.FileOutputStream.<init>(Unknown Source)12:30:00 at org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.persistToPropertiesFile(ArtifactoryClientConfiguration.java:241)12:30:00 Caused: java.lang.RuntimeException*12:30:00* at org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.persistToPropertiesFile(ArtifactoryClientConfiguration.java:244)12:30:00 at org.jfrog.hudson.util.ExtractorUtils.savePropertiesToFile(ExtractorUtils.java:587)12:30:00 at org.jfrog.hudson.util.ExtractorUtils.persistConfiguration(ExtractorUtils.java:565)12:30:00 at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.persistConfiguration(EnvExtractor.java:96)12:30:00 at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.execute(EnvExtractor.java:75)
and I am able to reproduce the same error with your example reference - gradle-example-publish(https://github.com/jfrog/project-examples/tree/master/gradle-examples/gradle-example-publish) also.
do we have any updates on this issue ortil or are we still looking for more details.?
swamygoud18, I have opened a PR to fix this issue. I will update this ticket once we release it
leoqa & swamygoud18 Artifactory Jenkins plugin 4.0.4 has been released.
Feel free to upgrade. We'd appreciate your feedback on that.
ortil sorry, but I may not be able to get to this for a couple of weeks yet.
I will post back here when I am able to and let you know the results.
Thanks.
ortil finally got around to updating Jenkins and this plugin.
We are now on version 4.0.8 of this plugin and we are having no issues.
Thanks for taking care of this.
Have also encountered this issue. When looking at the filesystem after the build has failed, the missing file is present on the path mentioned, but the command fails nonetheless.