|
I am a beginner trying to access data from FastF1 using Google Colab for a school project. My code worked perfectly find recently, but when I tried to run it again yesterday, it stopped working, as the "session has not been loaded". Cell 1, which is basically just the setup, still appears to work perfectly fine. Output: However, the last line of cell two has issues: Output: Any advice? The same result occurs when i try to load a different session (i've tried different location, different year, race instead of qualifying). Edit: After even more experimenting, it DOES work with 2021 and 2022, but not for 2023 onwards (which it did previously). |
Replies: 1 comment 2 replies
|
Your log points to a data-source/fallback problem, not to your plotting code. FastF1 only logs Both are reachable from here with HTTP 200, while the same paths on Quick check inside the same Colab runtime: import requests
base = "https://livetiming.formula1.com/static/2024/2024-09-22_Singapore_Grand_Prix/2024-09-21_Qualifying/"
for page in ["SessionInfo.jsonStream", "TimingData.jsonStream"]:
r = requests.get(base + page, headers={"User-Agent": "BestHTTP"})
print(page, r.status_code, len(r.content), r.url)If that prints 200s outside Colab but 403/404/etc. in Colab, the fix is to run from a network/runtime that can reach the primary F1 endpoint, or use a cache populated from such a runtime. Clearing the cache alone will not help if every fresh request still falls back to the mirror. Also, the exception at If this explains the Colab failure path, please mark it as the answer so other FastF1 users know to check the primary livetiming status before debugging their analysis code. |

That 403 is the actual blocker. It means Colab can reach the host, but the F1/CloudFront side is refusing that Colab runtime. From another network I still get HTTP 200 for the same SessionInfo URL, so this is not something your plotting code can fix.
Practical options:
Try the same script outside Colab first, for example local Python/Jupyter on your laptop. A quick browser test is enough to start: open the SessionInfo.jsonStream URL directly. If it downloads or shows text instead of 403, that network should be able to populate FastF1 data.
Enable a persistent FastF1 cache before loading the session:
In Colab that could…