5
votes

While upgrading my Artifactory server (free OSS version) from the version 5.2.0 to the latest 5.4.5, I was hit by an ARTIFACTORY_PID problem. After migrating from 5.3.2 to 5.4.0, the Artifactory server did not want to start anymore complaining about

PID file /var/opt/jfrog/run/artifactory.pid not readable (yet?) after start.

I found the only way around it is to remove the line export CATALINA_PID=$ARTIFACTORY_PID from the setenv.sh of the tomcat.

Note that upgrade from 5.2.0 to 5.3.2 went smoothly.

However, after upgrading from 5.4.0 to the latest 5.4.5 this trick does not work anymore. Now I get an error:

Job for artifactory.service failed because a configured resource limit was exceeded. See "systemctl status artifactory.service" and "journalctl -xe" for details.

And when executing service artifactory status, I get:

● artifactory.service - Setup Systemd script for Artifactory in Tomcat Servlet Engine
   Loaded: loaded (/usr/lib/systemd/system/artifactory.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: resources) since Tue 2017-07-25 09:40:10 CEST; 4s ago
  Process: 31912 ExecStart=/opt/jfrog/artifactory/bin/artifactoryManage.sh start (code=exited, status=0/SUCCESS)

Jul 25 09:40:10 linux systemd[1]: Failed to start Setup Systemd script for Artifactory in Tomcat Servlet Engine.
Jul 25 09:40:10 linux systemd[1]: Unit artifactory.service entered failed state.
Jul 25 09:40:10 linux systemd[1]: artifactory.service failed.

In fact Artifactory is now running showing version 5.4.5, but I am not happy about all those errors above.

Plus I am a bit failing to understand the purpose of CATALINA_PID and/or ARTIFACTORY_PID. Why the tomcat was failing on the startup because of this file? What was wrong with the permissions? I think I did no extra actions before.

The only difference that before it was installed from an official downloaded rpm. But now using an official remote yum repo.

If I try to create an empty /var/opt/jfrog/run/artifactory.pid file, while Artifactory is running, it gets deleted. Who is deleting this file and why? Is it a standard tomcat behavior?

OS: CentOS 7, up to date.

2
I appear to have similar symptoms, I am using puppet to start the script on 18.04β and if I let puppet start the service via systemd, it does not create the pid, but if I run the artifactoryManage.sh it will create the pid. - cgseller

2 Answers

7
votes

In my case (in a slow virtual machine) the error message from the command artifactoryManage.sh start was:

ERROR: Artifactory Tomcat server did not start in 60 seconds. Please check the logs

The log file told that the only problem was slowness (/var/opt/jfrog/artifactory/logs/artifactory.log):

### Artifactory successfully started (64.802 seconds) ###

The problem was solved by adding a longer timeout to the service definition at /etc/systemd/system/artifactory.service:

[Service]
Environment=START_TMO=120

After editing the service definition, as you know, systemctl daemon-reload was needed.

5
votes

Run this script:

/opt/jfrog/artifactory/bin/artifactoryManage.sh start

It will show the exact error to you.

In my case it was java version not updated. So I updated to java 1.8.