andrewcooke / choochoo

Training Diary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to Initially Configure

jhavens12 opened this issue · comments

Running initial setup with a base directory specified, I am unable to complete the initial configure with the configure button on the website.

When I click the configure button, it shows as "Please Wait Writing data." and does not change from this screen. If the page is refreshed, it returns to the initial config page.

so this is the 'initial' page under configure? that's a surprisingly simple step to fail.

do you have anything under ~/.ch2? if so, remove that, and then run ch2 --dev configure load default

if that doesn't fix things can you post the output from that command?

There was a 0-32 folder in the ~/ch2 directory.
That command did work to complete the initial setup - I assume the issue is some type of permissions issue writing to a config file because I get the same wait screen when trying to save my Garmin username in the Configure/Constants page.

I was able to get choochoo running on my Macbook for context running 10.15.4

hmmm. something sounds broken. if you can read data via the web interface but not write then you will need to use ch2 upload from the command line to load data.

in ~/.ch2/0-32/logs/ there should be a web.log file. if that has anything that looks like an important error, please post it here and i'll have a look.

sorry this isn't more polished. it's kinda stuck in the trap of not having enough users to flush out the bugs while being too buggy to attract many users. so any bug report helps.

I don't see anything in that log file that stands out, nothing mentioned about trying to save the config file. I'd like to get it working on Ubuntu Server but I'm not sure how to access the web interface from a remote machine (as mentioned in the other issue).

No worries - it seems like you've put in a lot of work to get this far.
Thanks!

To reiterate, i was able to get this working on a Macbook Pro and a Ubuntu server machine, both have the issue with not being able to initially configure via the web interface or make/save any changes on the web interface without hanging. I have looked in the logs and haven't seen anything that has stood out.

Thanks

https://github.com/andrewcooke/choochoo/blob/dev-group/dev/recent-errors.sh is a script that goes through log files and extracts any errors or warnings.

could you run the web server, do something that fails, and then run that script (with an argument like 5 for the last 5 minutes) and post any results.

alternatively ch2 web stop and then ch2 --dev web service, do something that fails, and post what is displayed to stdout.

there should be an error somewhere!

I'm able to run the second command here and I see log items generated on each page I load. However If I try to do something, like upload a new activity fit file, the webpage hangs but there is nothing appended to the console output.

When I try and use any of the analyze options, i see this in the output:

INFO: 10.0.1.20 - - [27/May/2020 15:15:05] "GET /api/kit/items HTTP/1.1" 200 -
DEBUG: Reading index.html.gz from ch2.web.static
DEBUG: Encoding gzip not supported by server: [Errno 2] No such file or directory: '/home/havens/env/lib/python3.7/site-packages/ch2/web/static/index.html.gz'
DEBUG: Reading index.html from ch2.web.static
INFO: 10.0.1.20 - - [27/May/2020 15:15:05] "GET /favicon.ico HTTP/1.1" 200 -
DEBUG: Reading index.html.gz from ch2.web.static
DEBUG: Encoding gzip not supported by server: [Errno 2] No such file or directory: '/home/havens/env/lib/python3.7/site-packages/ch2/web/static/index.html.gz'
DEBUG: Reading index.html from ch2.web.static
INFO: 10.0.1.20 - - [27/May/2020 15:16:54] "GET /favicon.ico HTTP/1.1" 200 -
DEBUG: Read db-version=0-32
DEBUG: Process 5736 does not exist
DEBUG: No percent for upload
DEBUG: Returning data: {'activities_start': '2020-05-26', 'activities_finish': '2020-05-27', 'activities_by_group': {'Run': ['2020-05-26 06:00:03']}, 'latest_activity_group': 'Run', 'latest_activity_time': '2020-05-26 06:00:03', 'nearby_constraints': []}
INFO: 10.0.1.20 - - [27/May/2020 15:16:58] "GET /api/analysis/parameters HTTP/1.1" 200 -
DEBUG: Reading index.html.gz from ch2.web.static
DEBUG: Encoding gzip not supported by server: [Errno 2] No such file or directory: '/home/havens/env/lib/python3.7/site-packages/ch2/web/static/index.html.gz'
DEBUG: Reading index.html from ch2.web.static
INFO: 10.0.1.20 - - [27/May/2020 15:16:58] "GET /favicon.ico HTTP/1.1" 200 -
INFO: Attempting to display template all_activities
DEBUG: Reading /home/havens/env/lib/python3.7/site-packages/ch2/jupyter/template/init.py
DEBUG: ['TEMPLATE', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'activity_details', 'all_activities', 'calendar', 'compare_activities', 'define_segment', 'fit_ff_segments', 'fit_power_parameters', 'gmap_activities', 'health', 'heart_rate', 'month', 'nearby_activities', 'route_sentinel_3d', 'similar_activities', 'some_activities']
DEBUG: Template args: ['2020-05-26', '2020-05-27']
INFO: Creating all_activities at /home/havens/.ch2/0-32/notebooks/all_activities/2020-05-26-2020-05-27.ipynb with {'base': '~/.ch2', 'start': '2020-05-26', 'finish': '2020-05-27'}
DEBUG: Tokenizing all_activities
DEBUG: Loading template all_activities
DEBUG: Deleting old version of /home/havens/.ch2/0-32/notebooks/all_activities/2020-05-26-2020-05-27.ipynb
INFO: Writing all_activities to /home/havens/.ch2/0-32/notebooks/all_activities/2020-05-26-2020-05-27.ipynb
DEBUG: Starting remote service
DEBUG: Using command "/home/havens/env/bin/python3.7 /home/havens/env/bin/ch2"
DEBUG: Adding command [/home/havens/env/bin/python3.7 /home/havens/env/bin/ch2 --verbosity 0 --log jupyter-service.log --base ~/.ch2 jupyter service] (PID 1718)
DEBUG: Process 1718 still exists
INFO: Service started
DEBUG: Read jupyter-url=http://localhost:8891/
DEBUG: Redirecting to http://localhost:8891/tree/all_activities/2020-05-26-2020-05-27.ipynb
INFO: 10.0.1.20 - - [27/May/2020 15:18:34] "GET /api/jupyter/all_activities?start=2020-05-26&finish=2020-05-27 HTTP/1.1" 302 -

