[GH-ISSUE #618] cache problem #368

Closed
opened 2026-02-27 23:22:15 +03:00 by kerem · 35 comments
Owner

Originally created by @Sticks111 on GitHub (Nov 26, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/618

In the Spotipy / flask example, after implementing the steps and upon clicking on "Sign In," I was led to the Spotify API authorization page. Upon clicking accept, I received in my terminal a "cannot read cache" message. A few hours later, when I tried to reconnect again, I could no longer click beyond the Sign in page -- I wasn't able to reach to the Spotify API auth. pg. this time -- as soon as I clicked "Sign In," a "cannot read cache" message popped up right away.
Would appreciate any thoughts or suggestions.
Thanks very much

Originally created by @Sticks111 on GitHub (Nov 26, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/618 In the Spotipy / flask example, after implementing the steps and upon clicking on "Sign In," I was led to the Spotify API authorization page. Upon clicking accept, I received in my terminal a "cannot read cache" message. A few hours later, when I tried to reconnect again, I could no longer click beyond the Sign in page -- I wasn't able to reach to the Spotify API auth. pg. this time -- as soon as I clicked "Sign In," a "cannot read cache" message popped up right away. Would appreciate any thoughts or suggestions. Thanks very much
kerem 2026-02-27 23:22:15 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@Sticks111 commented on GitHub (Nov 26, 2020):

Sorry, okay, I was able to connect again to the Spotify Authorization page after clicking on Sign in (I wasn't able to earlier because I left off the / in export SPOTIPY_REDIRECT_URI='http://127.0.0.1:5000/callback/)
However, upon clicking Agree (in the Agree/Cancel section of the "You agree that the app will be able to...View your Spotify account data...View your activity on Spotify...Take actions in Spotify on your behalf..." page) , I am still receiving a "Couldn't read cache at: ./.spotify_caches/....- - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 -" message in the terminal.
Would be appreciate any suggestions!
Thanks so much

<!-- gh-comment-id:734506877 --> @Sticks111 commented on GitHub (Nov 26, 2020): Sorry, okay, I was able to connect again to the Spotify Authorization page after clicking on Sign in (I wasn't able to earlier because I left off the / in export SPOTIPY_REDIRECT_URI='http://127.0.0.1:5000/callback/) However, upon clicking Agree (in the Agree/Cancel section of the "You agree that the app will be able to...View your Spotify account data...View your activity on Spotify...Take actions in Spotify on your behalf..." page) , I am still receiving a "Couldn't read cache at: ./.spotify_caches/....- - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 -" message in the terminal. Would be appreciate any suggestions! Thanks so much
Author
Owner

@Peter-Schorn commented on GitHub (Nov 26, 2020):

Did you check to see if a cache file exists at the specified path? If you are running the app for the first time then it should be expected that the cache path doesn't exist and you can ignore this message.

Also it would be helpful if you posted some of your code.

<!-- gh-comment-id:734507336 --> @Peter-Schorn commented on GitHub (Nov 26, 2020): Did you check to see if a cache file exists at the specified path? If you are running the app for the first time then it should be expected that the cache path doesn't exist and you can ignore this message. Also it would be helpful if you posted some of your code.
Author
Owner

@Sticks111 commented on GitHub (Nov 26, 2020):

Thanks Peter!

I have a .spotify_caches/ folder, though it appears to contain no files. On the other hand, in the .flask_session/ folder, a new file is automatically created with every new flask run. The folders that are present are there after I used the same code as in the example, though adding an additional port option at the end and using a slightly different command in the terminal, also copied below:

if name == 'main':
app.run(threaded=True, port=int(os.environ.get("PORT", 8080)))

if name == 'main':
app.run(threaded=True, port=int(os.environ.get("PORT", 5000)))

$ pip3 install spotipy Flask Flask-Session
$ export SPOTIPY_CLIENT_ID=CLIENT_ID
$ export SPOTIPY_CLIENT_SECRET=SECRET
$ export SPOTIPY_REDIRECT_URI='http://127.0.0.1:5000/callback/'
$ flask run

A quick note also that in Spotify for Developers/Dashboard/Edit Settings/Redirect URIs, I have saved the following Redirect URIs:
http://127.0.0.1:8080/callback/
http://127.0.0.1:5000/callback/

Am wondering if there is something that I should be adding in order to successfully connect to the API? Sorry, I think that I have followed the initial connection instructions closely but I am quite new to this and am wondering if there's an obvious missing piece that I have overlooked.

Thanks so much!

<!-- gh-comment-id:734510964 --> @Sticks111 commented on GitHub (Nov 26, 2020): Thanks Peter! I have a .spotify_caches/ folder, though it appears to contain no files. On the other hand, in the .flask_session/ folder, a new file is automatically created with every new flask run. The folders that are present are there after I used the same code as in the example, though adding an additional port option at the end and using a slightly different command in the terminal, also copied below: if __name__ == '__main__': app.run(threaded=True, port=int(os.environ.get("PORT", 8080))) if __name__ == '__main__': app.run(threaded=True, port=int(os.environ.get("PORT", 5000))) $ pip3 install spotipy Flask Flask-Session $ export SPOTIPY_CLIENT_ID=CLIENT_ID $ export SPOTIPY_CLIENT_SECRET=SECRET $ export SPOTIPY_REDIRECT_URI='http://127.0.0.1:5000/callback/' $ flask run A quick note also that in Spotify for Developers/Dashboard/Edit Settings/Redirect URIs, I have saved the following Redirect URIs: http://127.0.0.1:8080/callback/ http://127.0.0.1:5000/callback/ Am wondering if there is something that I should be adding in order to successfully connect to the API? Sorry, I think that I have followed the initial connection instructions closely but I am quite new to this and am wondering if there's an obvious missing piece that I have overlooked. Thanks so much!
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

Are you using the code from examples/app.py unmodified? If not, please post the actual code for your app. Also what exact path that is printed when you get the error message stating that the cache couldn't be read?

"Couldn't read cache at: ./.spotify_caches/....- - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 -"

This is very confusing to me. Did you copy this line directly from your console or did you edit it before posting it here?

<!-- gh-comment-id:734513233 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): Are you using the code from examples/app.py unmodified? If not, **please post the actual code for your app**. Also what exact path that is printed when you get the error message stating that the cache couldn't be read? > "Couldn't read cache at: ./.spotify_caches/....- - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 -" This is very confusing to me. Did you copy this line directly from your console or did you edit it before posting it here?
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Sorry the entire path that appears on my console unabridged after $ flask run is copied below.
Am using the exact code from examples/app.py except for some of the Prerequisites, where instead of python3 -m flask run --port=8080 I use just flask run and instead of export SPOTIPY_REDIRECT_URI='http://127.0.0.1:8080' I use export SPOTIPY_REDIRECT_URI='http://127.0.0.1:5000/callback' (have saved 'http://127.0.0.1:5000/callback' in https://developer.spotify.com/dashboard/applications).

                            * Serving Flask app "app.py" (lazy loading)
  • Environment: development
  • Debug mode: off
  • Running on https://5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz:8080/ (Press CTRL+C to quit)
  • Restarting with stat
    Couldn't read cache at: ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926
    192.168.195.36 - - [26/Nov/2020 23:16:37] "GET / HTTP/1.0" 200 -
    Couldn't read cache at: ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926
    192.168.153.58 - - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 -
<!-- gh-comment-id:734518638 --> @Sticks111 commented on GitHub (Nov 27, 2020): Sorry the entire path that appears on my console unabridged after $ flask run is copied below. Am using the exact code from examples/app.py except for some of the Prerequisites, where instead of python3 -m flask run --port=8080 I use just flask run and instead of export SPOTIPY_REDIRECT_URI='http://127.0.0.1:8080' I use export SPOTIPY_REDIRECT_URI='http://127.0.0.1:5000/callback' (have saved 'http://127.0.0.1:5000/callback' in https://developer.spotify.com/dashboard/applications). * Serving Flask app "app.py" (lazy loading) * Environment: development * Debug mode: off * Running on https://5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz:8080/ (Press CTRL+C to quit) * Restarting with stat Couldn't read cache at: ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926 192.168.195.36 - - [26/Nov/2020 23:16:37] "GET / HTTP/1.0" 200 - Couldn't read cache at: ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926 192.168.153.58 - - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 -
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

So the full cache path is

./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926
192.168.195.36 - - [26/Nov/2020 23:16:37] "GET / HTTP/1.0" 200 -

with the line break?

<!-- gh-comment-id:734519409 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): So the full cache path is ``` ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926 192.168.195.36 - - [26/Nov/2020 23:16:37] "GET / HTTP/1.0" 200 - ``` with the line break?
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Sorry the full cache path which includes line breaks is as follows (for some reason not everything showed up in my earlier response):

./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926
192.168.195.36 - - [26/Nov/2020 23:16:37] "GET / HTTP/1.0" 200 -
Couldn't read cache at: ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926
192.168.153.58 - - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 -
192.168.83.137 - - [27/Nov/2020 00:43:20] "GET /:8080/ HTTP/1.0" 404 -
Couldn't read cache at: ./.spotify_caches/101b04c2-fc97-4f30-8af7-3e7d6d268582
192.168.74.236 - - [27/Nov/2020 00:43:21] "GET / HTTP/1.0" 200 -
Couldn't read cache at: ./.spotify_caches/f577f9b6-ce4c-4a69-a606-4b1ed40674a9
192.168.162.241 - - [27/Nov/2020 00:43:21] "GET / HTTP/1.0" 200 -
192.168.74.236 - - [27/Nov/2020 00:43:24] "GET /:8080/ HTTP/1.0" 404 -
Couldn't read cache at: ./.spotify_caches/7d45b808-d93a-4bea-9736-177be4430b51
192.168.115.65 - - [27/Nov/2020 00:48:01] "HEAD / HTTP/1.0" 200 -

<!-- gh-comment-id:734521086 --> @Sticks111 commented on GitHub (Nov 27, 2020): Sorry the full cache path which includes line breaks is as follows (for some reason not everything showed up in my earlier response): ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926 192.168.195.36 - - [26/Nov/2020 23:16:37] "GET / HTTP/1.0" 200 - Couldn't read cache at: ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926 192.168.153.58 - - [26/Nov/2020 23:19:43] "GET / HTTP/1.0" 200 - 192.168.83.137 - - [27/Nov/2020 00:43:20] "GET /:8080/ HTTP/1.0" 404 - Couldn't read cache at: ./.spotify_caches/101b04c2-fc97-4f30-8af7-3e7d6d268582 192.168.74.236 - - [27/Nov/2020 00:43:21] "GET / HTTP/1.0" 200 - Couldn't read cache at: ./.spotify_caches/f577f9b6-ce4c-4a69-a606-4b1ed40674a9 192.168.162.241 - - [27/Nov/2020 00:43:21] "GET / HTTP/1.0" 200 - 192.168.74.236 - - [27/Nov/2020 00:43:24] "GET /:8080/ HTTP/1.0" 404 - Couldn't read cache at: ./.spotify_caches/7d45b808-d93a-4bea-9736-177be4430b51 192.168.115.65 - - [27/Nov/2020 00:48:01] "HEAD / HTTP/1.0" 200 -
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

No, the full cache path is

./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926

The other lines are different messages that are separate from the cache path. Also, when pasting code into a comment, please use code fences.

Unless you have modified app.py, the redirect URI should be the same as the URL that the server is running on. Based on this console output:

Running on https://5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz:8080/ (Press CTRL+C to quit)

Your redirect URI needs to be https://5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz:8080/.

Now, after the user logs in and clicks agree, the index function will be called because it is annotated with @app.route('/')

<!-- gh-comment-id:734592100 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): No, the full cache path is ``` ./.spotify_caches/9cf8b13f-91bf-4e02-b72c-b52733e03926 ``` The other lines are different messages that are separate from the cache path. Also, when pasting code into a comment, please use [code fences](https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/creating-and-highlighting-code-blocks). Unless you have modified `app.py`, the redirect URI should be the same as the URL that the server is running on. Based on this console output: ``` Running on https://5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz:8080/ (Press CTRL+C to quit) ``` Your redirect URI needs to be `https://5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz:8080/`. Now, after the user logs in and clicks agree, the `index` function will be called because it is annotated with `@app.route('/')`
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

Why did you use http://127.0.0.1:5000/callback for the redirect URI? There is no function that handles the /callback route.

<!-- gh-comment-id:734605579 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): Why did you use `http://127.0.0.1:5000/callback` for the redirect URI? There is no function that handles the `/callback` route.
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Thanks for pointing that out! Have removed all the callbacks.
I've run another flask session and have successfully reached the Spotify API authorization page.
Upon hitting accept, am now experiencing a shorter message than before:
./.spotify_caches/38a3d5d3-e157-47d2-940a-18c70c3ab5b3
192.168.153.58 - - [27/Nov/2020 03:54:09] "GET / HTTP/1.0" 200 -
192.168.153.58 - - [27/Nov/2020 03:54:09] "GET /favicon.ico HTTP/1.0" 404 -
Not sure why this message is popping up

<!-- gh-comment-id:734632826 --> @Sticks111 commented on GitHub (Nov 27, 2020): Thanks for pointing that out! Have removed all the callbacks. I've run another flask session and have successfully reached the Spotify API authorization page. Upon hitting accept, am now experiencing a shorter message than before: ./.spotify_caches/38a3d5d3-e157-47d2-940a-18c70c3ab5b3 192.168.153.58 - - [27/Nov/2020 03:54:09] "GET / HTTP/1.0" 200 - 192.168.153.58 - - [27/Nov/2020 03:54:09] "GET /favicon.ico HTTP/1.0" 404 - Not sure why this message is popping up
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

192.168.153.58 - - [27/Nov/2020 03:54:09] "GET / HTTP/1.0" 200 - is a log message describing the webpage that a user opened. I'm not sure about the other message that contains the path of the cache file. Is the app working though?

<!-- gh-comment-id:734635540 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): `192.168.153.58 - - [27/Nov/2020 03:54:09] "GET / HTTP/1.0" 200 -` is a log message describing the webpage that a user opened. I'm not sure about the other message that contains the path of the cache file. Is the app working though?
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

The 200 message definitely sounds promising, looks like I’m making progress. I’m not entirely sure if the app is working as intended; I feel I may still be missing something as I am not able to see anything just yet aside from the Sign in page and the authorization page upon clicking the Sign In link. What should I be seeing if the app is working?

<!-- gh-comment-id:734649329 --> @Sticks111 commented on GitHub (Nov 27, 2020): The 200 message definitely sounds promising, looks like I’m making progress. I’m not entirely sure if the app is working as intended; I feel I may still be missing something as I am not able to see anything just yet aside from the Sign in page and the authorization page upon clicking the Sign In link. What should I be seeing if the app is working?
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

You should see this after you sign in.

Screen Shot 2020-11-26 at 11 24 51 PM
<!-- gh-comment-id:734650714 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): You should see this after you sign in. <img width="162" alt="Screen Shot 2020-11-26 at 11 24 51 PM" src="https://user-images.githubusercontent.com/58197311/100414122-9886aa80-303e-11eb-9147-3fc60bf9b13f.png">
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Ah got it, thanks very much! Will continue working on this, hope I’ll be able to see a menu like this soon!

<!-- gh-comment-id:734651810 --> @Sticks111 commented on GitHub (Nov 27, 2020): Ah got it, thanks very much! Will continue working on this, hope I’ll be able to see a menu like this soon!
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

What are you seeing after you finish signing in? Send a picture.

<!-- gh-comment-id:734652135 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): What are you seeing after you finish signing in? Send a picture.
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Have attached here screenshots of the page with the Sign in link and the page that shows up after I click on that Sign in link:
screenshots.docx

