Can't get Jenkins to start using Tomcat

僤鯓⒐⒋嵵緔 提交于 2019-12-05 01:43:21

Jenkins tries to create /usr/share/tomcat7/.jenkins to store its data, but the directory isnt created, so it throws NoHome Exception.

To fix this, create the .jenkins manually (with correct own/grp permissions to tomcat) and restart tomcat.

I was facing exactly the same problem. In my case it all started with a Jenkins/Git error:

"error: could not lock config file /usr/share/tomcat6/.gitconfig: Permission denied".

Apparently all permissions were OK and .gitconfig was not locked. I've executed a chown for tomcat user and everything was just fine again after a service restart:

sudo chown -R tomcat6:tomcat6 /var/lib/tomcat6/
sudo chown -R tomcat6:tomcat6 /etc/tomcat6/
sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6/

(My Linux is Debian based)

I am not sure what user you are running tomcat as, but it looks like jenkins can't create it's home directory. Look into the JENKINS_HOME parameter.

Try to inspect some directories like /var/lib/ to detect if the permissions are correctly made, maybe it's a "denied permission" that block the creation of jenkins home on "/var/lib/jenkins"

Finally I had to go through the hard way. I got ride of the Tomcat6 package from repo and reinstalled manually. It solved the problem. I really hate when Linux "official" packages don't work.

Thanks anyway.

Check which is the user running tomcat. And check which is the home directory of that user in /etc/passwd The home folder is probably missing. Create the folder and give ownership to the running tomcat user

Marks Garcia

Jenkins Configuration Issue

I was trying to setup Jenkins web app inside the Tomcat server and it continuously gave me this error:

SEVERE: Failed to initialize Jenkins hudson.util.NoHomeDir

This I fixed by creating the folder as follows:

mkdir /usr/share/tomcat7/.jenkins

On redeploying Jenkins I again noticed the following error:

WARNING: Failed to record boot attempts java.io.FileNotFoundException: /usr/share/tomcat7/.jenkins/failed-boot-attempts.txt (Permission denied)

I fixed this issue by giving full access to this folder.

sudo chmod 777 /usr/share/tomcat7/.jenkins

I believe 777 is not a good approach in a production environment, but for development perspective it looks ok.

Credits to: http://www.cyberaka.com/?p=422

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!