skip to Main Content

I am getting error while i am trying to run JMeter script in jenkins on CentOS :

java.nio.file.AccessDeniedException: /home/username/Desktop

I have installed Jenkins on same CentOS and I am running it locally.
I have configured all the commands but it says access denied.

java.nio.file.AccessDeniedException: /home/username/Desktop

I am not able to recognize which user is getting accessed while running Jenkins.

The expected result is to run JMeter script in Jenkins successfully.

2

Answers


  1. Chosen as BEST ANSWER

    I went and changed the default user used by Jenkins to the system user. Now i have access and Jmeter scripts have started executing.


  2. It looks like that the user account which is being used for running Jenkins doesn’t have access to /home/username/Desktop folder which is being used by your script somehow.

    You either need to refactor your script and remove all references to the given folder or grant Jenkins read (and maybe write) permissions to it using i.e. setfacl command like:

    setfacl -m u:jenkins:rwx /home/username/Desktop
    

    another option is to make Jenkins user the owner of the given folder using chown command, however it may break your current user access rights so I would not recommend this:

    chown -R jenkins /home/username/Desktop
    

    one more workaround which I wouldn’t recommend even more is provide everyone read/write/execute permissions via chmod command

    chmod -R 777 /home/username/Desktop
    

    and last but not the least, you can download Jenkins war and execute it as your current user like:

    java -jar jenkins.war 
    

    this way Jenkins will have access to whatever your current user has access to.

    You might also be interested in Continuous Integration 101: How to Run JMeter With Jenkins article.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search