Troubleshooting Checkmk activation failures caused by file permission errors
This article explains how to troubleshoot Checkmk activation failures caused by incorrect file ownership and hard link permission errors.
LAST TESTED ON CHECKMK 2.5.0P14
Problem
When activating pending changes in Checkmk, the activation may fail because Checkmk cannot access files or directories required to complete the operation.
Depending on the affected files and the operation being performed, you may encounter errors such as:
Failed to create site config directoryor
Internal error: [Errno 13] Permission deniedThese errors may occur even when the Checkmk site is running and accessible through the web interface.
For example, the following error can appear during activation:
Internal error: [Errno 13] Permission denied:
'/omd/sites/mysite/local/repo-host'
Solution
Step 1: Identify the permission error
When activation fails, examine the error displayed under Setup > Activate pending changes.
Expand the Activation status section and review the Details column for the affected site.
If the error indicates a permission problem, examine the UI Job Scheduler log for additional information.
For Checkmk 2.5, run the following command as the site user:
OMD[mysite]:~$
tail -n 100 ~/var/log/ui-job-scheduler/ui-job-scheduler.logLook for a PermissionError message identifying the affected file or directory.
For example:
File "/omd/sites/mysite/lib/python3/cmk/gui/watolib/activate_changes.py", line 3572, in _create_config_sync_file_hash
with open(file_path, "rb") as f:
~~~~^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied:
'/omd/sites/mysite/local/lib/repo-host'This error indicates that Checkmk cannot read the specified file while preparing the configuration synchronization data required for activation.
Note
A failed hard link operation and a permission denied error can have different underlying causes. Review the specific error before making changes.
Step 2: Verify file ownership and permissions
Identify the affected file or directory from the error message and examine its ownership and permissions.
For example, the following error identifies the affected path:
PermissionError: [Errno 13] Permission denied:
'/omd/sites/mysite/local/lib/repo-host'
Use ls -l to inspect the affected file:
OMD[mysite]:~$
ls -l <path_to_file>
To examine the permissions of each directory in the path, run:
OMD[mysite]:~$
namei -l <path_to_file>Replace <path_to_file> with the path identified in the error message.
Check whether the file has the expected ownership and whether the Checkmk site user has the necessary permissions to access it.
Step 3: Correct the file ownership
If the affected file has incorrect ownership, correct it using chown.
Run the following command as root:
root@linux:~$
chown <site_user>:<site_group> <path_to_file>Replace <site_user> and <site_group> with the appropriate Checkmk site user and group, and <path_to_file> with the affected file.
If ownership is correct, investigate whether the file or its parent directories have restrictive permissions.
Important
Only modify ownership or permissions after identifying the cause of the access restriction. Avoid applying recursive changes to the entire Checkmk site directory.
Step 4: Activate pending changes
After correcting the identified ownership or permission issue:
Open the Checkmk web interface.
Navigate to Setup > Activate pending changes.
Select the affected site.
Click Activate on selected sites.
Verify that the activation completes successfully.
If the activation continues to fail, review the activation details and web.log for additional errors.
In distributed monitoring environments, verify that the remote sites are running and accessible before attempting another activation.