[JIRA] (JENKINS-56558) Environment variables get polluted from nodes

5 views
Skip to first unread message

enoyhs@gmail.com (JIRA)

unread,
Mar 14, 2019, 6:01:02 AM3/14/19
to jenkinsc...@googlegroups.com
Aigars Eglajs created an issue
 
Jenkins / Bug JENKINS-56558
Environment variables get polluted from nodes
Issue Type: Bug Bug
Assignee: Boguslaw Klimas
Components: git-parameter-plugin
Created: 2019-03-14 10:00
Labels: plugin git Master/Slave
Priority: Major Major
Reporter: Aigars Eglajs

When using git-parameter-plugin sometimes when opening "Build with Parameters" branch fetching fails with following error:

The default value has been returned
An error occurred while download data
Command "git ls-remote -h <valid-git-repo-url>" returned status code 128:
stdout: 
stderr: /tmp/ssh5427760289448293929.sh: 6: /tmp/ssh5427760289448293929.sh: ssh: not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Please look at the Log
Please check the configuration

 

After investigation this happens because environment variables are fetched from lastBuild. See net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition getEnvironment, }}specifically{{ jobWrapper.getSomeBuildEnvironments() is at fault.

This is not valid, because if lastBuild node has incompatible PATH value to jenkins master node, then ssh will not be found and commands will fail.

In our case lastBuild node was a windows machine and jenkins master is a linux machine.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

enoyhs@gmail.com (JIRA)

unread,
Mar 14, 2019, 6:03:01 AM3/14/19
to jenkinsc...@googlegroups.com
Aigars Eglajs updated an issue
Change By: Aigars Eglajs
When using git-parameter-plugin sometimes when opening "Build with Parameters" branch fetching fails with following error:
{noformat}

The default value has been returned
An error occurred while download data
Command "git ls-remote -h <valid-git-repo-url>" returned status code 128:
stdout: 
stderr: /tmp/ssh5427760289448293929.sh: 6: /tmp/ssh5427760289448293929.sh: ssh: not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Please look at the Log
Please check the configuration
{noformat}

 

After investigation this happens because environment variables are fetched from lastBuild. See {{net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition getEnvironment
, }} specifically

To be more precise,
{{   jobWrapper.getSomeBuildEnvironments()}} is at fault.


This is not valid, because if lastBuild node has incompatible PATH value to jenkins master node, then ssh will not be found and commands will fail.

In our case lastBuild node was a windows machine and jenkins master is a linux machine.

enoyhs@gmail.com (JIRA)

unread,
Mar 14, 2019, 6:04:02 AM3/14/19
to jenkinsc...@googlegroups.com
Aigars Eglajs updated an issue
When using git-parameter-plugin sometimes when opening "Build with Parameters" branch fetching fails with following error:
{noformat}
The default value has been returned
An error occurred while download data
Command "git ls-remote -h <valid-git-repo-url>" returned status code 128:
stdout: 
stderr: /tmp/ssh5427760289448293929.sh: 6: /tmp/ssh5427760289448293929.sh: ssh: not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Please look at the Log
Please check the configuration
{noformat}
 

After investigation this happens because environment variables are fetched from lastBuild.


See  {{ net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition getEnvironment }}


To be more precise
,{{ jobWrapper.getSomeBuildEnvironments() }} is at fault.


This is not valid, because if lastBuild node has incompatible PATH value to jenkins master node, then ssh will not be found and commands will fail.

In our case lastBuild node was a windows machine and jenkins master is a linux machine.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 10:43:04 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason commented on Bug JENKINS-56558
 
Re: Environment variables get polluted from nodes

Hello, we encounter the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 10:47:02 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello, we encounter the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter version: 0.9.6
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 10:50:03 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello, we encounter the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter plugin version: 0.9.6

Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 10:53:02 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello, we encounter the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter plugin version: 0.9.6
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" during "Build with Parameters" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 10:59:02 AM4/30/19
to jenkinsc...@googlegroups.com


Workaround: setting "Force polling using workspace" under "Additional Behaviours" in "Source Code Management" with "Git", and then duplicating the job.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 10:59:03 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello, we encounter

We encountered
the same issue.


Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter plugin version: 0.9.6
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" during "Build with Parameters" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

Workaround: setting "Force polling using workspace" under "Additional Behaviours" in "Source Code Management" with "Git", and then duplicating the job.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 11:04:02 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello,

We encountered the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter plugin version: 0.9.6
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" during "Build with Parameters" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

Workaround: setting "Force polling using workspace" under "Additional Behaviours" in "Source Code Management" with "Git", and then duplicating the job. This workaround only helped for the first build. After the first one, the issue reproduces.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 11:04:03 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello,

We encountered the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter plugin version: 0.9.6
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" during "Build with Parameters" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

Workaround Partial workaround : setting "Force polling using workspace" under "Additional Behaviours" in "Source Code Management" with "Git", and then duplicating the job. This workaround only helped helps for the first build. After the first one, the issue reproduces.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 11:27:02 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello,

We encountered the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter plugin version: 0.9.6
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" during "Build with Parameters" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

Partial workaround: setting "Force polling using workspace" under "Additional Behaviours" in "Source Code Management" with "Git", and then duplicating the job. This workaround only helps for the first build. After the first one, the issue reproduces.

According to [this|https://issues.jenkins-ci.org/browse/JENKINS-45480?focusedCommentId=360924&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-360924], an update to the latest version of the Git Parameter plugin may solve this issue.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 11:36:02 AM4/30/19
to jenkinsc...@googlegroups.com
According to [ this |https://issues.jenkins-ci.org/browse/JENKINS-45480?focusedCommentId=360924&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-360924] , an update to the latest version of the Git Parameter plugin may solve this issue , but by looking at the OP's error reporting output, it's already the latest version there .

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 11:38:02 AM4/30/19
to jenkinsc...@googlegroups.com
Amos Hason edited a comment on Bug JENKINS-56558
Hello,

We encountered the same issue.

Jenkins version: 2.164.1
Git plugin version: 3.9.1
Git Parameter plugin version: 0.9.6
Master OS: Ubuntu 16.04.2
Master JVM version: 1.8.0_191
Master remoting version: 3.29
Slave OS: Windows 10 Pro 10.0.17763
Slave JVM version: 1.8.0_201
Slave remoting version: 3.29

Running `println "git ls-remote -h <URL>".execute().text` in the script console of the slave works fine, while clicking on the job's "Build with Parameters" (which runs the exact same command) brings out the same output as that of the OP: "stderr: /tmp/ssh5441311447548085150.sh: 6: /tmp/ssh5441311447548085150.sh: ssh: not found".

The "ls-remote" during "Build with Parameters" only works while the slave is offline. The last successful build executed "ls-remote" on the master. This confirms the OP's hypothesis.

Partial workaround: setting "Force polling using workspace" under "Additional Behaviours" in "Source Code Management" with "Git", and then duplicating the job. This workaround only helps for the first build. After the first one, the issue reproduces.

According to [ this |https://issues.jenkins-ci.org/browse/JENKINS-45480?focusedCommentId=360924&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-360924] , an update to the latest version of the Git Parameter plugin may solve this issue, but by looking at the OP's error reporting output, it's already the latest version there.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 12:34:01 PM4/30/19
to jenkinsc...@googlegroups.com

Workaround: use HTTPS credentials.

klimas7@gmail.com (JIRA)

unread,
Jun 16, 2019, 4:09:03 AM6/16/19
to jenkinsc...@googlegroups.com
Boguslaw Klimas started work on Bug JENKINS-56558
 
Change By: Boguslaw Klimas
Status: Open In Progress

klimas7@gmail.com (JIRA)

unread,
Jun 18, 2019, 3:31:02 PM6/18/19
to jenkinsc...@googlegroups.com
Boguslaw Klimas resolved as Fixed
 

Hi,

Aigars Eglajs BIG KUDOS for you!!! you helped me a lot to resolve this and more the similar issues.

I released plugin in version 0.9.11 where this issue was resolved, could you check that and confirm the issue is resolved

 
Regards
Boguslaw

Change By: Boguslaw Klimas
Status: In Progress Resolved
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages