spotifyd
spotifyd copied to clipboard
`No route to host` error with spotifyd 0.3.3 build
Description
After building spotifyd 0.3.3, I got some No route to host
error, while 0.3.2 artifact gives me the right results.
relates to Homebrew/homebrew-core#90676
To Reproduce
- install dependencies
rust
,dbus
,portaudio
- cargo build
cargo install --no-default-features --features dbus_keyring,portaudio_backend
- And then run
spotifyd --username homebrew_fake_user_for_testing --password homebrew --no-daemon --backend portaudio
Expected behavior Should be the same error output as 0.3.2
Logs
Click to show logs
$ /opt/homebrew/Cellar/spotifyd/0.3.3/bin/spotifyd --username homebrew_fake_user_for_testing --password homebrew --no-daemon --backend portaudio
No config file specified. Running with default values
No proxy specified
Using software volume controller.
Connecting to AP "ap.spotify.com:443"
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
^CPANIC: Shutting down spotifyd. Error message: `async fn` resumed after completion
$ /opt/homebrew/Cellar/spotifyd/0.3.2/bin/spotifyd --username homebrew_fake_user_for_testing --password homebrew --no-daemon --backend portaudio
No config file specified. Running with default values
No proxy specified
Using software volume controller.
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
Connecting to AP "104.154.127.126:443"
Caught panic with message: Authentication failed with reason: BadCredentials
Compilation flags
- [ ] dbus_mpris
- [x] dbus_keyring
- [] alsa_backend
- [x] portaudio_backend
- [ ] pulseaudio_backend
- [ ] rodio_backend
Versions (please complete the following information):
- OS:
macOS 12-arm
- Spotifyd:
0.3.3
- cargo:
1.56.0
error log
$ /opt/homebrew/Cellar/spotifyd/0.3.3/bin/spotifyd -u homebrew_fake_user_for_testing \
→ -p homebrew --no-daemon --backend portaudio
No config file specified. Running with default values
No proxy specified
Using software volume controller.
Connecting to AP "ap.spotify.com:443"
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
^CPANIC: Shutting down spotifyd. Error message: `async fn` resumed after completion
Any update on this thread?
Hi!
Both the logs for 0.3.2
and for 0.3.3
show the HostUnreachable
unreachable. Are you able, to manually ping ap.spotify.com
?
As for the homebrew update PR, you linked to: I think, the issue here is rather that spotifyd
no longer fails on bad credentials, which the brew tests have assertions for. I created a PR, which tries to address this problem.
Hope, this helps somehow!
I can manually ping
$ ping ap.spotify.com
PING ap.gslb.spotify.com (35.190.244.93): 56 data bytes
64 bytes from 35.190.244.93: icmp_seq=0 ttl=59 time=40.703 ms
64 bytes from 35.190.244.93: icmp_seq=1 ttl=59 time=42.408 ms
The error messages was when I tested in my local though.
I'm not sure, what you mean by "local"?
Do you know, wether brew
is doing some kind of containerization that would prevent spotifyd from reaching spotify?
This issue is unrelated to bad credentials. I am experiencing the same error message, but everything still works as intended, so I wonder what is actually failing?
❯ /opt/homebrew/opt/spotifyd/bin/spotifyd --no-daemon --backend portaudio --config-path ~/.config/spotifyd
Loading config from "/Users/sora/.config/spotifyd"
No proxy specified
Using software volume controller.
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
Connecting to AP "ap-gew1.spotify.com:443"
Authenticated as "heeysora" !
Country: "CH"
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
Loading <謳> with Spotify URI <spotify:track:2iYsZ5TowQRZFOa0bYPUc7>
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
<謳> (542600 ms) loaded
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
❯ ping ap-gew1.spotify.com
PING ap-gew1.spotify.com (104.199.65.124): 56 data bytes
64 bytes from 104.199.65.124: icmp_seq=0 ttl=105 time=19.633 ms
64 bytes from 104.199.65.124: icmp_seq=1 ttl=105 time=19.357 ms
64 bytes from 104.199.65.124: icmp_seq=2 ttl=105 time=19.315 ms
64 bytes from 104.199.65.124: icmp_seq=3 ttl=105 time=19.691 ms
64 bytes from 104.199.65.124: icmp_seq=4 ttl=105 time=18.727 ms
^C
--- ap-gew1.spotify.com ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 18.727/19.345/19.691/0.342 ms
Ah, right! Thanks @HeySora, you got me on the right track.
The issue @chenrui333 mentioned here is primarily that spotifyd
has been started with invalid credentials, which results in a bug in spotifyd
and leads to a crash[^1]. This is fixed in this PR.
So the error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
errors indeed don't seem to influence spotifyd
s ability to function.
Actually, they probably originate in libmdns
(a library that librespot
uses to advertise itself on the network, IIUC). If you'd like to track that problem down, you should be able to
- run
librespot
on its own (see QUICKSTART); this should produce similar logs - run
librespot
withRUST_LOG=libmdns=trace
as an environment variable, which should then print many messages fromlibmdns
, which might help with this.
Edit: I might as well be enough to turn on verbose logging in spotifyd
via --verbose
and look especially at the messages before such errors. (HostUnreachable
)
However, I'm not sure, wether this is suitable to investigate in this issue.
Again, thank you both for your help!
[^1]: A future is polled again after it returned ready with the credential error.
Thank you for the details @eladyn 😊
I ran spotifyd
with --verbose
for a short while, starting two songs, and getting this error multiple times.
Every single time it happened, these exact lines appeared (I just censored part of my IPv6 prefix for privacy)
found interface Interface { name: "en0", addr: V4(Ifv4Addr { ip: 192.168.1.34, netmask: 255.255.255.0, broadcast: Some(192.168.1.255) }) }
found interface Interface { name: "en0", addr: V6(Ifv6Addr { ip: 2a04:ee41:XXXX:XXXX:83a:1ff4:9b37:d813, netmask: ffff:ffff:ffff:ffff::, broadcast: None }) }
found interface Interface { name: "en0", addr: V6(Ifv6Addr { ip: 2a04:ee41:XXXX:XXXX:38f2:3e62:f023:9d18, netmask: ffff:ffff:ffff:ffff::, broadcast: None }) }
scheduling Read for: 2
scheduling Read for: 2
sending packet to [ff02::fb]:5353
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
sending packet to [ff02::fb]:5353
error sending packet Os { code: 65, kind: HostUnreachable, message: "No route to host" }
loop poll - 616.4835ms
loop time - Instant { t: 4165452110321 }
And well, indeed, trying to contact that IPv6 multicast address seems to be causing issues.
❯ ping6 ff02::fb
PING6(56=40+8+8 bytes) fe80::1c78:8bb2:8502:6ed3%en0 --> ff02::fb
ping6: sendmsg: No route to host
ping6: wrote ff02::fb 16 chars, ret=-1
ping6: sendmsg: No route to host
ping6: wrote ff02::fb 16 chars, ret=-1
ping6: sendmsg: No route to host
ping6: wrote ff02::fb 16 chars, ret=-1
ping6: sendmsg: No route to host
ping6: wrote ff02::fb 16 chars, ret=-1
^C
--- ff02::fb ping6 statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss
So if I had to guess, spotifyd
's ability to function would be affected in an IPv6-only environment.
I would not mind sending the entire logfile if it can help! I would simply need confirmation of which sensitive parts should be censored prior to uploading (like potential authentification tokens?)
Hmm, that is interesting. I'm currently guessing that this is something specific to macOS, since ff02::fb
should be the standard multicast IPv6 address and I have been able to reproduce this on a different Mac.
Would you be able to try the example provided by libmdns
? It should be as easy as cloning the repo and running cargo run --example register
. To see the exact same logs, you'd need to increase the loglevel that is defined here to libmdns=trace
. If the example shows the same behaviour, it might be worth reporting that issue over there.
Thanks for your help with investigating!