Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
2.64k stars 108 forks source link

oath returns 502 #361

Closed kajvans closed 3 months ago

kajvans commented 4 months ago

the oath route for the api returns 502. it does not matter how you try to access it but it always gives an 502. localhost:8080/oauth/spotify/callback. if i look at the docker it gives this error:

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

also this:

    data: {
      error: 'invalid_request',
      error_description: 'code must be supplied'
    }

so something is not being send and that makes the server crash

Yooooomi commented 4 months ago

Hello, can you paste your config files on here so I can see clearer in this issue? Also 502 often means something is wrong with your reverse proxy.

stephanschorer commented 3 months ago

hello, just wanted to add my solution, cause I experienced the same issue:

I needed to update the mongo db to version 6 but keep the following in mind

To upgrade an existing MongoDB deployment to 6.0, you must be running a 5.0-series release. To upgrade from a version earlier than the 5.0-series, you must successively upgrade major releases until you have upgraded to 5.0-series.

therefore, edit the mongo db version in your docker-compose first to the next major release in my case mongo:5 (cause I had a 4.4.8 version prior) afterward the yourspotify service worked again, just to be sure I upgraded then to mongo:6

kajvans commented 3 months ago

will these keep al the data or will it be removed?

stephanschorer commented 3 months ago

the database itself isnt broken just the connection from yourspotify to the db - at least in my case.. So if you keep the upgrading process (one major release at a time) in mind, everything should be there.

You could to a backup just in case

kajvans commented 3 months ago

the api is not connecting to the database. with mongo version 5 and also 6. i think i have the problem mongodb wont run anymore on my system:

WARNING: MongoDB requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that!

stephanschorer commented 3 months ago

oh okay.. yeah I am on x86_64

than i am sorry for you

kajvans commented 3 months ago

oke i moved the server to my own pc so on x86_64 but still nothing. if i make the api calls by hand it works fine and even the website says the calls return status 200 and i can see it in the logs but the network creates an missing cors error with missingalloworiginheader while i set both my url correctly:

  CORS: https://spotifyapi.example.com, https://spotify.example.com

  when i click each one of the links i get the return you expect
stephanschorer commented 3 months ago

try it with out the cors in your docker compose

kajvans commented 3 months ago

thanks works now, should have thought of that myself. really thank you

kajvans commented 3 months ago

is there a way to fetch everything from the last few days or not? it was down from since 11-03

stephanschorer commented 3 months ago

no thats not possible I think you could request all your data, but that could take 30 days...

Yooooomi commented 3 months ago

is there a way to fetch everything from the last few days or not

@kajvans I was looking to implement such a feature, but it's a Spotify limitation, not allowing to request more than 8 hours earlier it seems. Feel free to close the issue if your problem is solved :)

kajvans commented 3 months ago

Yeah outside of the fetching of the data from last days problem fixed