Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type 47 is invalid #379

Closed
andrewbredow opened this issue Oct 14, 2019 · 3 comments
Closed

Type 47 is invalid #379

andrewbredow opened this issue Oct 14, 2019 · 3 comments

Comments

@andrewbredow
Copy link

Hello! Taking a look at my syslog, I see a many of these errors:

Oct 14 17:47:57 media spotifyd[2446]: 17:47:57 [WARN] couldn't parse packet from V4(10.0.1.1:5353): type 47 is invalid
Oct 14 17:47:57 media spotifyd[2446]: 17:47:57 [WARN] couldn't parse packet from V6([2600:6c4a:767f:e729:feec:daff:fe4c:73a0]:5353): type 47 is invalid

I doesn't seem to have any negative affects on discovery or playback. Any thoughts on what I should investigate to solve this?

@andrewbredow
Copy link
Author

Ah, I should have dug deeper, appears to be related to zeroconf plietar/librespot#178.

@Gnarflord
Copy link

This bug has finally been fixed with librespot-org/libmdns#19

The problem originated in the mDNS implementation used, which is needed by librespot to enable discovery of Spotify players in the local network. But some packet types were not implemented, so for example smart IOT plugs using mDNS in the same network could trigger this packet warning.the

libmdns is a dependency of librespot and the version bump to the fixed version was just merged into the 'dev' branch with librespot-org/librespot#1000, so we'll have to wait until the new version finds it's way into librespot:main

Unfortunately spotifyd uses the rather old librespot version v0.2.0, I've tried to build it with the current version v0.3.1 but the compilation fails:

error[E0599]: no function or associated item named `parse_from_bytes` found for type parameter `M` in the current scope
   --> /home/jan/.cargo/git/checkouts/librespot-06fda9f186b35c32/7efc62b/core/src/connection/handshake.rs:105:22
    |
105 |     let message = M::parse_from_bytes(data).unwrap();
    |                      ^^^^^^^^^^^^^^^^
    |                      |
    |                      function or associated item not found in `M`
    |                      help: there is an associated function with a similar name: `merge_from_bytes`

error[E0599]: no function or associated item named `parse_from_bytes` found for struct `APWelcome` in the current scope
   --> /home/jan/.cargo/git/checkouts/librespot-06fda9f186b35c32/7efc62b/core/src/connection/mod.rs:149:43
    |
149 |             let welcome_data = APWelcome::parse_from_bytes(data.as_ref())?;
    |                                           ^^^^^^^^^^^^^^^^ function or associated item not found in `APWelcome`

error[E0599]: no function or associated item named `parse_from_bytes` found for struct `APLoginFailed` in the current scope
   --> /home/jan/.cargo/git/checkouts/librespot-06fda9f186b35c32/7efc62b/core/src/connection/mod.rs:160:45
    |
160 |             let error_data = APLoginFailed::parse_from_bytes(data.as_ref())?;
    |                                             ^^^^^^^^^^^^^^^^ function or associated item not found in `APLoginFailed`

error[E0599]: no function or associated item named `parse_from_bytes` found for struct `Subscription` in the current scope
   --> /home/jan/.cargo/git/checkouts/librespot-06fda9f186b35c32/7efc62b/core/src/mercury/mod.rs:128:65
    |
128 | ...                   protocol::pubsub::Subscription::parse_from_bytes(&sub).unwrap();
    |                                                       ^^^^^^^^^^^^^^^^ function or associated item not found in `Subscription`

error[E0599]: no function or associated item named `parse_from_bytes` found for struct `librespot_protocol::mercury::Header` in the current scope
   --> /home/jan/.cargo/git/checkouts/librespot-06fda9f186b35c32/7efc62b/core/src/mercury/mod.rs:196:49
    |
196 |         let header = protocol::mercury::Header::parse_from_bytes(&header_data).unwrap();
    |                                                 ^^^^^^^^^^^^^^^^ function or associated item not found in `librespot_protocol::mercury::Header`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `librespot-core` due to 5 previous errors

So it seems like a bit of massaging is still required for a version bump of librespot. Still, I'd be really if we could get this fix in because I get >1000 warning messages from this bug per day in my journal

@eladyn
Copy link
Member

eladyn commented May 21, 2022

@Gnarflord Thank you for the update! Updating to a newer librespot version in spotifyd can get a little more involved (as you can see here), although on first sight, the changelog seems “manageable” to me.1 (famous last words)

As for your specific problem, I guess you could just build a custom version of spotifyd with the following patch:

diff --git a/src/main.rs b/src/main.rs
index 778c205..1b81f57 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -25,7 +25,7 @@ enum LogTarget {
 }
 
 fn setup_logger(log_target: LogTarget, log_level: LevelFilter) {
-    let logger = fern::Dispatch::new().level(log_level);
+    let logger = fern::Dispatch::new().level(log_level).level_for("libmdns::fsm", LevelFilter::Error);
 
     let logger = match log_target {
         LogTarget::Terminal => logger.chain(std::io::stdout()),

Which would silence those warning messages from libmdns.

Footnotes

  1. The output that you posted first needs a cargo update, since those are only errors in librespot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants