Quantcast

[JIRA] (JENKINS-14569) PATH is not being injected correctly

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
Issue Type: Bug Bug
Affects Versions: current
Assignee: Gregory Boissinot
Components: envinject
Created: 25/Jul/12 1:59 PM
Description:

On a node level there is PATH environment variable set:

D:\cygwin\bin;${VS71COMNTOOLS}..\IDE;${windir}\Microsoft.NET\Framework\v4.0.30319;${PATH}

Job has been set to set environments variable before SCM checkout with both 'Keep Jenkins Environment Variables' and 'Keep Jenkins Build Variables' checked.

In the build step I put 'echo %PATH%'. It shows that the original PATH is set (without D:\cygwin\bin;${VS71COMNTOOLS}..\IDE;${windir}\Microsoft.NET\Framework\v4.0.30319; part). At the same time in Injected Environment Variables tab I see that PATH was correctly enhanced with settings from node.

The issue did not happen before EnvInject installation and setup. Previously 'echo %PATH%' at build step showed correct path.

Environment: Jenkins 1.472 on RHEL5 x86_64, Windows Server 2003 slave
Project: Jenkins
Priority: Major Major
Reporter: Krzysztof Malinowski
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org

OK, now I got similar error on a different project which does not even have EnvInject set. The project used standard 'set environment variables' setting to override PATH and it stopped working once EnvInject was installed. Original PATH setting has been used instead.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Additional side effect: on a Windows slave there is predefined environment variable named Path. When setting PATH=C:\Program Files\7-Zip;${PATH} as EnvInject setup, it results in both PATH and Path injected variables, where Path is original (without 7-Zip) and PATH contains 7-Zip. Anyway, the build later fails since apparently Windows checks Path and not PATH (or probably these two count as one and it depends on what order they are set).

As a workaround I have corrected EnvInject setup to set Path not PATH and it works. However, standard environment setup feature from Jenkins did not work this way, i.e. correctly expanded Path with the same setup as above (PATH=C:\Program Files\7-Zip;${PATH})

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

If I understand, there is an issue on Windows.
EnvInject plugin make a difference between PATH and Path, where it is the same thing on windows.
Is it all?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: Gregory Boissinot (30/Jul/12 7:45 PM)
Status: Open In Progress
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

No.

At first, I don't understand why EnvInject distinguishes PATH from Path on Windows, when standard Jenkins variable setup implementation does not behave this way.

Secondly, the issue is also about installing EnvInject makes standard environment setup working incorrectly. I used to have jobs which added to PATH within standard 'set environment variables' and these are no longer applied, even though I have not enabled any EnvInject option in the project. It seems that installing EnvInject itself breaks the way Jenkins handles environment variables for the build (or at least PATH variable). This is true for Unix-based build as well.

To reproduce the issue:

  • on the node set environment variable PATH
  • create a new free style build and tie it on this node
  • in the job check 'set environment variable' and add something to the PATH
  • int the build step use shell step and run 'echo ${PATH}'
  • notice that PATH does not contain modifications from standard settings

While I understand that this field is not part of EnvInject setup, I find it breaking since installing EnvInject is enough to break jobs that are set up like this (the jobs do not even need to have EnvInject configured).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

I'm sorry for not getting back to you sooner.
From an Unix environment, I can't reproduce the problem.
Could you attach your job configuration file, maybe I missed something.

More information
1) EnvInject plugin distinguishes PATH from Path from Windows because it is written in Java and I don't take in consideration of that at the moment.

2) If you don't use EnvInject, nothing is modified.
It is not intrusive.
Therefore, I don't understand your remark

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

I have verified on a clean Jenkins installation that it works correctly indeed. It seems that there is some conflict with "Hudson setenv plugin". It was installed so long ago that I didn't remember it was a plugin; thought that setting environment was a Jenkins built-in. Clean Jenkins installation convinced me it's not.

Anyway, seems not to be a problem. Rather my configuration issue.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: Krzysztof Malinowski (31/Aug/12 9:11 AM)
Status: In Progress Open
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14569) PATH is not being injected correctly

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Krzysztof Malinowski closed Bug JENKINS-14569 as Not A Defect

Turned out it was a configuration issue.

Change By: Krzysztof Malinowski (31/Aug/12 9:12 AM)
Status: Open Closed
Resolution: Not A Defect
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Loading...