<!-- gh-comment-id:734657098 --> @Sticks111 commented on GitHub (Nov 27, 2020): Have attached here screenshots of the page with the Sign in link and the page that shows up after I click on that Sign in link: [screenshots.docx](https://github.com/plamere/spotipy/files/5606140/screenshots.docx)
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

What page are you redirected to after you sign in? You should be redirected to the page in the image that I sent.

<!-- gh-comment-id:734660447 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): What page are you redirected to after you sign in? You should be redirected to the page in the image that I sent.
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

The page that I am redirected to immediately upon signing in is a Spotify page asking me to agree to some terms. Here is a screenshot of that:

screenshot.docx

Am not seeing the page that I should be seeing in the image that you had sent

<!-- gh-comment-id:734664968 --> @Sticks111 commented on GitHub (Nov 27, 2020): The page that I am redirected to immediately upon signing in is a Spotify page asking me to agree to some terms. Here is a screenshot of that: [screenshot.docx](https://github.com/plamere/spotipy/files/5606222/screenshot.docx) Am not seeing the page that I should be seeing in the image that you had sent
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

WHAT PAGE ARE YOU REDIRECTED TO AFTER YOU SIGN IN TO SPOTIFY AND CLICK AGREE

<!-- gh-comment-id:734665262 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): WHAT PAGE ARE YOU REDIRECTED TO AFTER YOU SIGN IN TO SPOTIFY AND CLICK AGREE
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Am seeing this page after clicking agree:

