Reputation: 101
I'm setting up a Jenkins system at MacOSX Server for an automatically build after a svn checkin. But when the build is starting I get these java error at the console output. Does anyone have experience with Jenkins and these error?
Gestartet durch Benutzer anonymous
[EnvInject] - Loading node environment variables.
Baue in Workspace /Users/Shared/Jenkins/Home/jobs/myProject/workspace
Cleaning local Directory .
java.nio.file.AccessDeniedException: /Users/Shared/Jenkins/Home/jobs/my Project/workspace/./.svn/pristine/04/040d4cd4de48d844246c38e096a78718879bfafb.svn-base
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at hudson.Util.deleteFile(Util.java:255)
at hudson.Util.deleteRecursive(Util.java:318)
at hudson.Util.deleteContentsRecursive(Util.java:220)
at hudson.Util.deleteRecursive(Util.java:309)
at hudson.Util.deleteContentsRecursive(Util.java:220)
at hudson.Util.deleteRecursive(Util.java:309)
at hudson.Util.deleteContentsRecursive(Util.java:220)
at hudson.Util.deleteRecursive(Util.java:309)
at hudson.Util.deleteContentsRecursive(Util.java:220)
at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:81)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:162)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:988)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:969)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:945)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:894)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:830)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1276)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Sending e-mails to: m...
Finished: FAILURE
Upvotes: 10
Views: 50692
Reputation: 15237
This problem is occurring because you don't have permission to execute the job on the Jenkins jobs directory (in your case /Users/Shared/Jenkins/Home/jobs
) or you don't have permission on the Jenkins directory /var/lib/jenkins/
.
I encountered the same issue when I tried to copy the jobs directory from one server to another.
To solve this, we need to change the owner of the jobs
directory to the jenkins
user:
sudo chown -R jenkins:jenkins /Users/Shared/Jenkins/Home/jobs
If this does not solve the problem, the issue might be with the permissions of your /var/lib/jenkins
directory:
sudo chown -R jenkins:jenkins /var/lib/jenkins/
This should resolve your problem.
P.S. You may need to restart your Jenkins application.
Upvotes: 10
Reputation: 1651
If you have encountred this issue usually it's related to the user running the jenkins process and sometimes that user wouldn't be able to do some actions or access files so you will need to provide him with certain permissions as said above you can use chown
or chmod
like so:
# Change ownership to a whole directory
chmod -R user:group /path/to/dir
# Change ownership to a single file
chmod user:group /path/to/file
# Careful with the value after chmod
# You will need to only give what's needed
# Change ownership to a whole directory
chmod 744 -R /path/to/dir
# Change ownership to a single file
chmod 744 /path/to/file
An in your case since you're dealing with jenkins usually you can either find the directory of jenkins data under:
/var/lib/jenkins/
JENKINS_HOME=/var/jenkins_home
http://localhost:8080/configure
Upvotes: 0
Reputation: 101
You need to modify the permission for jenkins user so that you can run the shell commands. Make root user of your machine as default user of jenkins, will slove your problem.
Following process is for CentOS
vim /etc/sysconfig/jenkins
$JENKINS_USER="root"
chown -R root:root /var/lib/jenkins
chown -R root:root /var/cache/jenkins
chown -R root:root /var/log/jenkins
service jenkins restart
ps -ef | grep jenkins
Upvotes: -3
Reputation: 610
Seems like the os user which is running jenkins has no write privileges for either the complete workspace directory or some of the files in the workspace directory.
Upvotes: 2