You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When changing the fsRoot setting for Windows-based Jenkins agents to a directory that is on a different drive, the agent cannot be launched. For instance, when we change from c:\jenkins to d:\jenkins, the agent emits this log:
[04/11/24 16:07:08] [SSH] Starting agent process: cd "d:\jenkins" && java -jar remoting.jar -workDir d:\jenkins -jar-cache d:\jenkins/remoting/jarCache
Error: Unable to access jarfile remoting.jar
Agent JVM has terminated. Exit code=1
This is because the cd command in CMD shell does not change to the active drive (you do that by d: or c:, etc.), only the active directory on the drive that you specified.
When taking a look at the agent, I see that the d:\jenkins\remoting.jar file does indeed exist.
To Reproduce
Create an EC2 Fleet as you normally would
Set the fsRoot value (or "Jenkins Filesystem Root") setting to d:\jenkins
Cause the agent to launch (for example set "Minimum Spare Size" to 1 or something like that)
View the log as it is spinning up
Workaround
You can work around this issue by setting the "Prefix Start Agent Command" (or prefixStartSlaveCmd in configuration as code) to d: &&. That will cause the drive to be switched before the cd d:\jenkins command is run.
Suggestion
Perhaps use fully qualified paths when launching Jenkins or referencing anything in the fsRoot directory.
** Logs **
No logs from Jenkins server, only from the agent when it is being created:
[04/11/24 16:07:08] [SSH] Starting agent process: cd "d:\jenkins" && java -jar remoting.jar -workDir d:\jenkins -jar-cache d:\jenkins/remoting/jarCache
Error: Unable to access jarfile remoting.jar
Agent JVM has terminated. Exit code=1
Environment Details
Plugin Version?
5.2.0
Jenkins Version?
2.440.2
Spot Fleet or ASG?
ASG
Label based fleet?
No (at least I don't believe so...)
Issue Details
Describe the bug
When changing the
fsRoot
setting for Windows-based Jenkins agents to a directory that is on a different drive, the agent cannot be launched. For instance, when we change fromc:\jenkins
tod:\jenkins
, the agent emits this log:This is because the
cd
command in CMD shell does not change to the active drive (you do that byd:
orc:
, etc.), only the active directory on the drive that you specified.When taking a look at the agent, I see that the
d:\jenkins\remoting.jar
file does indeed exist.To Reproduce
fsRoot
value (or "Jenkins Filesystem Root") setting tod:\jenkins
Workaround
You can work around this issue by setting the "Prefix Start Agent Command" (or
prefixStartSlaveCmd
in configuration as code) tod: &&
. That will cause the drive to be switched before thecd d:\jenkins
command is run.Suggestion
Perhaps use fully qualified paths when launching Jenkins or referencing anything in the
fsRoot
directory.** Logs **
No logs from Jenkins server, only from the agent when it is being created:
Environment Details
Plugin Version?
5.2.0
Jenkins Version?
2.440.2
Spot Fleet or ASG?
ASG
Label based fleet?
No (at least I don't believe so...)
Linux or Windows?
Windows
EC2Fleet Configuration as Code
Anything else unique about your setup?
No
The text was updated successfully, but these errors were encountered: