NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.27k stars 13.52k forks source link

Spotify doesn't open after upgrade #295670

Open 0x7067 opened 5 months ago

0x7067 commented 5 months ago

Describe the bug

I have automatic upgrades setup in my nix config file and after today's update Spotify doesn't open anymore

Steps To Reproduce

Steps to reproduce the behavior:

  1. Upgrade all your packages to today's date (on nixpkgs unstable)
  2. Launch Spotify

Expected behavior

Spotify should open

Additional context

When launched via terminal I get this message and nothing else happens:

/etc/profiles/per-user/pedro/bin/spotify: /nix/store/78avj53r2gfxdp141kj7cymbzsdnsjpl-curl-8.6.0/lib/libcurl-gnutls.so.4: no version information available (required by /etc/profiles/per-user/pedro/bin/spotify)
/nix/store/ki7nn8j53xjhq1bjx6hgclaf3n8yqbbh-spotify-1.2.31.1205.g4d59ad7c/share/spotify/.spotify-wrapped: /nix/store/78avj53r2gfxdp141kj7cymbzsdnsjpl-curl-8.6.0/lib/libcurl-gnutls.so.4: no version information available (required by /nix/store/ki7nn8j53xjhq1bjx6hgclaf3n8yqbbh-spotify-1.2.31.1205.g4d59ad7c/share/spotify/.spotify-wrapped)
/nix/store/ki7nn8j53xjhq1bjx6hgclaf3n8yqbbh-spotify-1.2.31.1205.g4d59ad7c/share/spotify/.spotify-wrapped: /nix/store/78avj53r2gfxdp141kj7cymbzsdnsjpl-curl-8.6.0/lib/libcurl-gnutls.so.4: no version information available (required by /nix/store/ki7nn8j53xjhq1bjx6hgclaf3n8yqbbh-spotify-1.2.31.1205.g4d59ad7c/share/spotify/.spotify-wrapped)

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
these 4 paths will be fetched (0.03 MiB download, 0.17 MiB unpacked):
  /nix/store/7hhd9smnjspppk4k6n47bkw64fdbgbrz-binutils-wrapper-2.41
  /nix/store/8vn7gbnnflrd8cvjwp564n0pm9v9xxdn-expand-response-params
  /nix/store/qhpw32pz39y6i30b3vrbw5fw6zv5549f-gcc-wrapper-13.2.0
  /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux
copying path '/nix/store/8vn7gbnnflrd8cvjwp564n0pm9v9xxdn-expand-response-params' from 'https://cache.nixos.org'...
copying path '/nix/store/7hhd9smnjspppk4k6n47bkw64fdbgbrz-binutils-wrapper-2.41' from 'https://cache.nixos.org'...
copying path '/nix/store/qhpw32pz39y6i30b3vrbw5fw6zv5549f-gcc-wrapper-13.2.0' from 'https://cache.nixos.org'...
copying path '/nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.9, NixOS, 24.05 (Uakari), 24.05.20240309.3030f18`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/store/nra828scc8qs92b9pxra5csqzffb6hpl-source`

I've found this other issue and tried overriding curl to enable gnutls support with:

(curl.override {
        gnutlsSupport = true;
        opensslSupport = false;
      })

I've temporarily solved the issue by booting an older generation and turning off automatic upgrade

Any ideas?

Thanks in advance

gregtjack commented 5 months ago

rm -rf ~/.cache/spotify

https://wiki.archlinux.org/title/Spotify#/usr/lib/libcurl-gnutls.so.4_error

0x7067 commented 5 months ago

rm -rf ~/.cache/spotify

https://wiki.archlinux.org/title/Spotify#/usr/lib/libcurl-gnutls.so.4_error

That solved the issue, many thanks!

Aadniz commented 5 months ago

I'm getting segmentation fault (core dumped). Neither removing ~/.cache/spotify nor ~/.config/spotify helped

EDIT seems like it worked after a reboot

tiecia commented 5 months ago

I had this same issue after a nxpkgs update today on unstable. Removing ~/.cache/spotify and rebooting fixed it for me.

hbenazha commented 5 months ago

