[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread dh...@posteo.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Heid closed an issue as Fixed  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49681  
 
 
  Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
Change By: 
 Daniel Heid  
 
 
Status: 
 Resolved Closed  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread dh...@posteo.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Heid resolved as Fixed  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49681  
 
 
  Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
Change By: 
 Daniel Heid  
 
 
Status: 
 Open Resolved  
 
 
Resolution: 
 Fixed  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread dh...@posteo.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Heid commented on  JENKINS-49681  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
 Okay, there will no longer be problems with spaces in front of the shebang with the upcoming version 2.5.1. Thanks for making the PostBuildScript plugin better!  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread scm_issue_l...@java.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 SCM/JIRA link daemon commented on  JENKINS-49681  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
 Code changed in jenkins User: Daniel Heid Path: README.md pom.xml src/main/java/org/jenkinsci/plugins/postbuildscript/service/CommandExecutor.java src/test/java/org/jenkinsci/plugins/postbuildscript/service/CommandExecutorIT.java src/test/resources/shebang_with_spaces.sh http://jenkins-ci.org/commit/postbuildscript-plugin/a72f93f18317ada38215a9d8569d5a79005ef74f Log: JENKINS-49681 Allowing spaces in front of interpreter  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread s...@imnotpete.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Jones commented on  JENKINS-49681  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
 I've updated the issue with a working config/script to reproduce the error, along with what I think the problem is.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread s...@imnotpete.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Jones updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49681  
 
 
  Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
Change By: 
 Sam Jones  
 

  
 
 
 
 

 
  [^config.xml]  [^testScript.sh] Each time my build runs, PostBuildScript is saying there is an error (project names redacted): {code}[PostBuildScript] - Executing post build scripts.[PostBuildScript] - Executing the script /var/lib/jenkins/workspace///mvp-contexts/updateVms.sh with parameters [/var/lib/jenkins/workspace/].[MCP] $  /bin/bash /tmp/jenkins416424957985231.sh /var/lib/jenkins/workspace/[PostBuildScript] - [ERROR] Problem occurred: Error while executing scriptBuild step 'Execute Scripts' changed build result to FAILUREBuild step 'Execute Scripts' marked build as failure{code}But if I SSH into the Jenkins machine and su to the Jenkins user, I can copy that command from the [MCP] line and run it just fine.I've tried it with just a hello world echo statement in the script with the same result.The parameter is workspace project location so the script can reference workspace files. h1. EDITI think I've figured it out. If there is a space after the shebang (#!) in the script, it fails in the plugin, but running the command from the log output works. I've attached my config.xml and testScript.sh for reproducing the bug.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 

[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread s...@imnotpete.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Jones updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49681  
 
 
  Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
Change By: 
 Sam Jones  
 
 
Attachment: 
 config.xml  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread s...@imnotpete.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Jones updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49681  
 
 
  Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
Change By: 
 Sam Jones  
 
 
Attachment: 
 testScript.sh  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread s...@imnotpete.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Jones created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49681  
 
 
  Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Daniel Heid  
 
 
Components: 
 postbuildscript-plugin  
 
 
Created: 
 2018-02-21 20:28  
 
 
Environment: 
 Ubuntu 16.04.3 LTS  Jenkins 2.89.4  PostBuildScript plugin 2.5.0  
 
 
Priority: 
  Major  
 
 
Reporter: 
 Sam Jones  
 

  
 
 
 
 

 
 Each time my build runs, PostBuildScript is saying there is an error:  

 

[PostBuildScript] - Executing post build scripts.
[PostBuildScript] - Executing the script /var/lib/jenkins/workspace///mvp-contexts/updateVms.sh with parameters [/var/lib/jenkins/workspace/].
[MCP] $  /bin/bash /tmp/jenkins416424957985231.sh /var/lib/jenkins/workspace/
[PostBuildScript] - [ERROR] Problem occurred: Error while executing script
Build step 'Execute Scripts' changed build result to FAILURE
Build step 'Execute Scripts' marked build as failure
 

 But if I SSH into the Jenkins machine and su to the Jenkins user, I can copy that command from the [MCP] line and run it just fine. I've tried it with just a hello world echo statement in the script with the same result. The parameter is workspace project location so the script can reference workspace files.  
 

  
 
 
 
 
 

[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread dh...@posteo.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Heid commented on  JENKINS-49681  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
 Thanks for submitting this issue! I must reproduce the problem in order to fix it. Could you please provide the script and the job configuration (config.xml)?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49681) Scripts always fail when run in build, but succeed from command line

2018-02-21 Thread s...@imnotpete.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Jones updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49681  
 
 
  Scripts always fail when run in build, but succeed from command line   
 

  
 
 
 
 

 
Change By: 
 Sam Jones  
 

  
 
 
 
 

 
 Each time my build runs, PostBuildScript is saying there is an error  (project names redacted) : {code}[PostBuildScript] - Executing post build scripts.[PostBuildScript] - Executing the script /var/lib/jenkins/workspace///mvp-contexts/updateVms.sh with parameters [/var/lib/jenkins/workspace/].[MCP] $  /bin/bash /tmp/jenkins416424957985231.sh /var/lib/jenkins/workspace/[PostBuildScript] - [ERROR] Problem occurred: Error while executing scriptBuild step 'Execute Scripts' changed build result to FAILUREBuild step 'Execute Scripts' marked build as failure{code}But if I SSH into the Jenkins machine and su to the Jenkins user, I can copy that command from the [MCP] line and run it just fine.I've tried it with just a hello world echo statement in the script with the same result.The parameter is workspace project location so the script can reference workspace files.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)