mariusor/mpris-scrobbler

Credentials folder is being written to root directory

alecvn opened this issue · 9 comments

When I tried to install from scratch today I noticed that the credentials are being written to the root directory:

$ mpris-scrobbler-signon -vvv enable lastfm
WARNING main::loading_credentials: failed
TRACING main::writing_pid: /run/user/1000/mpris-scrobbler.pid
WARNING main::load_credentials: no credentials were loaded
INFO    signon::enable: last.fm
DEBUG   saving::credentials[1]: /mpris-scrobbler/credentials
WARNING saving::credentials:failed: /mpris-scrobbler/credentials
WARNING signon::config_error: unable to write to configuration file
TRACING main::cleanup_pid: /run/user/1000/mpris-scrobbler.pid

I'm on Ubuntu 18.04 and compiling from source.

That's definitely something wrong with your environment variables which we are using to create the path.

You are probably missing both XDG_DATA_HOME and HOME, any of them would be enough to build the proper path.

I will add a note to make the signon helper fail if it can't find them though, thank you.

Same problem here on arch linux. I have $HOME set but $XDG_DATA_HOME is unset. I think you should make a condition that if it is unset, then just use $HOME/.local/share/mpris-scrobbler directly.

I can confirm that setting the variable fixes the issue.

Thank you @ReekyMarko. I will take care of it. Can't give a definite ETA as I'm in the middle of a different project, but it's going to be the first thing I'll fix. :) Keep an eye on this ticket.

Could you guys check with a version compiled from latest master?

I think I fixed the problem in commit c374d5f.

I have set my XDG_DATA_HOME in the meantime, but latest master does seem to have fixed this problem.

Thanx. If @ReekyMarko can confirm I'd mark this as closed.

Unset $XDG_DATA_HOME and built latest master. Works now without the variable

Cool. :) Thanx both.