mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 07:55:49 +03:00
[GH-ISSUE #203] SpotifyWebAPI\\SpotifyWebAPIException: Bad gateway. #140
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wuzzy1212 on GitHub (Oct 2, 2020).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/203
This is a really finicky error, and wondering if anyone else has seen it, and how to deal with it.
For me, it's easily recreatable when flipping between the ios spotify app, and the web based browser application.
For instance, when initially authorizing the app either by desktop or spotify app I will be prompted by my

Then, when opening the desktop spotify application and engaging it for a second, I will be promoted with

If I use the play function for this device it will almost certainly work. Here's where it gets haywire. If I then open my phone and engage the app I will then get the green light that the phone app is ready to go and the desktop has now been deactivated. Which makes perfect sense.

But, now, 99% of the time when I try to use the phone it will give me
PHP Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: Bad gateway
Its like spotify is holding some session that is different than my initial request from the desktop application. This as you can imagine is creating a beautiful mess for the user experience. Has anyone seen this, any steps you took to rectify it. Thanks for the wrap btw, other than this one issue this is flawless.
Also, when it does say "Bad Gateway" if I go over to the app in the phone, the song I was trying to get to start playing will actually start playing. So spotify did get the request they know the request but are not playing it until I open the app. How weird is this?
@jwilsson commented on GitHub (Oct 3, 2020):
Hey!
That's indeed a really strange error, and I'm afraid I've never seen anything like it. I'd post a question on their developer forum and see if anyone there can help further.
I don't think it's an issue with this library because like you're saying, the song starts playing so Spotify should have received a valid request. But I'll leave this issue open for a while in case someone else has had a similar issue and will be able to help.
@wuzzy1212 commented on GitHub (Oct 3, 2020):
Thanks, I appreciate that, and yes very strange!
@wuzzy1212 commented on GitHub (Oct 3, 2020):
I'm able to get past this issue by making a non related call before trying to play the song
try {
$api->getMyCurrentPlaybackInfo();
$api->play($spotify_id, [
'uris' => ['https://open.spotify.com/track/5dRQUolXAVX3BbCiIxmSsf'],
]);
} catch (SpotifyWebAPI\SpotifyWebAPIException $e) {
}
Interesting.
Update: Nevermind, that does not work.