Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autorandr.service "Failed to load profile: 'xxx' : Profile not found" althoug profile exists #379

Open
zahariaca opened this issue Feb 11, 2024 · 1 comment

Comments

@zahariaca
Copy link

Hello,

My setup is a laptop with an nvidia card. Laptop screen + 1 external monitor.
The base operating system is Ubuntu 22.04
I've started experimenting with i3wm and thus, have found the need for autorandr
I've figured out most what I need to get it working, but there is one issue, which I cannot figure out.
I've created a few configs, including a default config.

ll ~/.config/autorandr
Permissions Size User              Date Modified Name
drwxrwxr-x     - alexandru.zaharia 11 feb 10:51  test
.rw-rw-r--    27 alexandru.zaharia 11 feb 10:51  settings.ini
.rwxrwxr-x    22 alexandru.zaharia 11 feb 13:33  predetect
.rwxrwxr-x    82 alexandru.zaharia 10 feb 16:59  postswitch
drwxrwxr-x     - alexandru.zaharia 10 feb 16:20  laptop
drwxrwxr-x     - alexandru.zaharia 11 feb 11:00  dual
drwxrwxr-x     - alexandru.zaharia 11 feb 10:55  docked
drwxrwxr-x     - alexandru.zaharia 11 feb 10:59  default

My issue is, when I unplug the external monitor, I see autorandr.service executing the hook, but for some unknown reason, it cannot find my existing configs.
E.g: journalctl -f -u autorandr.service output:

feb 11 13:33:57 azaharia-ubu systemd[1]: Finished autorandr execution hook.
feb 11 13:34:03 azaharia-ubu systemd[1]: Starting autorandr execution hook...
feb 11 13:34:03 azaharia-ubu autorandr[12725]: ERROR: ld.so: object '/snap/snapd-desktop-integration/83/gnome-platform/$LIB/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
feb 11 13:34:03 azaharia-ubu autorandr[12726]: ERROR: ld.so: object '/snap/snapd-desktop-integration/83/gnome-platform/$LIB/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
feb 11 13:34:03 azaharia-ubu autorandr[12727]: ERROR: ld.so: object '/snap/snapd-desktop-integration/83/gnome-platform/$LIB/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
feb 11 13:34:03 azaharia-ubu autorandr[12725]: Failed to load profile 'default': Profile not found (line 1637)
feb 11 13:34:03 azaharia-ubu autorandr[12725]: autorandr running as user alexandru.zaharia (started from batch instance)
feb 11 13:34:03 azaharia-ubu autorandr[12702]: Running autorandr as alexandru.zaharia for display :1
feb 11 13:34:03 azaharia-ubu systemd[1]: autorandr.service: Deactivated successfully.
feb 11 13:34:03 azaharia-ubu systemd[1]: Finished autorandr execution hook.

Using autorandr default in a terminal has the expected and desired output. The issue is only present when it is run via the autorandr.service

I've looked around in autorandr.py, if the config did not exist, I would have expected a Failed to load profiles (line 1471), but it seems like the profiles are loaded, the error is at line 1637.

I've also fiddled with autorandr.service trying to load a different profile, from the ones I've created. Same issue.

I've searched through the github issues, but can't seem to find something that is similar.

Any help would be greatly appreciated.

@phillipberndt
Copy link
Owner

I'd start debugging by adding some debug output to load_profiles: Which directories is it invoked for (print the profile_path parameter) and which profiles does it find (print the profile variable).

It's interesting that autorandr is executed three times. Maybe that's related to your snap setup? Dumping os.getuid() and checking what users that corresponds to could also be an interesting lead. I suspect the error message comes from an autorandr instance that isn't running as your uid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants