Announcements

Help Wizard

Step 1

NEXT STEP

[Bugreport] [Linux] "invalid option -session"

[Bugreport] [Linux] "invalid option -session"

Hey,

 

KDE is automatically restarting applicatios on login, that were running in the last session and thus, spotify is also restarted. Applications are started with a -sesstion argument, for example:

 

spotify -session 1020b17c184165000138602432300000023810069_1403993180_490291

 

currently, spotify then opens an error message box:

 

invalid-option-session.png

I'd suggest to use something like:

 

#ifdef LINUX

StringList getArgs() {

  StringList ret;

  for (int i = 0; i < application->arguments().length(), ++i) {

    if (application->arguments()[i] != "-sesstion")

      ++i;

    else

      ret.append(application->arguments()[i])

  }

  return ret;

}

#endif

 

Additionally, you should set Spotify as the message box header. It took me a while to figure out, that spotify was showing this error. 

 

Best Regards

Reply
7 Replies

With Spotify being build on Ubuntu, I would think a fix is unlikely sadly.

Peter
Spotify Community Mentor and Troubleshooter

Spotify Last.FM Twitter LinkedIn Meet Peter Rock Star Jam 2014


If this post was helpful, please add kudos below!

Hi,

 

edit: My solution didn't work after all. I just got an "invalid option" error after reboot

 

My solution to this was to rename spotify binary to spotify.real and substituted the spotify with a script.

 

#!/bin/bash

if [[ $1 == \-* ]]
then
  /opt/spotify/spotify-client/spotify.real
else
  /opt/spotify/spotify-client/spotify.real $@
fi

 

This script should skip all the options starting with "-" but pass through the URLs

 

ofc. I have to do the renaming and replacement avery time the client updates.

 

I still have the same issue, I can confirm this is annoying !

You could make a script that strips the session argument from the command being run. This has been brought up here before but I can't seem to find it, but know there was solutions.

SpotCommander - The most elegant, intuitive, feature-rich & universal remote control for Spotify, exclusive for Linux users!

I tried to strip the argument with a script but that didn't work as the session restore calls the real binary and not the script.

I don't think it's that easy for you, sorry.

 

Ubuntu also runs xfce4 in some instances and xfce4 is the issue here. It saves a restart command for spotify in the session files at .cache/sessions which makes it put out the error because apparently -session is not a valid option.

 

Proof: Closing Spotify before restarting makes the issue completely disappear. Also turning off the session save feature on logout helps.

 

Please consider looking into this, it's most likely just a matter of changing a small thing somewhere in order to not have it save that option in the session files.

This affects Gnome3 and KDE5 as well

Suggested posts