This site can’t be reached
127.0.0.1 refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
Reload
Details

<!-- gh-comment-id:734666447 --> @Sticks111 commented on GitHub (Nov 27, 2020): Am seeing this page after clicking agree: This site can’t be reached 127.0.0.1 refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED Reload Details
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

When you start the server, you will get a message saying

Running on {URL} (Press CTRL+C to quit)

This URL must be the exact same as your redirect URI.

<!-- gh-comment-id:734667843 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): When you start the server, you will get a message saying ``` Running on {URL} (Press CTRL+C to quit) ``` This URL must be the exact same as your redirect URI.
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

Here's what you should do: At the very bottom of the app.py file, replace

if __name__ == '__main__':
	app.run(threaded=True, port=int(os.environ.get("PORT", 8080)))

with

if __name__ == '__main__':
	app.run(threaded=True, host="localhost", port=8080)

Then change your redirect URI to http://localhost:8080/. Don't forget to add it in the Spotify developer dashboard.

Next, run the app from your terminal using python3 path/to/app.py.

<!-- gh-comment-id:734669105 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): Here's what you should do: At the very bottom of the `app.py` file, replace ``` if __name__ == '__main__': app.run(threaded=True, port=int(os.environ.get("PORT", 8080))) ``` with ``` if __name__ == '__main__': app.run(threaded=True, host="localhost", port=8080) ``` Then change your redirect URI to `http://localhost:8080/`. Don't forget to add it in the Spotify developer dashboard. Next, run the app from your terminal using `python3 path/to/app.py`.
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Thanks so much! Really appreciate the guidance.
Just have a follow up question regarding the final step. After running python3 path/to/app.py in the terminal, I get the message:
python3: can't open file 'path/to/app.py': [Errno 2] No such file or directory
The file name is definitely app.py, so am wondering why I might be receiving this message in the terminal?

