permission denied error when copying files in jenkins

2,944 views
Skip to first unread message

Pradeep Patra

unread,
Apr 21, 2016, 4:53:59 PM4/21/16
to Jenkins Users
Hi all,
. I have created a Jenkins server (master) and tried copying from one location/path of jenkins server to another location a Perl script within the same server. I have changed all the file/ folders for Jenkins user/group(chown,chgrp)and restarted the Jenkins server. While copying files I an getting error " regular file cp failed: Permission denied error after trigerring the Jenkins job which uses script to copy files. Can anyone help in this please?

Regards
Pradeep

Alex Domoradov

unread,
Apr 22, 2016, 8:29:11 AM4/22/16
to Jenkins Users
You can check in the server console

# su -l jenkins -s /bin/bash -c 'cp /location/path1/file1.txt /location2/path2/file1.txt'

David Hohl

unread,
Oct 26, 2016, 4:04:53 PM10/26/16
to Jenkins Users
I have actually the same problem, if I run:

su -l jenkins -s /bin/bash -c 'cp /var/lib/jenkins/workspace/xxx/index.php /var/www/html/tmp/'


the result is: 

cannot create regular file ‘/var/www/html/tmp/index.php’: Permission denied


What can I do?

John Mellor

unread,
Oct 26, 2016, 4:16:10 PM10/26/16
to jenkins...@googlegroups.com

‘/var/www/html directory normally requires root privileges to update.  Doing so as user Jenkins is not going to work unless you have altered the directory permissions (highly non-advisable) to match.

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2d7c85fc-86d5-44c8-bae7-22ea4ba9231e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages