Platform
RedHat Linux 9.5
ArcGIS Monitor 2024.1.1
Problem
ArcGIS Monitor 2024.1.1 - Failed to retrieve license information
Description
I can install monitor without any issue.
su - root
--install the software silently
cd /data/installers/monitor/Monitor_Server_rpm
./ArcGIS-Monitor-server-2024.1.1.704-rpm.bin -l yes --nox11
Then, I can authorize monitor. See the documentation for "Authorize Monitor Server silently".
https://doc.arcgis.com/en/monitor/latest/install/linux/authorize-arcgis-monitor-server.htm
su - root
# /usr/lib/arcgis/monitor/server/tools/authorizeSoftware
-f /data/installers/license/Monitor.ecp
I can check that the license is fine.

I can finish up the setup of monitor.
su - root
--create the initial administrator account
# /usr/lib/arcgis/monitor/server/bin/arcgis-monitor-server
admin:security:users:add --username agsmonadmin --password "*****"
--name-first AGSMON --name-last ADMIN --email alertmon@acme.com --role admin
--connect Monitor Server to the database repository
# /usr/lib/arcgis/monitor/server/bin/arcgis-monitor-server admin:database:register
--address mondbpg.acme.com:5432 --database agsmondb2
--username agmon --password "*******" --encrypt false
# systemctl status arcgis-monitor-server
I can then log in to the monitor url
https://PS026033:30443/arcgis/monitor
But a warning message keep showing up "Failed to retrieve license information"


Troubleshooting
ArcGIS Monitor Logs show the message "installdir does not exist".


I enabled debug mode log level in ArcGIS Monitor and tried to refresh the license from the Monitor web app.
I got a few more messages that helped me narrow down the issue.
"Checking license 240 at /usr/lib/arcgis/monitor/server/framework/ESRI/License24.0"
Cause of the Problem
The ArcGIS Monitor Service runs under the "arcgis" user.
Hence, the "arcgis" user must own the /usr/lib/arcgis/monitor/server/framework/ESRI/License24.0/sysgen/keycodes file.
But when we authorize, we use the root account, because the "arcgis" user is a service account just to run the arcgis-monitor-server service, and we cannot log in as the "arcgis" user.
su - root
/usr/lib/arcgis/monitor/server/tools/authorizeSoftware
-f /data/installers/license/Monitor.ecp
Hence, the entire "framework" folder and subfolders are owned by root:root.
Therefore the "arcgis" user could not read the "keycodes" file.
Workaround
The workaround was quite simple.
I changed the owner of the "framework" folder and subfoders and files to be arcgis:arcgis.
su - root
chown -R arcgis:arcgis /usr/lib/arcgis/monitor/server/framework
Now, ArcGIS Monitor can validate the license just fine.

The "arcgis" user is the service account, we cannot log in as "arcgis" user, but we can run the authorization tool as "arcgis" using "sudo -u arcgis"
su - root
# sudo -u arcgis /usr/lib/arcgis/monitor/server/tools/authorizeSoftware
-f /data/installers/license/Monitor.ecp
I hope this helps if you encounter the same issue.