Now this is confusing -- and frustrating

I have a Streamlit app (https://quakes.streamlit.app/) that I had deployed successfully. I later moved it to a GitHub organization so I could organize things. A couple of days after doing so I noticed that I was getting an error message from slack saying it failed to pull the data and deploy. I needed to fix the keys. So I did so and the data pull has since resumed

So, with the rest of the repo is working fine, I set to confirming the app was displaying correctly. It wasn’t and isn’t.

This is what I see when I try to access the site:

Honestly, I couldn’t tell what file this referred to because the message was so vague. My presumption was it was the Streamlit app and that’s what it turned out to be.

HERE’S WHERE IT GETS WEIRD Line 8 is the import for streamlit.

I then tried to deploy it locally and got the same error (I’ll save you another photo). Since I wasn’t totally sure it was the app, I tried what I knew wouldn’t work, putting a st.write("this is the problem file") before the import.

The browser tab to the local file showed it had been changed. It wouldn’t display, of course, as the message is before the import but it does show where the problem is.

With that in mind, I updated the conda environment with Streamlit. Additionally, I’ve restarted the app several times.

Still no luck.

I’m at a loss here and could use some help. I don’t see this topic on the discussion boards so it appears new.

Thanks

Also, the repo as requested GitHub - Data-Science-Projects-Code/Quakes

You are catching the exception and raising it again without the context here:

The full error suggests that the requested JSON is not well formatted.


Looking a bit closer, the request to github_repo_url is not going to return a json back, hence the decoding error, is just some html. Perhaps that link was supposed to point somewhere else?

Hmmm. If that’s the error I’m not sure why this would go from working to suddenly not working. I’m also don’t see why that would cause it to show the error at line 8.

Let me think (and work on) that a bit and get back to you.

Thank you so much for the help!

It is not line 8 of your script, but line 8 of the JSON in the response.

Here is the full traceback, after removing that try/except block I pointed out:

1 Like

Perhaps something changed in how GitHub respond to requests. To get the contents of a repository, consider using their API instead: REST API endpoints for repository contents - GitHub Docs

Because of this commit:

1 Like

Oh, I see. Thank you for that. That was enough for me to get over the hump.

Is there a way for the error messages to include the file name? Because, while I appreciate your helping me you helping me, I think adding that would save you time or let you address more interesting questions.

error loading data

What file name? The error is raised by response.json(), because the response is not JSON but HTML. There is no file name involved.