jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
115 stars 186 forks source link

NoSuchFileException in version 4.0.1 #910

Closed denis-matchenko closed 5 months ago

denis-matchenko commented 6 months ago

Describe the bug Such an error occurs in the 4.0.1 version, there is no error in version 4.0.0

13:40:30  hudson.remoting.ProxyException: java.nio.file.NoSuchFileException: /home/jenkins/workspace/cloud_master@tmp/artifactory/buildInfo5093472757169252321.properties
13:40:30    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
13:40:30    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
13:40:30    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
13:40:30    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
13:40:30    at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
13:40:30    at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
13:40:30    at org.jfrog.hudson.util.ExtractorUtils.savePropertiesToFile(ExtractorUtils.java:598)
13:40:30  Caused: hudson.remoting.ProxyException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/jenkins/workspace/cloud_master@tmp/artifactory/buildInfo5093472757169252321.properties
13:40:30    at org.jfrog.hudson.util.ExtractorUtils.savePropertiesToFile(ExtractorUtils.java:609)
13:40:30    at org.jfrog.hudson.util.ExtractorUtils.persistConfiguration(ExtractorUtils.java:577)
13:40:30    at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.persistConfiguration(EnvExtractor.java:96)
13:40:30    at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.execute(EnvExtractor.java:75)
13:40:30  Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: da620d94-0df0-4e90-9806-bc5bbd9bcc83
13:40:30  Caused: hudson.remoting.ProxyException: java.lang.RuntimeException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/jenkins/workspace/cloud_master@tmp/artifactory/buildInfo5093472757169252321.properties
13:40:30    at org.jfrog.hudson.pipeline.common.executors.EnvExtractor.execute(EnvExtractor.java:77)
13:40:30    at org.jfrog.hudson.pipeline.common.executors.MavenExecutor.execute(MavenExecutor.java:59)
13:40:30    at org.jfrog.hudson.pipeline.declarative.steps.maven.MavenStep$Execution.runStep(MavenStep.java:106)
13:40:30    at org.jfrog.hudson.pipeline.declarative.steps.maven.MavenStep$Execution.runStep(MavenStep.java:91)
13:40:30    at org.jfrog.hudson.pipeline.ArtifactorySynchronousNonBlockingStepExecution.run(ArtifactorySynchronousNonBlockingStepExecution.java:55)
13:40:30    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
13:40:30    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
13:40:30    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
13:40:30    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
13:40:30    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
13:40:30    at java.base/java.lang.Thread.run(Thread.java:840)

To Reproducen such an error occurs Steps to reproduce the behavior

This part causes an error in the pipeline

rtMavenDeployer(
  id: 'MAVEN_DEPLOYER',
  serverId: artifactoryServerId,
  releaseRepo: 'libs-release',
  snapshotRepo: 'libs-snapshot-local',
  excludePatterns: ["${pipelineParams.rtExcludePatterns}"]
)
rtMavenResolver(
  id: 'MAVEN_RESOLVER',
  serverId: artifactoryServerId,
  releaseRepo: 'libs-release',
  snapshotRepo: 'libs-snapshot-local'
)
rtBuildInfo(
  maxBuilds: 100,
  maxDays: 30,
  deleteBuildArtifacts: true,
  captureEnv: true
)

rtMavenRun(
  pom: 'pom.xml',
  goals: "clean versions:set -DnewVersion=${RELEASE_NUMBER}-${BUILD_NUMBER} " +
          '-DprocessAllModules=true -B -ntp',
  resolverId: 'MAVEN_RESOLVER'
)

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Versions

Additional context Add any other context about the problem here.

fraz3alpha commented 6 months ago

This has affected us pretty badly too, so we are in the process of downgrading to 4.0.0 as well.

I see that there were a bunch of changes relating to writing out properties files in https://github.com/jfrog/jenkins-artifactory-plugin/pull/900/files, (specifically here where it split the writing of the properties file into two steps,) so I wonder if that is involved in what has broken here

yahavi commented 5 months ago

@denis-matchenko @fraz3alpha Jenkins Artifactory plugin 4.0.3 has been released. This version includes the fix for this issue. Feel free to upgrade - we'd appreciate your feedback on that.

I'd also like to suggest considering our new Jenkins JFrog plugin, which is based on the JFrog CLI. Both plugins can be used side by side in the same pipeline.

pjinggithub commented 5 months ago

@yahavi do we need restart Jenkins server after upgrade this plug-in? Thank you for your support Ping

yahavi commented 5 months ago

Yes, @pjinggithub

pjinggithub commented 5 months ago

@yahavi thank you for confirming this.

jekkel commented 5 months ago

I am afraid the issue is not fully resolved, see #918 .

pjinggithub commented 5 months ago

@jekkel you are right, after we upgraded plugin into 4.0.3, it still does not work with same error, so we rollbacked from 4.0.1 and 4.0.3 back to 4.0.0 and waiting for new fix. you can see in the issue of this plugin under Jenkins website, it is still marked as unresolved. https://issues.jenkins.io/browse/JENKINS-72471

not sure, when this issue can be fixed from Jenkins side.

Or-Geva commented 4 months ago

@pjinggithub & @jekkel Thank you all for reporting this issue, Artifactory Jenkins plugin 4.0.4 has been released, including a fix for this issue. Feel free to upgrade. We'd appreciate your feedback on that.

ChristianGeie commented 4 months ago

i just update to plugin version 4.0.5 and issues out of #918 seems to be fixed. All related agent builds are running as expected. thx to @Or-Geva for contributing #923