Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55415

File not found in Content Replace Plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • content-replace-plugin
    • None
    • Jenkins 2.150.1
      Content replace plugin: 1.0.2

      My pipeline script:

      stage('Replace in file') {
      steps {

      contentReplace(configs: [fileContentReplaceConfig(configs: [fileContentReplaceItemConfig(matchCount: 1,
      replace: 'some_pattern:${VERSION}',
      search: 'some_pattern')],
      fileEncoding: 'ASCII',
      filePath: 'my_file.yml')])

      }
      }

      Build failing with error:

      java.io.FileNotFoundException: File '/DATA/build/workspace/my_job/my_file.yml' does not exist
      at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
      at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)
      at com.mxstrive.jenkins.plugin.contentreplace.ContentReplaceBuilder.replaceFileContent(ContentReplaceBuilder.java:69)
      at com.mxstrive.jenkins.plugin.contentreplace.ContentReplaceBuilder.replaceFileContent(ContentReplaceBuilder.java:58)
      at com.mxstrive.jenkins.plugin.contentreplace.ContentReplaceBuilder.perform(ContentReplaceBuilder.java:51)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:51)
      at hudson.security.ACL.impersonate(ACL.java:290)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:48)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

       

      The file '/DATA/build/workspace/my_job/my_file.yml' exists and accessible to jenkins's slave user.

      The problem makes the plugin completely unusable.

            moxun mo xun
            levt Lev Tartakovsky
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: