500 internal server error when registering new hosts

CMK version:2.2.0p4
OS version:Server : Ubuntu 22.04 LTS (aws), Host(failed): Ubuntu 16.04 and 20.04 Host(success): Ubuntu 20.04

**Error message:ERROR [cmk_agent_ctl] Error registering existing host at https://(checkmkserveriphere):8000/monitoring

Caused by:
Request failed with code 500 Internal Server Error: Internal Server Error
**

I was able to register one host, but after that i tried on two different hosts and both give the same error, tried with -v and -vvvv and it didn’t give any more info than this

Digged a bit in the logs and found this error triggering when the 500 internal server error happens :

**FileNotFoundError: [Errno 2] No such file or directory: ‘/omd/sites/monitoring/var/check_mk/web/automation/automation.secret’
**

I got the exact same message of missing automation.secret file.
I tried to copy the missed file from another site with same version and then chmod site1:site1 on the secret file. And then I saw another error message no permission to read general setting. So I gave up this site and create another. I got too many users created locally after connected to ldap server.I think It was all due to I removed all users(except the current login one), cmkadmin,automation type of local users all got deleted.
Luckily, this is on my test cmk site.

Anyone got solutions to the missing secret or how to create new or delete requirement?

you can go to setup → users → and set a new automation secret for the “automation” user - not sure why your automation user doesn’t have one by default, but that should be a workaround for this error.
I’m however not sure if the missing automation.secret is an issue for the host registration.

I think problem is in that a cloned account has all the same paths of it’s original account, i had cloned automation → automation2 as i had problems witth update agent not liking secrets meanwhile tls registration wanted secrets i think. but this just ended in automation2 searching for automation accounts secrets, removed automation2 account and used another account with normal password instead fixed this, but that is an issue in account cloning if it doesn’t change all the paths correctly

1 Like