Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry run python -m strava_to_fittrackee.s2f --sync returning erros #26

Open
DW4y opened this issue Sep 27, 2024 · 2 comments · May be fixed by #27
Open

poetry run python -m strava_to_fittrackee.s2f --sync returning erros #26

DW4y opened this issue Sep 27, 2024 · 2 comments · May be fixed by #27

Comments

@DW4y
Copy link

DW4y commented Sep 27, 2024

Hello,

I'm running into the next problem. Set all up like in the instructions and used poetry with pyenv 3.10.10

Using virtualenv: /home/pierre/.cache/pypoetry/virtualenvs/strava-to-fittrackee-JaUpv7uk-py3.10

but poetry run python -m strava_to_fittrackee.s2f --sync returns:

INFO:s2f:No FitTrackee workouts were found, so syncing all!
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/pierre/strava-to-fittrackee/strava_to_fittrackee/s2f.py", line 1189, in <module>
    sync_strava_with_fittrackee()
  File "/home/pierre/strava-to-fittrackee/strava_to_fittrackee/s2f.py", line 1095, in sync_strava_with_fittrackee
    activities = strava.get_activities(after=latest_dt, limit=None)
  File "/home/pierre/strava-to-fittrackee/strava_to_fittrackee/s2f.py", line 386, in get_activities
    custom_raise_for_status(r)
  File "/home/pierre/strava-to-fittrackee/strava_to_fittrackee/s2f.py", line 184, in custom_raise_for_status
    fifteen_usage, daily_usage = dict(r.headers)["X-RateLimit-Usage"].split(",")
KeyError: 'X-RateLimit-Usage'

I'm using Fittrackee behind traefik but all headers are forwarded correct (it also works with nextcloud what needs the headers).

Thanks!

@jat255
Copy link
Owner

jat255 commented Sep 27, 2024

My best guess is that Traefik isn't actually forwarding all the headers? So X-RateLimit-Usage isn't present as expected?

The strava API explicitly states that they send that header: https://developers.strava.com/docs/rate-limits/, and I haven't seen this in any of my deployments before. You'd have to debug to see what keys are present in dict(r.headers) at that point

@erral erral linked a pull request Jan 3, 2025 that will close this issue
@saukkico
Copy link

saukkico commented Jan 8, 2025

I had exactly the same problem. Changing the headers to lower case solved the problem, as mentioned in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants