# Spotify channels unreachable since 0.3.4

**URL:** <https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306>\
**Category:** Troubleshooting\
**Created:** [May 4, 2024, 8:11am UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306 "2024-05-04T08:11:44Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpo](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/mpo/32/21_2.png) [@mpo](https://amplipi.discourse.group/u/mpo)\
**Post date:** [May 4, 2024, 8:11am UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/1 "2024-05-04T08:11:44Z")

</div>

Hi, upgraded to 0.3.4 some time ago, and have failed to connect spotify to the amplipi-streams ever since.

I had experienced the same after upgrade to 0.3.3 but the trick of just redefining the streams (see [Spotify Sources need redefining after 0.3.3 upgrade](https://amplipi.discourse.group/t/spotify-sources-need-redefining-after-0-3-3-upgrade/293)) That worked back then, but is not working out now.

The behaviour form a user perspective is this:

- in the amplipi ui add a spotify-stream connected to some zone
- in the spotify UI select the devices to connect  
– it shows the amplipi-stream alright  
– after selecting that, the spotify UI keeps trying to connect to it, but never succeeds  
– trying to reconnect, the amplipi stream is no longer in the list

To troubleshoot this I performed these actions:

- another upgrade, now to 0.3.5 of amplipi
- a drop and re-create of my spotify-streams on the amplipi
- replay of the scenario while having a `ssh` open to the amplipi listing the output of `journalctl -f`

that last action gives me these outputs:

1| at the time of opening the stream I named “K79E”:

```auto
May 04 03:53:35 amplipi authbind[835]: Starting process monitor for process: ['alsaloop', '-C', 'lb1p', '-P', 'ch0', '-t', '100000']
May 04 03:53:35 amplipi authbind[835]: Forwarding signal 15 to subprocess.
May 04 03:53:35 amplipi authbind[835]: Loading config from "./config.toml"
May 04 03:53:35 amplipi authbind[835]: No username specified. Checking username_cmd
May 04 03:53:35 amplipi authbind[835]: No username_cmd specified
May 04 03:53:35 amplipi authbind[835]: No password specified. Checking password_cmd
May 04 03:53:35 amplipi authbind[835]: No password_cmd specified
May 04 03:53:35 amplipi authbind[835]: No proxy specified
May 04 03:53:35 amplipi authbind[835]: Using software volume controller.
May 04 03:53:35 amplipi authbind[835]: no usable credentials found, enabling discovery
May 04 03:53:35 amplipi authbind[835]: Activating K79E (persistant)
May 04 03:53:35 amplipi authbind[835]: starting connection via: /home/pi/amplipi-dev/venv/bin/python /home/pi/amplipi-dev/streams/process_monitor.py alsaloop -C lb2p -P ch0 -t 100000

```

2| at the time of connecting to that in the spotify UI:

```auto
May 04 03:53:49 amplipi authbind[835]: Connecting to AP "ap.spotify.com:443"
May 04 03:53:49 amplipi authbind[835]: Authenticated as "cvm55e8y1wmyc6jos5k1t9eq1" !
May 04 03:53:49 amplipi authbind[835]: Country: "BE"
May 04 03:53:49 amplipi authbind[835]: Using Alsa sink with format: S16
May 04 03:53:49 amplipi authbind[835]: error 403 for uri hm://keymaster/token/authenticated?client_id=2c1ea588dfbc4a989e2426f8385297c3&scope=user-read-playback-state,user-modify-playback-state,user-read-currently-playing
May 04 03:53:49 amplipi authbind[835]: failed to request a token for the web API

```

I will do some google searching on that failure, but already welcome any advice / tips you might have.

---

<div class="post-metadata">

**Author:** ![linknum23](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/linknum23/32/6_2.png) [@linknum23](https://amplipi.discourse.group/u/linknum23)\
**Post date:** [May 5, 2024, 3:34pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/2 "2024-05-05T15:34:17Z")

</div>

I’m not sure if this always happens or it is an intermittent issue.

For the ladder case I would suggest trying to reset the Spotify stream after this happens. I added some instructions for resetting the LMS stream here: [LMS client not appearing on LMS server - #3 by linknum23](https://amplipi.discourse.group/t/lms-client-not-appearing-on-lms-server/302/3) , Spotify will work the same way.

Either way we’ll try to investigate this and see if we can reproduce it.

---

<div class="post-metadata">

**Author:** ![mpo](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/mpo/32/21_2.png) [@mpo](https://amplipi.discourse.group/u/mpo)\
**Post date:** [May 5, 2024, 6:42pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/3 "2024-05-05T18:42:35Z")

</div>

it keeps on happening for some weeks now, so ‘intermittent’ starts feeling as the kind of hope we should abandon?

also trying your suggested curl commands yields a “method not allowed” both at client and server (ssh log)

clientside:

```auto
$ curl -X POST --url "http://amplipi.marcels.lan/streams/1010/deactivate"
{"detail":"Method Not Allowed"}

$ curl -X POST --url "http://amplipi.marcels.lan/streams/1010/activate"
{"detail":"Method Not Allowed"}

```

serverside: (ssh with running journatctl -f)

```auto
May 05 14:26:17 amplipi authbind[835]: INFO: 10.0.100.136:34628 - "POST /streams/1010/deactivate HTTP/1.1" 405 Method Not Allowed
May 05 14:29:45 amplipi authbind[835]: INFO: 10.0.100.136:51412 - "POST /streams/1010/activate HTTP/1.1" 405 Method Not Allowed

```

possibly unrelated I am also seeing these messages fly by in the server side logging:

```auto
May 05 14:26:40 amplipi authbind[835]: Dbus error getting MPRIS metadata: The name org.mpris.MediaPlayer2.spotifyd.instance1592 was not provided by any .service files

```

not on a fixed interval but roughly every 5 to 30 seconds  
and always in bursts of four

which made me think that it might not be a coincidence that I have 4 spotify streams defined…

so I ended up throwing away my spotify streams once more: and those MPRIS metadata logs are no longer appearing

will now restart the amplipi and ad them again…

---

<div class="post-metadata">

**Author:** ![mpo](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/mpo/32/21_2.png) [@mpo](https://amplipi.discourse.group/u/mpo)\
**Post date:** [May 5, 2024, 6:53pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/4 "2024-05-05T18:53:55Z")

</div>

no avail – after (1) reboot (2) added new spotify stream (3) using it in a zone (4) trying to connect with the clientonly to (5) get the 403 error message in the logs:

```auto
May 05 14:47:14 amplipi authbind[830]: Connecting to AP "ap.spotify.com:443"
May 05 14:47:14 amplipi authbind[830]: Authenticated as "cvm55e8y1wmyc6jos5k1t9eq1" !
May 05 14:47:14 amplipi authbind[830]: Country: "BE"
May 05 14:47:14 amplipi authbind[830]: Using Alsa sink with format: S16
May 05 14:47:14 amplipi authbind[830]: error 403 for uri hm://keymaster/token/authenticated?client_id=2c1ea588dfbc4a989e2426f8385297c3&scope=user-read-playback-state,user-modify-playback-state,user-read-currently-playing

```

as well as the bursts of 4 MPRIS metadata messages

funny that now I only have one spotify stream defined, those messages still come in bursts of 4, so that might have been a coincidence there…

have to say I am at loss here, happy to be executing more testing commands…

---

<div class="post-metadata">

**Author:** ![linknum23](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/linknum23/32/6_2.png) [@linknum23](https://amplipi.discourse.group/u/linknum23)\
**Post date:** [May 6, 2024, 2:00am UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/5 "2024-05-06T02:00:58Z")

</div>

I think you missed the api/ in the URL:

```bash
curl -X POST --url "http://amplipi.marcels.lan/api/streams/1010/deactivate"

curl -X POST --url "http://amplipi.marcels.lan/api/streams/1010/activate"

```

Sorry for your struggles with this. We will start looking into it.

---

<div class="post-metadata">

**Author:** ![linknum23](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/linknum23/32/6_2.png) [@linknum23](https://amplipi.discourse.group/u/linknum23)\
**Post date:** [May 6, 2024, 4:46pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/6 "2024-05-06T16:46:58Z")

</div>

I talked to Jason this morning and he is having similar issues at his house as well.  
We just compiled the latest version of spotifyd and are testing it out at the office.

---

<div class="post-metadata">

**Author:** ![mpo](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/mpo/32/21_2.png) [@mpo](https://amplipi.discourse.group/u/mpo)\
**Post date:** [May 10, 2024, 7:13am UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/7 "2024-05-10T07:13:45Z")

</div>

> [@linknum23](#):
>
> `curl -X POST --url "http://amplipi.marcels.lan/api/streams/1010/deactivate"`

Finally got around testing this

Of course you were right – no more errors about unsupported POST method when I slide in the `/api/` part

However this “re-activate trick” only helps to re-show the stream in the list of available options in the sportify client after the failure to connect. So it avoids me the trouble of dropping and recreating the stream. But the actual reconnect still fails.

Looks like your work on the `spotifyd` is the currently remaining road to a solution. Any news on that?

---

<div class="post-metadata">

**Author:** ![julienc](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@julienc](https://amplipi.discourse.group/u/julienc)\
**Post date:** [May 10, 2024, 12:58pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/8 "2024-05-10T12:58:09Z")

</div>

Hi  
I had a similar issue with 0.1.9:

> [@Spotify not working (both 0.1.9 and prerelease)](https://amplipi.discourse.group/t/spotify-not-working-both-0-1-9-and-prerelease/173):
>
> Hi I have trouble streaming Spotify to my AmpliPi, I had the problem before and still do after upgrading to the latest pre-release. After creating the input, it shows up in my Spotify clients (iPhone and PC), but when I try to select it it fails and then then the input disapears from the list. Here are the logs I am getting in the new version: Nov 19 08:01:56 amplipi authbind[811]: Connecting to AP "ap.spotify.com:443" Nov 19 08:01:57 amplipi authbind[811]: Authenticated as "julienc" ! Nov 1…

Now I still have the issue sporadically when I try to connect to the Spotify source from my PC, no errors when doing it from my phone.

Deleting and recreating the stream works for me, but it’s very painful to do in the new UI…

Hopefully a new version will fix this for good!

---

<div class="post-metadata">

**Author:** ![linknum23](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/linknum23/32/6_2.png) [@linknum23](https://amplipi.discourse.group/u/linknum23)\
**Post date:** [May 15, 2024, 9:26pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/9 "2024-05-15T21:26:36Z")

</div>

I started playing with the latest unreleased version of spotifyd. Initial results were promising. It connected reliably to Spotify and appeared to integrate some new features. However it was notably a little unstable, after 4 hours it stopped and threw an error.

In its current state I’m worried we’d replace the current issues with something similar but potentially worse. I made an issue for this here: [Spotify Connection Issues · Issue #721 · micro-nova/AmpliPi · GitHub](https://github.com/micro-nova/AmpliPi/issues/721)

That said we are going to try to get this working well soon.

---

<div class="post-metadata">

**Author:** ![mpo](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/mpo/32/21_2.png) [@mpo](https://amplipi.discourse.group/u/mpo)\
**Post date:** [May 18, 2024, 10:03am UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/10 "2024-05-18T10:03:16Z")

</div>

thx for the update, let me know if my setup over here can help out as an additional testbed (will need instructions though)

---

<div class="post-metadata">

**Author:** ![mpo](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/mpo/32/21_2.png) [@mpo](https://amplipi.discourse.group/u/mpo)\
**Post date:** [June 3, 2024, 8:49am UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/11 "2024-06-03T08:49:13Z")

</div>

any news or prognosis?

---

<div class="post-metadata">

**Author:** ![linknum23](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/linknum23/32/6_2.png) [@linknum23](https://amplipi.discourse.group/u/linknum23)\
**Post date:** [June 3, 2024, 3:54pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/12 "2024-06-03T15:54:11Z")

</div>

No real progress yet, We’ve been poking at this from a couple of fronts though:

1. Figuring out how to get a new build of spotifyd that doesn’t break after 4 hours of inactivity
2. Looking at other options for Spotify clients including using an official one from Spotify

We are still loosely tracking it in issue #721.

---

<div class="post-metadata">

**Author:** ![linknum23](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/linknum23/32/6_2.png) [@linknum23](https://amplipi.discourse.group/u/linknum23)\
**Post date:** [July 1, 2024, 8:47pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/13 "2024-07-01T20:47:21Z")

</div>

Internally we are running a new version of Spotifyd (combined with a fair amount of AmpliPi updates) that appears to fix all of the stability problems we were seeing. Stay tuned, we’re hoping it makes it into the next release.

---

<div class="post-metadata">

**Author:** ![amplipi](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/amplipi/32/8_2.png) [@amplipi](https://amplipi.discourse.group/u/amplipi)\
**Post date:** [July 3, 2024, 9:22pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/14 "2024-07-03T21:22:51Z")

</div>

If you could give our [0.4.0 prerelease a test](https://amplipi.discourse.group/t/new-amplipi-software-pre-release-0-4-0/311), that would be excellent! We rolled in our fixes for #721 and believe it will resolve your problems.

---

<div class="post-metadata">

**Author:** ![mpo](https://yyz2.discourse-cdn.com/free1/user_avatar/amplipi.discourse.group/mpo/32/21_2.png) [@mpo](https://amplipi.discourse.group/u/mpo)\
**Post date:** [July 7, 2024, 7:14pm UTC](https://amplipi.discourse.group/t/spotify-channels-unreachable-since-0-3-4/306/15 "2024-07-07T19:14:30Z")

</div>

Just made the install - spotify channel indeed working again - will play around with other features in the upcoming days.

Thx for the fix!
