everytime I run my pipeline it creates 2 workspace folders like /var/lib/jenkins/workspace/workspace/pipe4. But this happens only if I run the pipeline on an agent. If I run the same pipeline on controller I have, like it should be, only one workspace folder and everything works fine.
Settings are right and home directory is “/var/lib/jenkins” (Linux system). In pipeline code there is also no second workplace folder mentioned.
Hope someone could help me, unfortunately don’t get it.
if the agent is static (not a cloud agent), the configured agent root directory (go to configure screen of the agent)
Is this affecting all pipeline jobs that run on that agent or only some of them. If only some it would be good to have a minimal pipeline script that allows to reproduce the problem.
Jenkins home folder on controller and root folder on agent/remote system is both configured as: /var/lib/jenkins
Maybe same path on controller and agent is not a good idea?
Or maybe I should better use workspace flag (but where can I define this or is it already defined when installing jenkins?) instead of something like this:
steps{
sh 'robot /var/lib/jenkins/workspace/test4/master/test/test4.robot'
}
Another problem is that my pipeline will run this little Robot Framework script on controller without any problems, but on agent I get this error message:
+ robot /var/lib/jenkins/workspace/test4/master/test/test4.robot
/var/lib/jenkins/workspace/test4@tmp/durable-206e1d4a/script.sh.copy: 1: robot: not found
Seems that it creates and takes another temporarily generated folder where it couldn’t find the script or even doesn’t know the robot command. If I try this command on the agent and in this folder on bash it works fine.
Didn’t want to open a new thread, so I thought I add this question also here.
that means that the robot executable is not found in the path. When you test locally do you use the same user as the build agent uses? It might also depend on the way you connect the agent (outbound via ssh or inbound)
you said you run on an agent, then how do you connect the agent? Agents can be connected via ssh (outbound agents, Jenkins connects via ssh to the agent and starts the java process there, in the agents config you define as which user you connect) or via websocket/tcp (you connect the agent by starting the java process on the agent directly with parameters)
I’m pretty sure it is using TCP protocol to connect and communicate. Maybe I’ve made a mistake concerning user while I was installing docker?
Edit (the following issue is solved now by myself):
Now I don’t get the agent connected to controller by using the curl command with secret on this agent (node) page. Getting the following error message:
curl: option -name: expected a proper numerical parameter
So unfortunately this issue is still existing and I don’t found a way to solve it yet:
+ robot /var/lib/jenkins/workspace/test4/master/test/test4.robot
/var/lib/jenkins/workspace/test4@tmp/durable-206e1d4a/script.sh.copy: 1: robot: not found