[GH-ISSUE #1574] Features List for Discovery #717

Closed
opened 2026-02-27 19:32:06 +03:00 by kerem · 4 comments
Owner

Originally created by @sethtroisi on GitHub (Sep 6, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1574

Description

BL;UF: I didn't know about the settings in Cargo.toml maybe they should be mentioned in the cross-compiling guide. Or maybe this is just me not being a

I managed to cross-compile librespot (#1573) but then I struggled for 30 minutes with this generic error related to not having enabled discovery.

[2025-09-06T05:38:32Z ERROR librespot] Credentials are required if discovery and oauth login are disabled.

I searched issues, -h, and tried googling it. The best I've found is the Options Page which not very helpfully says "Discovery
Select the librespot instance from within Spotify's client to authenticate via Spotify Connect." Great how do I enable that?

Eventually I grepped the source and found the flags that i didn't complie with in src/main.rs which pointed me at the list of options in Cargo.toml which I didn't know about as a non rust person.

This is so people can google for the same error.

Version

0.7.1

How to reproduce

Steps to reproduce the behavior in librespot e.g.

  1. Launch librespot with any combination of settings

Log

[2025-09-06T05:38:32Z INFO  librespot] librespot 0.7.1 987dfa5 (Built on 2025-09-06, Build ID: IlOR0BBO, Profile: release)
[2025-09-06T05:38:32Z TRACE librespot] Command line argument(s):
[2025-09-06T05:38:32Z TRACE librespot] 		v
[2025-09-06T05:38:32Z TRACE librespot] 		name "test"
[2025-09-06T05:38:32Z ERROR librespot] Credentials are required if discovery and oauth login are disabled.
Originally created by @sethtroisi on GitHub (Sep 6, 2025). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1574 ### Description BL;UF: I didn't know about the settings in `Cargo.toml` maybe they should be mentioned in the cross-compiling guide. Or maybe this is just me not being a I managed to cross-compile librespot (#1573) but then I struggled for 30 minutes with this generic error related to not having enabled discovery. ``` [2025-09-06T05:38:32Z ERROR librespot] Credentials are required if discovery and oauth login are disabled. ``` I searched issues, `-h`, and tried googling it. The best I've found is the [Options Page](https://github.com/librespot-org/librespot/wiki/Options#discovery) which not very helpfully says "Discovery Select the librespot instance from within Spotify's client to authenticate via Spotify Connect." Great how do I enable that? Eventually I grepped the source and found the flags that i didn't complie with in `src/main.rs` which pointed me at the list of options in `Cargo.toml` which I didn't know about as a non rust person. This is so people can google for the same error. ### Version 0.7.1 ### How to reproduce Steps to reproduce the behavior in *librespot* e.g. 1. Launch `librespot` with any combination of settings ### Log ``` [2025-09-06T05:38:32Z INFO librespot] librespot 0.7.1 987dfa5 (Built on 2025-09-06, Build ID: IlOR0BBO, Profile: release) [2025-09-06T05:38:32Z TRACE librespot] Command line argument(s): [2025-09-06T05:38:32Z TRACE librespot] v [2025-09-06T05:38:32Z TRACE librespot] name "test" [2025-09-06T05:38:32Z ERROR librespot] Credentials are required if discovery and oauth login are disabled. ```
kerem 2026-02-27 19:32:06 +03:00
  • closed this issue
  • added the
    wiki
    label
Author
Owner

@roderickvd commented on GitHub (Sep 6, 2025):

Don’t compile without default features unless you’re sure that’s what you want.

<!-- gh-comment-id:3261200303 --> @roderickvd commented on GitHub (Sep 6, 2025): Don’t compile without default features unless you’re sure that’s what you want.
Author
Owner

@kingosticks commented on GitHub (Sep 6, 2025):

Can you think of a short improvement to add to the wiki that would help? The existing compiling page does already list the available features, and show how to enable them, and the compiling page seems like a sensible place to put this.

Software feature flags are not a rust-specific practice, and we provide examples of how to do it, but I guess it's not enough. So from your point of view, how could we improve the existing documentation?

<!-- gh-comment-id:3261441429 --> @kingosticks commented on GitHub (Sep 6, 2025): Can you think of a short improvement to add to the wiki that would help? The existing compiling page does already list the available features, and show how to enable them, and the compiling page seems like a sensible place to put this. Software feature flags are not a rust-specific practice, and we provide examples of how to do it, but I guess it's not enough. So from your point of view, how could we improve the existing documentation?
Author
Owner

@sethtroisi commented on GitHub (Sep 9, 2025):

@kingosticks thanks for the empathetic response.

The project has a great links that could have helped me fix this if I had RTFM better, there's instructions in your README.md and on the wiki for how to fix this. I was skimming and frustrated at the point I get here because I was >2 hour into trying to fix my music box when I got to compiling from source.

I think the error message ("Credentials are required if discovery and oauth login are disabled.") was confusing to me. I had assumed "discovery is disabled" meant I needed to pass some --enable-zeroconf flag to the binary, not that I needed to go back and compile with different flags.

I see there are two different Some messages for the two different cases at main.rs#l1233 Maybe you should print the message in the exit(1) case on 1244. Seeing "librespot compiled without zeroconf backend" would have pointed me in the right direct.

For the wiki my small suggestion would be adding [feature-flags] to the docker command like this

docker run -v /tmp/librespot-build:/build librespot-cross [feature-flags]

or possibly adding the bold text here

"If only one architecture is desired or you need to configure features cargo can be invoked directly with the appropriate options"

<!-- gh-comment-id:3268405478 --> @sethtroisi commented on GitHub (Sep 9, 2025): @kingosticks thanks for the empathetic response. The project has a great links that could have helped me fix this if I had RTFM better, there's instructions in your README.md and on the wiki for how to fix this. I was skimming and frustrated at the point I get here because I was >2 hour into trying to fix my music box when I got to compiling from source. I think the error message ("Credentials are required if discovery and oauth login are disabled.") was confusing to me. I had assumed "discovery is disabled" meant I needed to pass some `--enable-zeroconf` flag to the binary, not that I needed to go back and compile with different flags. I see there are two different `Some` messages for the two different cases at [main.rs#l1233](https://github.com/librespot-org/librespot/blob/f16a30e86a5175cc7f361f37bbe9447fe218babc/src/main.rs#L1233) Maybe you should print the message in the exit(1) case on 1244. Seeing "librespot compiled without zeroconf backend" would have pointed me in the right direct. For the wiki my small suggestion would be adding [feature-flags] to the docker command like this ``` docker run -v /tmp/librespot-build:/build librespot-cross [feature-flags] ``` or possibly adding the bold text here "If only one architecture is desired **or you need to configure features** cargo can be invoked directly with the appropriate options"
Author
Owner

@kingosticks commented on GitHub (Sep 9, 2025):

I think I was responsible for that terse error message so I felt guilty! I agree with what you say, that it's unclear what's compile-time feature and run-time option here. I'll submit something that makes it clearer based on your feedback.

I've been thinking we should print out the enabled features on startup. That would help us better debug the log file we get (for those people that bother to provide them). I think we already do error out for all incompatible cases but maybe we could also warn/log the suspect cases. In this case it's a little more complex because you can still login without either discovery or oauth, if you have a pre-existing credentials state file. But that doesn't prevent us improving this error message.

<!-- gh-comment-id:3268973103 --> @kingosticks commented on GitHub (Sep 9, 2025): I think I was responsible for that terse error message so I felt guilty! I agree with what you say, that it's unclear what's compile-time feature and run-time option here. I'll submit something that makes it clearer based on your feedback. I've been thinking we should print out the enabled features on startup. That would help us better debug the log file we get (for those people that bother to provide them). I think we already do error out for all incompatible cases but maybe we could also warn/log the suspect cases. In this case it's a little more complex because you can still login without either discovery or oauth, if you have a pre-existing credentials state file. But that doesn't prevent us improving this error message.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#717
No description provided.