Yeah, this also solved the issue for me !

dylan-gonzalez commented 2 months ago

Does anyone know why removing the cache fixes this though?

martinvonwittich commented 2 months ago

I believe the no version information available error messages are a red herring - they are printed even when Spotify works fine. Probably people only noticed them while trying to track down why Spotify won't start, and assumed that those warnings were related the problem.

In theory, Spotify seems to have a logging infrastructure that might've been helpful to determine the actual problem; while running execsnoop from the bcc package, I can see a --log-file= and a --log-severity=disable argument:

548.205 spotify          196865  196580    0 /run/current-system/sw/bin/spotify
548.215 .spotify-wrappe  196865  196580    0 /nix/store/b56s7fa6wjjh2wm0qrn7rjivxi6517yr-spotify-1.2.31.1205.g4d59ad7c/share/spotify/.spotify-wrapped
548.263 .spotify-wrappe  196868  196865    0 /nix/store/b56s7fa6wjjh2wm0qrn7rjivxi6517yr-spotify-1.2.31.1205.g4d59ad7c/share/spotify/.spotify-wrapped --type=zygote --no-zygote-sandbox --no-sandbox --log-severity=disable --user-agent-product=Chrome/121.0.6167.139 Spotify/1.2.31.1205 --lang=en --user-data-dir=/home/martin/.cache/spotify --log-file=/nix/store/b56s7fa6wjjh2wm0qrn7rjivxi6517yr-spotify-1.2.31.1205.g4d59ad7c/share/spotify/debug.log
548.263 .spotify-wrappe  196869  196865    0 /nix/store/b56s7fa6wjjh2wm0qrn7rjivxi6517yr-spotify-1.2.31.1205.g4d59ad7c/share/spotify/.spotify-wrapped --type=zygote --no-sandbox --log-severity=disable --user-agent-product=Chrome/121.0.6167.139 Spotify/1.2.31.1205 --lang=en --user-data-dir=/home/martin/.cache/spotify --log-file=/nix/store/b56s7fa6wjjh2wm0qrn7rjivxi6517yr-spotify-1.2.31.1205.g4d59ad7c/share/spotify/debug.log
548.363 exe              196916  196865    0 /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --log-severity=disable --user-agent-product=Chrome/121.0.6167.139 Spotify/1.2.31.1205 --lang=en --user-data-dir=/home/martin/.cache/spotify --log-file=/nix/store/b56s7fa6wjjh2wm0qrn7rjivxi6517yr-spotify-1.2.31.1205.g4d59ad7c/share/spotify/debug.log --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,2354234044308538917,14234759250245214987,262144 --disable-features=BackForwardCache,DocumentPictureInPictureAPI --variations-seed-version

Unfortunately the log file isn't created (possibly because it's not possible to write to the nix store...?), and those parameters are added by an outer Spotify process when it spawns an inner Spotify process, and I can't figure out how to override them to increase the log severity or to point it to a different log file path, so I haven't been able to get it to log anything.

Instead, I used strace to track down the issue: strace -Y -yy -f -o strace.log spotify

In the strace.log, I noticed that shorty before it dies with exit code 1, it attempts to read a SingletonCookie symlink:

196503<.spotify-wrappe> readlink("/home/martin/.cache/spotify/SingletonCookie",  <unfinished ...>
196506<.spotify-wrappe> gettid( <unfinished ...>
196503<.spotify-wrappe> <... readlink resumed>"243435715514811332", 4096) = 18
196506<.spotify-wrappe> <... gettid resumed>) = 196506<.spotify-wrappe>
196503<.spotify-wrappe> readlink("/tmp/.org.chromium.Chromium.XWD1G5/SingletonCookie",  <unfinished ...>

I deleted all Singleton symlinks with `rm ~/.cache/spotify/Singleton`, and this resolved the problem for me.

Interestingly enough, when I exit Spotify cleanly, Spotify deletes them itself. Is it possible that this issue is caused by Spotify somehow getting killed uncleanly? I tried to reproduce the issue by killing Spotify with pkill spotify and even pkill -KILL spotify, but so far I haven't been able to reproduce the issue.