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

Nike Run Club sync failed #9

Closed
semico opened this issue Oct 10, 2020 · 13 comments
Closed

Nike Run Club sync failed #9

semico opened this issue Oct 10, 2020 · 13 comments

Comments

@semico
Copy link

semico commented Oct 10, 2020

it failed when I try to sync the data from NRC

@semico
Copy link
Author

semico commented Oct 10, 2020

Traceback (most recent call last):
22
File "scripts/nike_sync.py", line 308, in
23
files = get_to_generate_files()
24
File "scripts/nike_sync.py", line 147, in get_to_generate_files
25
for i in os.listdir(OUTPUT_DIR)
26
File "scripts/nike_sync.py", line 148, in
27
if int(i.split(".")[0]) > last_time
28
ValueError: invalid literal for int() with base 10: 'README'

@yihong0618
Copy link
Owner

Seems like a bug. let me see~

@yihong0618
Copy link
Owner

yihong0618 commented Oct 10, 2020

@semico can you check if hava any data in activities after nike_sync.

yihong0618 added a commit that referenced this issue Oct 10, 2020
@yihong0618
Copy link
Owner

@semico can you double check?

@semico
Copy link
Author

semico commented Oct 11, 2020

Yes, all the activities have been retrieved, because the number of files is equal to my running count in NRC app

@semico
Copy link
Author

semico commented Oct 11, 2020

1602372752594
Traceback (most recent call last):
File "scripts/nike_sync.py", line 311, in
files = get_to_generate_files()
File "scripts/nike_sync.py", line 148, in get_to_generate_files
return [
File "scripts/nike_sync.py", line 151, in
if int(i.split(".")[0]) > last_time
ValueError: invalid literal for int() with base 10: ''

@yihong0618
Copy link
Owner

yihong0618 commented Oct 11, 2020

@semico can you retry by latest code.

And make sure you run sync script in this root dir

@semico
Copy link
Author

semico commented Oct 11, 2020

@yihong0618 still not work, sorry that I cannot debug it by myself, but I'm trying to learn Python and understand the code.

1602372752594
Traceback (most recent call last):
File "scripts/nike_sync.py", line 312, in
make_new_gpxs(files)
File "scripts/nike_sync.py", line 299, in make_new_gpxs
parsed_data = parse_activity_data(json_data)
File "scripts/nike_sync.py", line 248, in parse_activity_data
for i, metric in enumerate(activity["metrics"]):
KeyError: 'metrics'

But i found a fact, the first time I try from the beginning without remove the test data, it runs well. It failed when I remove all the test data.

@yihong0618
Copy link
Owner

@semico
Don't worry, my pleasure to fix it.
I think your nrc contains empty run file. I try to fix the bug.
Now please pull the latest code and try again follow the Readme thanks.

@yihong0618 yihong0618 reopened this Oct 11, 2020
@semico
Copy link
Author

semico commented Oct 11, 2020

1602372752594
The activity 73462884-e16b-49a4-926e-7de35f0469a1 doesn't contain metrics information
The activity 36790881-d313-414f-b831-9485c349a268 doesn't contain metrics information
The activity bd05309a-32c9-4183-bcfa-6f7134c1ddc6 doesn't contain metrics information
The activity 30da853a-4bc8-4f3a-b90c-43c60ac6218e doesn't contain metrics information
The activity 7b244c7c-92c7-42f4-9840-ca83b231b057 doesn't contain metrics information
The activity a9133284-e16a-410f-aa23-ca697e3db470 doesn't contain metrics information
The activity 09afed94-748c-4eb4-bf98-9553bc6267aa doesn't contain metrics information
The activity 01836ee5-12d3-40cd-aae1-db1bee14dfd0 doesn't contain metrics information
425
Something went wrong when loading GPX. for file 1337958166012.gpx
417
+++++++++++++++++++++++++Traceback (most recent call last):
File "scripts/nike_sync.py", line 318, in
make_activities_file(SQL_FILE, GPX_FOLDER, JSON_FILE)
File "/Users/yubohu/Code/running_page/scripts/utils.py", line 9, in make_activities_file
generator.sync_from_gpx(gpx_dir)
File "/Users/yubohu/Code/running_page/scripts/generator/init.py", line 76, in sync_from_gpx
created = update_or_create_activity(self.session, t.to_namedtuple())
File "/Users/yubohu/Code/running_page/scripts/generator/db.py", line 92, in update_or_create_activity
distance=run_activity.distance,
AttributeError: 'x' object has no attribute 'distance'

you got it, but new bug appeared... :(

@yihong0618
Copy link
Owner

yihong0618 commented Oct 11, 2020

@semico That is another problem about NRC, I think you can delete the wrong gpx file, I will try to fix this tomorrow.

@yihong0618
Copy link
Owner

yihong0618 commented Oct 12, 2020

@semico add try catch can you try again?

@semico
Copy link
Author

semico commented Oct 13, 2020

problem solved 👍

yihong0618 added a commit that referenced this issue Oct 27, 2020
yihong0618 added a commit that referenced this issue Oct 27, 2020
yihong0618 added a commit that referenced this issue Mar 23, 2021
ben-29 referenced this issue in ben-29/workouts_page Sep 5, 2021
ben-29 referenced this issue in ben-29/workouts_page Sep 5, 2021
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

No branches or pull requests

2 participants