michaelherger / spotty

A simple Spotify Connect client allowing to pipe a single track's audio to stdout.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thread 'main' panicked at 'cannot poll Result twice', /checkout/src/libcore/option.rs:839:4

reneklootwijk opened this issue · comments

I build the 0.7.0 on Freebsd 11 (actually Freenas 11). When not authenticated it appears as a Spotify Connect endpoint in the Spotify Client, however as soon as you connect it quits with the following error in the Squeezebox logs:

thread 'main' panicked at 'cannot poll Result twice', /checkout/src/libcore/option.rs:839:4

When I start it from the command line the same error is thrown.

Just build 0.7.0 on FreeBSD 11.1-RELEASE-p4. Limited usage (2 playlists, containing around 60 songs), but so far everything works fine. The device I set as an Spotify endpoint, shows up in the Spotify application (on Windows) and I can use it.

Probably should have mentioned that the LogitechMediaServer itself is also running in a jail on FreeNAS 11. Just build the helper application on plain FreeBSD 11.1

I just installed a FreeBSD 11 in a virtual machine using the FreeBSD-11.1-RELEASE-amd64-dvd1.iso, installed rust using:
curl https://sh.rustup.rs -sSf | sh

Cloned the spotty repository:
git clone https://github.com/michaelherger/spotty.git

Build it using:
/root/.cargo/bin/cargo build --release

Executed the result from the command line:
target/release/spotty -n "Testje" -a

but still the same error:
thread 'main' panicked at 'cannot poll Result twice', /checkout/src/libcore/option.rs:839:4
note: Run with RUST_BACKTRACE=1 for a backtrace.
Abort (core dumped)

@reneklootwijk - while the panick is not desirable (will try to fix it eventually), the rest of your observations are as expected. Spotty would show up as Connect endpoint in order to authorize through a Spotify app. As soon as authentication has succeeded, the daemon does exit. You'd then have to enable Connect in Settings/Player/Spotty.

One more thing: I just merged the latest changes which will build 0.8.1. This build should provide a much more stable Connect experience. Please try to build asap. Good luck!

Just checked the LMS server.log after a couple of hours using the connect feature, reconnecting several times: nothing in there about a 'thread panick'. LMS server version?

The result is the same with the new version. I use LMS version: Logitech Media Server Versie: 7.9.1 - 1513400996 @ Sat Dec 16 06:24:25 UTC 2017

What do you mean with: You'd then have to enable Connect in Settings/Player/Spotty?

But it has nothing the error has nothing to do with the LMS version cause it happens from the command line also.

I read your error message as coming from the LMS server log. I see now it isn't
If I take your command line: "target/release/spotty -n "Testje" -a"
spotty just runs, both 0.7.0 and 0.8.1. It shows up in 'top'. no error messages.

The error message is printed on the console when spotty is initiated by LMS. When I initiate it from the command line as soon as I connect with a Spotify player, the error is thrown.

That screenshot was very informative, now I understand how it works. And yes despite the error message, everything is working.

To be clear, the error message only appears during when authenticating via a Spotify client.

The following causes the panic:
./target/release/spotty--cache ./ --name MYAPP --authenticate --username MYUSERAME

This is a command you'd run to get your credentials set up, before streaming at a later stage.

After applying the patch from #2 it seems to be resolved.

This issue is fixed in the latest 0.9.9 binaries, which are based on the dev branch.