Details

    • Similar Issues:

      Description

      Hi All.

      I am facing issue while running the sh step through pipeline as code. This is the error message:

      Cannot run program "nohup" (in directory "/app/jenkins/workspace/job"): error=7, Argument list too long.

      When I run the sh step in freestyle job it is working fine.

      Please suggest.

      Thanks,

      Sanjiv

        Attachments

          Activity

          Hide
          abayer Andrew Bayer added a comment -

          Please include your Jenkinsfile.

          Show
          abayer Andrew Bayer added a comment - Please include your Jenkinsfile.
          Hide
          kaushik575 sanjiv kumar added a comment -

          Hi Andrew,

          This is a simple shell script which I am trying to execute using pipeline as code. This is the code:

          def copyFiles() {
          try {
          wrap([$class: 'AnsiColorBuildWrapper']) {
          print "Copying files, please wait..."
          sh """
          cd $WORKSPACE
          ./copy.sh --type=api
          """
          }
          }
          catch (Exception caughtException) {
          wrap([$class: 'AnsiColorBuildWrapper']) {
          print "Failed to copy artifacts for api, exiting..."
          currentBuild.result = "FAILURE"
          throw caughtException
          }
          }
          }

          copy.sh is a simple shell script copying files. In fact if I just run the command sh "ls" it is also failing.

          I start facing this issue all of sudden. 

          Thanks

          Show
          kaushik575 sanjiv kumar added a comment - Hi Andrew, This is a simple shell script which I am trying to execute using pipeline as code. This is the code: def copyFiles() { try { wrap( [$class: 'AnsiColorBuildWrapper'] ) { print "Copying files, please wait..." sh """ cd $WORKSPACE ./copy.sh --type=api """ } } catch (Exception caughtException) { wrap( [$class: 'AnsiColorBuildWrapper'] ) { print "Failed to copy artifacts for api, exiting..." currentBuild.result = "FAILURE" throw caughtException } } } copy.sh is a simple shell script copying files. In fact if I just run the command sh "ls" it is also failing. I start facing this issue all of sudden.  Thanks

            People

            • Assignee:
              Unassigned
              Reporter:
              kaushik575 sanjiv kumar
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: