Windows JNLP agent doesn't see PATH

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows JNLP agent doesn't see PATH

vitaly_il
I see really weird behaviour on my Windows (Windows Server 2019) Jenkins agent (launched by JNLP).
Jenkins user has C:\Windows\system32 into its PATH (as well as other relevant paths).
But 

  bat '''
    any-command
  '''

fails with 

  'cmd' is not recognized as an internal or external command, 
  operable program or batch file.

unless I'm using PATH = "%Path%;C:\\WINDOWS\\SYSTEM32" into this step 'environment'.

So should I re-define the whole user's environment into my job or I'm missing something?

TIA,
Vitaly


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/dd328de1-0f93-48ad-92af-e2d0a30fbffc%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Windows JNLP agent doesn't see PATH

Simon Richter
Hi,

On Mon, Jan 20, 2020 at 04:55:40AM -0800, Vitaly Karasik wrote:

> I see really weird behaviour on my Windows (Windows Server 2019) Jenkins
> agent (launched by JNLP).

I can't claim to have understood Windows agents' environment handling yet,
but it seems that the entire environment is frozen in the state the agent
had when it was first connected (i.e. saved then, and restored from the
master whenever the client reconnects).

Deleting and readding the agent seemed to help for me (use the same agent
name so it generates the same secret), this will refresh the environment
variables from the client.

   Simon

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/20200120142245.GA12625%40psi5.com.
Reply | Threaded
Open this post in threaded view
|

Re: Windows JNLP agent doesn't see PATH

vitaly_il
Simon, thank you,
but as far as I see it's not the case - 'C:\Windows\system32' was part of the PATH from the start, I didn't add it.

On Monday, January 20, 2020 at 4:22:57 PM UTC+2, Simon Richter wrote:
Hi,

On Mon, Jan 20, 2020 at 04:55:40AM -0800, Vitaly Karasik wrote:

> I see really weird behaviour on my Windows (Windows Server 2019) Jenkins
> agent (launched by JNLP).

I can't claim to have understood Windows agents' environment handling yet,
but it seems that the entire environment is frozen in the state the agent
had when it was first connected (i.e. saved then, and restored from the
master whenever the client reconnects).

Deleting and readding the agent seemed to help for me (use the same agent
name so it generates the same secret), this will refresh the environment
variables from the client.

   Simon

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/23dae2d7-dfd5-4011-825c-a9ef020c5fa6%40googlegroups.com.