<!-- gh-comment-id:734835449 --> @Sticks111 commented on GitHub (Nov 27, 2020): Thanks so much! Really appreciate the guidance. Just have a follow up question regarding the final step. After running python3 path/to/app.py in the terminal, I get the message: python3: can't open file 'path/to/app.py': [Errno 2] No such file or directory The file name is definitely app.py, so am wondering why I might be receiving this message in the terminal?
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Good morning Peter and @stephanebruckert, have been trying different variations of python3 path/to/app.py; for instance copying special the path of app.py in my directory and using that in place of path in python3 path/to/app.py.

When I use python3 path/to/app.py, the terminal produces the message:
python3: can't open file 'path/to/app.py': [Errno 2] No such file or directory.

And when I use one of my variations such as the one above, I am redirected to this page:
This page isn’t working
5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz didn’t send any data.
ERR_EMPTY_RESPONSE

Am wondering why this might be happening?

Thanks so much

<!-- gh-comment-id:734924035 --> @Sticks111 commented on GitHub (Nov 27, 2020): Good morning Peter and @stephanebruckert, have been trying different variations of python3 path/to/app.py; for instance copying special the path of app.py in my directory and using that in place of path in python3 path/to/app.py. When I use python3 path/to/app.py, the terminal produces the message: python3: can't open file 'path/to/app.py': [Errno 2] No such file or directory. And when I use one of my variations such as the one above, I am redirected to this page: This page isn’t working 5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz didn’t send any data. ERR_EMPTY_RESPONSE Am wondering why this might be happening? Thanks so much
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

