dtcooper / raspotify

A Spotify Connect client that mostly Just Works™
https://dtcooper.github.io/raspotify
MIT License
4.63k stars 213 forks source link

LIBRESPOT_ONEVENT is not working #589

Closed mrdago closed 1 year ago

mrdago commented 1 year ago

Compatible Device

Are you sure?

Compatible OS

Compatible Configuration

Latest Version

Are you sure?

Due Diligence

What happened?

I'm using the option: LIBRESPOT_ONEVENT="/usr/bin/python /home/pi/mrp/mrpc.py" to start a python script and to process spotify player events. This option worked fine in raspotify version 0.31.1. Running the actual version I get the error: librespot[2768]: /usr/bin/python: can't open file '/home/pi/mrp/mrpc.py': [Errno 13] Permission denied Looking to the raspotify.service file I recognized that librespot is now started with the DynamicUser=yes option. For testing I changed the service file to the old content of raspotify@0.31.1 and the --onevent option is working as expected. So it seems that the approach with the dynamic user leads to that permission issue. It would be great if the actual service file could be analysed and reworked so that the LIBRESPOT_ONEVENT option can be used.

Relevant log output

Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z INFO  librespot] librespot 0.4.2 1975727 (Built on 2022-11-18, Build ID: D64mrIuL, Profile: rel                     ease)
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot] Environment variable(s):
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_NAME="raspotify (mozart)"
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_BACKEND="alsa"
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_CACHE="/var/cache/raspotify"
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_SYSTEM_CACHE="/var/lib/raspotify"
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_ONEVENT="/usr/bin/python /home/pi/mrp/mrpc.py"
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_QUIET=
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_AUTOPLAY=
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_DISABLE_AUDIO_CACHE=
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_DISABLE_CREDENTIAL_CACHE=
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_ENABLE_VOLUME_NORMALISATION=
Nov 23 07:50:59 mozart librespot[2726]: [2022-11-23T06:50:59Z TRACE librespot]                 LIBRESPOT_VERBOSE=
...
Nov 23 08:33:14 mozart librespot[2726]: [2022-11-23T07:33:14Z INFO  librespot::player_event_handler] Running ["/usr/bin/python", "/home/pi/mrp/mrpc.py"] with                      environment variables {"TRACK_ID": "2XqqICdvmbnQvbbVYsrt2D", "PLAYER_EVENT": "changed", "OLD_TRACK_ID": "3Z9bMAaCLvkcvkUealsvXB"}
Nov 23 08:33:14 mozart librespot[2726]: [2022-11-23T07:33:14Z INFO  librespot::player_event_handler] Running ["/usr/bin/python", "/home/pi/mrp/mrpc.py"] with                      environment variables {"POSITION_MS": "0", "DURATION_MS": "232773", "PLAYER_EVENT": "playing", "TRACK_ID": "2XqqICdvmbnQvbbVYsrt2D"}
Nov 23 08:33:14 mozart librespot[2891]: /usr/bin/python: can't open file '/home/pi/mrp/mrpc.py': [Errno 13] Permission denied
JasonLG1979 commented 1 year ago

As stated in the wiki in the troubleshooting section onevent scripts are basically useless currently.

github-actions[bot] commented 1 year ago

This issue is invalid.

github-actions[bot] commented 1 year ago

This issue has been marked wontfix and may not even be a bug at all.