Issue
-
Error 404 occurs when accessing Glowroot through Liferay at /o/glowroot/ after migrating from version 2023.Q4 to 2024.Q1
- Error in logs:
2024-04-11 12:51:40.306 WARN [http-nio-8080-exec-46][code_jsp:161] {code="404", msg="/glowroot/", uri=/o/glowroot/}
Environment
- 2024.Q1
Resolution
-
Under the following condition in a linux infraestructure:
- The setenv.sh file is copied from the 2023.Q4 to the new version 2024.Q1
-
Below are the original setenv.sh files containing glowroot section for version 2023.Q4:
if [ "$1" = "glowroot" ]
then
GLOWROOT_OPTS="-javaagent:${CATALINA_HOME}/../glowroot/glowroot.jar"
CATALINA_OPTS="${CATALINA_OPTS} ${GLOWROOT_OPTS}"
shift
fi
if [ "$GLOWROOT_ENABLED" = "true" ]
then
GLOWROOT_OPTS="-javaagent:${CATALINA_HOME}/../glowroot/glowroot.jar"
CATALINA_OPTS="${CATALINA_OPTS} ${GLOWROOT_OPTS}"
fi
-
Below the original setenv.sh files containing glowroot section for version 2024.Q1
if [ "$1" = "glowroot" ]
then
GLOWROOT_OPTS="-javaagent:${CATALINA_HOME}/../glowroot/glowroot.jar -Dglowroot.enabled=true"
CATALINA_OPTS="${CATALINA_OPTS} ${GLOWROOT_OPTS}"
shift
fi
if [ "$GLOWROOT_ENABLED" = "true" ]
then
GLOWROOT_OPTS="-javaagent:${CATALINA_HOME}/../glowroot/glowroot.jar -Dglowroot.enabled=true"
CATALINA_OPTS="${CATALINA_OPTS} ${GLOWROOT_OPTS}"
fi
-
Comparing the two previous ones, we see the following line is different:
-Dglowroot.enabled=true
The line above enables or disables Glowroot (not adding it disables it, just like setting the value to false)
-
Finally, on a Tomcat server, to start Glowroot, you must launch Liferay as follows, having the previous property enabled (if the property is set to false o empty, even if Liferay is launched with Glowroot, it won't be accessible).
If using a Tomcat bundle, run Glowroot from the command line. Navigate to your bundle’s $CATALINA_HOME/bin folder. Then execute ./catalina.sh glowroot run.
Additional Information