What operating system are you using? Enclose the file path in quotes.

<!-- gh-comment-id:734949472 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): What operating system are you using? Enclose the file path in quotes.
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

am using the Windows 10
For some reason after enclosing the file path in quotes am still being redirected to:
This page isn’t working5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz didn’t send any data.
ERR_EMPTY_RESPONSE

<!-- gh-comment-id:734953344 --> @Sticks111 commented on GitHub (Nov 27, 2020): am using the Windows 10 For some reason after enclosing the file path in quotes am still being redirected to: This page isn’t working5baccc80-dda9-489c-8763-342a8ef72bbc-ide.cs50.xyz didn’t send any data. ERR_EMPTY_RESPONSE
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

Did you ensure that the redirect URI is the same as the address that the flask server is running on?

<!-- gh-comment-id:734955283 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): Did you ensure that the redirect URI is the same as the address that the flask server is running on?
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

I believe so; after I used:

if __name__ == '__main__':
	app.run(threaded=True, host="localhost", port=8080)

at the end of app.py, I made sure to also add http://localhost:8080/ into my Spotify dashboard; and my terminal has been producing the following: Running on http://localhost:8080/

<!-- gh-comment-id:734957582 --> @Sticks111 commented on GitHub (Nov 27, 2020): I believe so; after I used: ``` if __name__ == '__main__': app.run(threaded=True, host="localhost", port=8080) ``` at the end of app.py, I made sure to also add http://localhost:8080/ into my Spotify dashboard; and my terminal has been producing the following: Running on http://localhost:8080/
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

