Skip to content
New issue

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

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

Already on GitHub? # to your account

TrainerRoad stopped syncing: Input Marketing not found in form #201

Open
pickytri opened this issue Feb 22, 2025 · 0 comments
Open

TrainerRoad stopped syncing: Input Marketing not found in form #201

pickytri opened this issue Feb 22, 2025 · 0 comments

Comments

@pickytri
Copy link

Hello, first time doing this so bear with me...

A couple weeks ago I noticed withings-sync stopped syncing to my TrainerRoad and Garmin accounts, after enabling debugging saw this error:

2025-02-22 07:47:40,705 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): www.trainerroad.com:443
2025-02-22 07:47:40,878 - urllib3.connectionpool - DEBUG - https://www.trainerroad.com:443 "POST /app/# HTTP/11" 302 None
2025-02-22 07:47:40,879 - withings_sync.trainerroad - INFO - Logged into TrainerRoad as "**************@gmail.com"
2025-02-22 07:47:41,396 - urllib3.connectionpool - DEBUG - https://www.trainerroad.com:443 "GET /app/profile/rider-information HTTP/11" 200 15972
Traceback (most recent call last):
  File "/root/withings-sync/bin/withings-sync", line 33, in <module>
    sys.exit(load_entry_point('withings-sync==4.2.7', 'console_scripts', 'withings-sync')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/withings-sync/lib/python3.11/site-packages/withings_sync/sync.py", line 510, in main
    sync()
  File "/root/withings-sync/lib/python3.11/site-packages/withings_sync/sync.py", line 456, in sync
    if sync_trainerroad(last_weight):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/withings-sync/lib/python3.11/site-packages/withings_sync/sync.py", line 165, in sync_trainerroad
    logging.info("Current TrainerRoad weight: %s kg ", t_road.weight)
                                                       ^^^^^^^^^^^^^
  File "/root/withings-sync/lib/python3.11/site-packages/withings_sync/trainerroad.py", line 189, in weight
    values, token = self._read_profile()
                    ^^^^^^^^^^^^^^^^^^^^
  File "/root/withings-sync/lib/python3.11/site-packages/withings_sync/trainerroad.py", line 122, in _read_profile
    input_data[key] = self._parse_value(tree, key)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/withings-sync/lib/python3.11/site-packages/withings_sync/trainerroad.py", line 73, in _parse_value
    raise RuntimeError('Input {} not found in form'.format(name))
RuntimeError: Input Marketing not found in form

And it would crash there, not moving on to sync with garmin. After looking at the error I saw it was complaining about not finding Marketing in the input in trainerroad.py, so I went in to that file and made the following changes to comment out the Marking value in the two lines it appears in:

Before:

    _input_data_names = (_ftp, _weight, 'Marketing', 'DateOfBirth')
    _select_data_names = ('TimeZoneId', 'IsPrivate',
                          'Units', 'IsVirtualPowerEnabled',
                          'GenderId', 'GenderCustomText', 'Locale')
    _numerical_verify = (_ftp, _weight)
    _string_verify = _select_data_names + ('Marketing',)

After:

#    _input_data_names = (_ftp, _weight, 'Marketing', 'DateOfBirth')
    _input_data_names = (_ftp, _weight, 'DateOfBirth')
    _select_data_names = ('TimeZoneId', 'IsPrivate',
                          'Units', 'IsVirtualPowerEnabled',
                          'GenderId', 'GenderCustomText', 'Locale')
    _numerical_verify = (_ftp, _weight)
#    _string_verify = _select_data_names + ('Marketing',)
    _string_verify = _select_data_names

That seemed to fix the issue and I can sync again to trainerroad and it doesn't crash so it continues on to sync with garmin. A big caveat: I am not a python coder, I have no idea what the Marketing value does, so I do not know what commenting it out does either, just that it seemed to work for me.

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

No branches or pull requests

1 participant