AYON crash: PermissionError on Rocky 9.6 Linux

I’m encountering a crash when trying to launch AYON on Rocky Linux 9.6. The application fails to start with a PermissionError related to file access.

Error Traceback

Traceback (most recent call last):
  File "/opt/ayon/bin/ayon_launcher.py", line 42, in <module>
    from ayon_launcher.main import main
  File "/opt/ayon/lib/python3.9/site-packages/ayon_launcher/main.py", line 156, in <module>
    import ayon_launcher.bootstrap
  File "/opt/ayon/lib/python3.9/site-packages/ayon_launcher/bootstrap.py", line 89, in setup_logging
    with open(log_file, 'w') as f:
PermissionError: [Errno 13] Permission denied: '/var/log/ayon/ayon_launcher.log'

Environment Details

  • OS: Rocky Linux 9.6
  • AYON Core Version: 1.17
  • Installation Method: Package installation
  • User: Standard user (non-root)

Issue Analysis

The error occurs because AYON is trying to write to /var/log/ayon/ayon_launcher.log but the standard user doesn’t have write permissions to the /var/log/ directory.

Proposed Solution

I made a potential fix in this GitHub commit that addresses permission handling for log files on Linux systems:

GitHub Commit: Enhance process termination handling in tray tool. Added error handli… · bcnvisuals/ayon-core_bcn@4bc3c66 · GitHub

The commit modifies the logging setup to:

  1. Check for write permissions before attempting to create log files
  2. Fall back to user-writable directories (~/.local/share/ayon/logs/) when system directories are not accessible
  3. Create the log directory structure if it doesn’t exist

This would resolve the permission issue while maintaining proper logging functionality.

Temporary Workaround

As a temporary workaround, I’ve been running AYON with sudo, but this is not ideal for security reasons:

sudo /opt/ayon/bin/ayon_launcher

Has anyone else encountered this issue on Rocky Linux 9.6? Any suggestions for a proper fix would be greatly appreciated.

Just adding my 2 cents.
As far as I know, we don’t have an environment variable for the log file.

Also, I wonder where /var/log/ comes from. maybe it’s the default of logging module?

1 Like