Did you change the redirect uri in the environment variables to be http://localhost:8080/?

<!-- gh-comment-id:734961676 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): Did you change the redirect uri in the environment variables to be `http://localhost:8080/`?
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Yep, I have been using $ export SPOTIPY_REDIRECT_URI='http://localhost:8080/'

<!-- gh-comment-id:734963619 --> @Sticks111 commented on GitHub (Nov 27, 2020): Yep, I have been using $ export SPOTIPY_REDIRECT_URI='http://localhost:8080/'
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

What is the URL of the page that you are redirected to after you sign in to your Spotify account and click agree.

<!-- gh-comment-id:734964595 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): What is the URL of the page that you are redirected to after you sign in to your Spotify account and click agree.
Author
Owner
<!-- gh-comment-id:734965041 --> @Sticks111 commented on GitHub (Nov 27, 2020): The URL is: http://localhost:8080/?code=AQBpSL9wFDTPb5y0ZPRF91lFbcv0F-QQHQxyRnOJ-yrAblpfYETIeB5D6WA1ke-gZECaL0FHNBpGKYeV8GJhj-qTscovQXTUEZEF34pcAvDQYhJb4NuImQgP_-F-jmV8L68N6ePTON9qBJNRE0dFE66taWk7P-wxdgEnbc97w3J-Ic8XlEpTWHmOR0_p4Y634pbZJY6-U-lVG4z_IsKNuAsNOAxyTZdSLsd4TxLYPOo
Author
Owner

@Peter-Schorn commented on GitHub (Nov 27, 2020):

Well then I don't know why it doesn't work

<!-- gh-comment-id:734967910 --> @Peter-Schorn commented on GitHub (Nov 27, 2020): Well then I don't know why it doesn't work
Author
Owner

@Sticks111 commented on GitHub (Nov 27, 2020):

Thanks Peter! Will keep working on it and hopefully there will be a breakthrough
A quick question; this part right here; is this exactly how this should be typed into the terminal?:
python3 -m flask run --port=8080
Just now I also added inbound and outbound rules to my firewall to allow access to port 5000. Not sure that helped though.

<!-- gh-comment-id:734991404 --> @Sticks111 commented on GitHub (Nov 27, 2020): Thanks Peter! Will keep working on it and hopefully there will be a breakthrough A quick question; this part right here; is this exactly how this should be typed into the terminal?: python3 -m flask run --port=8080 Just now I also added inbound and outbound rules to my firewall to allow access to port 5000. Not sure that helped though.
Author
Owner

@dieser-niko commented on GitHub (Aug 28, 2024):

I'm going to close this issue as it seems to be outdated. Please reopen if the issue still persists.

<!-- gh-comment-id:2314833198 --> @dieser-niko commented on GitHub (Aug 28, 2024): I'm going to close this issue as it seems to be outdated. Please reopen if the issue still persists.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#368
No description provided.