Jenkins won't execute python subprocess

142 views
Skip to first unread message

TheJonesin__9

unread,
Jul 10, 2018, 8:11:32 AM7/10/18
to Jenkins Users

I've seen a few suggestions to get around this issue but none of them work for me.


I have Jenkins installed locally on my laptop running Windows10. I've narrowed it down and it is indeed the line in my python script that's calling subprocess.run method. The Python scripts executes up to that point so I'm know the script is getting called from the Jenkins job.


It seems to be a permissions error as suggested in other posts. However, I'm not sure exactly what else I can do. I log into Windows as Admin so that's not the issue.


The Jenkins job is running as the Jenkins Admin user so I'm not sure what else I can do?

Console output:

17:39:21 Started by user admin
17:39:21 Building in workspace C:\Program Files (x86)\Jenkins\workspace\loadrunner_test
17:39:21 [loadrunner_test] $ cmd /c call C:\WINDOWS\TEMP\jenkins2453008242502676618.bat
17:39:21 
17:39:21 C:\Program Files (x86)\Jenkins\workspace\loadrunner_test>cmd /C C:\Python365\python.exe C:\PythonProjects\cicd_loadrunner\cicd_loadrunner.py 
17:44:42 Error:  <class 'subprocess.TimeoutExpired'>
17:44:42 
17:44:42 C:\Program Files (x86)\Jenkins\workspace\loadrunner_test>exit -1 
17:44:42 Build step 'Execute Windows batch command' marked build as failure
17:44:42 Finished: FAILURE


When it tries to execute the subprocess.run method, it just hangs and then eventually times out.


When I run the script manually using windows command prompt, it works as expected.


I've set the Jenkins process to log in using 'allow service to interact with desktop'.


There was once a suggestion saying to move the *.boto file into the Jenkins root but I can't see a *.boto file (Windows install).


Cheers

J

TheJonesin__9

unread,
Jul 10, 2018, 10:28:52 AM7/10/18
to Jenkins Users
Got there in the end. I had to create a new Windows user which I called JenkinsUser with local admin permissions. I then went into the Jenkins.exe service and am running Jenkins using my new user JenkinsUser.
Reply all
Reply to author
Forward
0 new messages