I have a live streamlit cloud app located here: https://commish.streamlit.app/
The public github is here: GitHub - jeisey/commish
The app is a free tool for anyone to connect their fantasy football league to ESPN, Yahoo, or Sleeper and generate a weekly recap in a character style of their choice (via GPT4). The primary functionality is authenticating your league and then generating a summary. The app was running without issues for 3 weeks and without making any changes to the code, the core functions of the app stopped working on 11/11/2023 (4 days ago). Specifically, all summary-generating functions seem to have ceased working for ESPN, Yahoo, and Sleeper. Unfortunately I’m unsure how to troubleshoot further than what I’ve done below:
I’ve tried the following:
- adding DEBUG to the LOGGER for more information about where the errors occur now
- clearing cache, removed data-cache functions, rebooting app, and even deleting & re-deploying the app (summary functionality still stopped working)
- Locally, everything works. I can run this in a local environment without any issues
Below are the last few lines of my console logs where you can see the DEBUG statements
2023-11-15 20:20:56.129 Attempting ESPN summary generator...
2023-11-15 20:20:56.130 Creating new DataCache (key=fe338a9dbdab10527d24da399706750a, persist=None, max_entries=None, ttl=3600)
2023-11-15 20:20:56.131 Cache key: a84318a870fc62d1aea4ca1a7f126b97
2023-11-15 20:20:56.131 Memory cache MISS: a84318a870fc62d1aea4ca1a7f126b97
2023-11-15 20:20:56.131 Memory cache MISS: a84318a870fc62d1aea4ca1a7f126b97
DEBUG:nfl league:ESPN API Request: url: https://fantasy.espn.com/apis/v3/games/ffl/seasons/2023/segments/0/leagues/1491839 params: {'view': ['mTeam', 'mRoster', 'mMatchup', 'mSettings', 'mStandings']} headers: None
Regardless of which league I connect to I get similar debug logs where it attempts to generate a summary and then breaks. In many cases the console log doesn’t even update as I try to authenticate other leagues. One thought was due to a lot of usage perhaps the APIs throttled/blocked, but it seems unlikely all 3 services would do that given the total users was about 250 people using the app ~4 times, collectively over 3 weeks. Not that extreme, and not enough to trip any of the API limits for those respective services.
My app.py file is where all the frontend logic occurs. This is leading to believe it may be due to some order of operations in caching & connecting, or perhaps some recent streamlit update? I checked the respective packages and nothing was updated 11/11/2023 so a bit unsure how else to troubleshoot this further. Any help/advice is appreciated, thank you.