dupontgu / retro-ipod-spotify-client

The software that powers the sPot: a 4th generation "Click Wheel" iPod with a full Spotify client.
Apache License 2.0
891 stars 90 forks source link

Persistent, unresolvable issues with ERRNO 98: Address already in use #73

Open jonathancaudill opened 2 weeks ago

jonathancaudill commented 2 weeks ago

Hey guys, I know this is a 3-year-old project, but I've been working on my own build. I have very little background in coding, but honestly far it's going decently well--today I really learned my way around linux, and was able to authenticate everything and get my access token in the .cache folder in /frontend. I've confirmed this numerous times via ls -a and attempting to edit via sudo nano, which displays the long, gibberishy access token and whatnot. It's worth noting that I've already done the "final steps" of the install per XEROxMEXICANO's guide.

But EVERY SINGLE TIME I try to run any of the test scripts from /frontend, I get the same or similar error codes as everyone who DIDN'T have the proper .cache setup. At first I thought there was maybe an issue with the server name in the spotipy code (the one displayed below as 127.0.0.1), so I tried changing it in oauth2.py, but I don't think that helped anything. Any help would be so appreciated. I know @doris1347 has still been somewhat present in here.

Traceback (most recent call last): File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 18, in <module> spotify_manager.refresh_data() File "/home/pi/retro-ipod-spotify-client/frontend/spotify_manager.py", line 203, in refresh_data results = sp.current_user_saved_tracks(limit=pageSize, offset=0) File "/home/pi/.local/lib/python3.9/site-packages/spotipy/client.py", line 1302, in current_user_saved_tracks return self._get("me/tracks", limit=limit, offset=offset, market=market) File "/home/pi/.local/lib/python3.9/site-packages/spotipy/client.py", line 327, in _get return self._internal_call("GET", url, payload, kwargs) File "/home/pi/.local/lib/python3.9/site-packages/spotipy/client.py", line 251, in _internal_call headers = self._auth_headers() File "/home/pi/.local/lib/python3.9/site-packages/spotipy/client.py", line 242, in _auth_headers token = self.auth_manager.get_access_token(as_dict=False) File "/home/pi/.local/lib/python3.9/site-packages/spotipy/oauth2.py", line 525, in get_access_token "code": code or self.get_auth_response(), File "/home/pi/.local/lib/python3.9/site-packages/spotipy/oauth2.py", line 480, in get_auth_response return self._get_auth_response_local_server(redirect_port) File "/home/pi/.local/lib/python3.9/site-packages/spotipy/oauth2.py", line 447, in _get_auth_response_local_server server = start_local_http_server(redirect_port) File "/home/pi/.local/lib/python3.9/site-packages/spotipy/oauth2.py", line 1285, in start_local_http_server server = HTTPServer(("127.0.0.1", port), handler) File "/usr/lib/python3.9/socketserver.py", line 452, in __init__ self.server_bind() File "/usr/lib/python3.9/http/server.py", line 138, in server_bind socketserver.TCPServer.server_bind(self) File "/usr/lib/python3.9/socketserver.py", line 466, in server_bind self.socket.bind(self.server_address) OSError: [Errno 98] Address already in use

In addition, now I'm getting errors like this Couldn't read cache at: .cache Couldn't read cache at: .cache which never showed up before (even when the same issues were present as above), and shouldn't be now, because I've confirmed that .cache is in the right place.

and this

` (x-www-browser:1155): CRITICAL : 01:15:01.837: WebKitWebView web-context property can't be set when related-view is set too, passed web-context value is ignored.

(x-www-browser:1155): CRITICAL : 01:15:02.059: session.vala:278: Failed add tab to session database: Invalid type '(null)' in statement: INSERT INTO tabs (crdate, tstamp, session_id, uri, title) VALUES (:crdate, :tstamp, :session_id, :uri, :title) `

Any help would be the best ever. Thank you so much!

doris1347 commented 2 weeks ago

Did you read closed issue #30:

https://github.com/dupontgu/retro-ipod-spotify-client/issues/30

Strange in your script I see python 3.9 in site packages ... that does not seem to be correct.

I have python 3.7 in site packages.

Which Raspitify version and Raspberry Pios are you using?

Which screen are you using?

jonathancaudill commented 2 weeks ago

@doris1347 thank you so much for reaching out!! So I did check issue 30, but the .cache file is fully present and visible. (Maybe permissions on it are too low?)

Yeah, at some point during the process earlier I realized that the version of Raspbian I’m using was on Python 3.9 instead of 3.7… you think that could be part of it?

I’m using Raspotify 14, I believe—whichever one was recommended by everyone as the older one to download. I’m also running the legacy version of Raspberry OS Lite. Screen is a wave share 240x320, not hooked up at the moment, so I’m VNCing or SSHing in to do all my work.

doris1347 commented 2 weeks ago

Yes that's probably your problem! How did you manage to install 3.9?

jonathancaudill commented 2 weeks ago

@doris1347 Not really sure. Might have run an update and accidentally installed it? I definitely installed the legacy version though, so idk what's up. Incidentally, pip is gone as well, despite working perfectly through most of the process.

I would think that python 3.9 and 3.7 would be similar enough that it wouldn't be an issue, but maybe the slight differences are big enough to mess it up? At one point I had to change some commands to reference python3.9/site-packages instead of the usual python3.7/site-packages.

Am I cooked? Should I just start over? Or is there some way I can downgrade my python version? Honestly could probably redo everything in ~2 hours now that I've learned what I'm doing a bit better.

doris1347 commented 2 weeks ago

Yeah it doesn't look good, I would start over for sure paying close attention to anything that might update python

I know that Raspberry pie Bullseye installs with 3.9

Never was able to have "Spot" app. working with Bullseye.

Save your cache file so you can copy & paste.

Cannot offer any more suggestions perhaps someone else reading this can.

Good Luck.

TheDeadGuy commented 2 days ago

What's your redirect uri?

I had to do a whole load of testing/combinations of uri's to get it to work.

I think http uri doesn't work. has to be https. can't use port 80. i don't remember if 8080 or 8443 works. if you're using https use 8443.

Give it a try and let us know