Attempting to display the activity calendar in Analyze

INFO: Attempting to display template calendar
DEBUG: Reading /home/havens/env/lib/python3.7/site-packages/ch2/jupyter/template/init.py
DEBUG: ['TEMPLATE', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'activity_details', 'all_activities', 'calendar', 'compare_activities', 'define_segment', 'fit_ff_segments', 'fit_power_parameters', 'gmap_activities', 'health', 'heart_rate', 'month', 'nearby_activities', 'route_sentinel_3d', 'similar_activities', 'some_activities']
DEBUG: Template args: []
INFO: Creating calendar at /home/havens/.ch2/0-32/notebooks/calendar/calendar.ipynb with {'base': '~/.ch2'}
DEBUG: Tokenizing calendar
DEBUG: Loading template calendar
DEBUG: Deleting old version of /home/havens/.ch2/0-32/notebooks/calendar/calendar.ipynb
INFO: Writing calendar to /home/havens/.ch2/0-32/notebooks/calendar/calendar.ipynb
DEBUG: Starting remote service
DEBUG: Using command "/home/havens/env/bin/python3.7 /home/havens/env/bin/ch2"
DEBUG: Adding command [/home/havens/env/bin/python3.7 /home/havens/env/bin/ch2 --verbosity 0 --log jupyter-service.log --base ~/.ch2 jupyter service] (PID 1757)
DEBUG: Process 1757 still exists
INFO: Service started
DEBUG: Read jupyter-url=http://localhost:8892/
DEBUG: Redirecting to http://localhost:8892/tree/calendar/calendar.ipynb
INFO: 10.0.1.20 - - [27/May/2020 15:20:35] "GET /api/jupyter/calendar HTTP/1.1" 302 -

ah. is this remotely?

the analyse stuff is invoking jupyter which is a different server. that is binding to localhost again (see the urls above).

can you run everything locally (on the mac?). currently there is no way analysis is going to work remotely. sorry.

can you enter data in the diary? does something basic like that work?

if not, again, any error when that fails would be gold.

Okay that makes sense. I am able to write in the diary and refresh the page and the information stays. However if i try to upload an activity I am met with the same waiting screen but nothing changes in the log file after initially opening the page

INFO: 10.0.1.20 - - [27/May/2020 15:28:14] "GET /favicon.ico HTTP/1.1" 200 -
DEBUG: Read db-version=0-32
DEBUG: Process 5736 does not exist
DEBUG: No percent for upload
DEBUG: Returning data: []
INFO: 10.0.1.20 - - [27/May/2020 15:28:21] "GET /api/kit/items HTTP/1.1" 200 -
DEBUG: Reading index.html.gz from ch2.web.static
DEBUG: Encoding gzip not supported by server: [Errno 2] No such file or directory: '/home/havens/env/lib/python3.7/site-packages/ch2/web/static/index.html.gz'
DEBUG: Reading index.html from ch2.web.static
INFO: 10.0.1.20 - - [27/May/2020 15:28:21] "GET /favicon.ico HTTP/1.1" 200 -

It just sits on "Please wait, writing data."

what about web-upload.log? it should have spawned a separate process that writes there.

I see an upload.log but no web-upload.log
The upload.log looks like it's written to when I upload via command line, but is unchanged when using the web interface

hmmm. seems like it's failing to spawn the command.

i am working right now, but this evening i will look and maybe add more diagnostics there. sorry i can't do more right now.

No worries! just checking it out. I am able to get the "analyze" to come up when running locally - it does look a bit strange and im not sure if its correct. It looks like Jupyter notebook opens up and I have to go to Cell > Run All to get the graphs to display. Is this intended?

yes, that's intended. there is no way (that i have found) to auto-run the notebook.

if you're still willing to help diagnose the problem with the config and have the time, please could you run the following:

rm -fr /tmp/.ch2; ch2 --dev --base /tmp/.ch2 web service > test.log 2>&1

then go to http://localhost:8000/configure/initial and click Configure / OK, wait a moment, and then hit ctrl-C and send me the file test.log.

thanks (i want to compare it with what i see - there's no separate process here, so there should be something useful in the logs).

closing this since have no mode data and there's a new release out now.

plan to support containers next release.