CTHRU/Hitrava

[BUG]

chemiso21 opened this issue · 14 comments

Describe the bug
A clear and concise description of what the bug is.
C:\Hitrava-4.0.0>Hitrava.py --zip HiZip.zip --password ******** --json_export
Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.
It can be installed using: pip install xmlschema
2020-11-02 11:53:54,178 - INFO - main - Hitrava version 4.0.0 (build 2010.2902) started with arguments ['--zip', 'HiZip.zip', '--password', '********', '--json_export']
2020-11-02 11:53:54,178 - INFO - main - Running on Python version 3.9.0
2020-11-02 11:53:54,178 - ERROR - extract_json - Invalid ZIP file or ZIP file not found <HiZip.zip>
Traceback (most recent call last):
File "C:\Hitrava-4.0.0\Hitrava.py", line 2041, in
main()
File "C:\Hitrava-4.0.0\Hitrava.py", line 2023, in main
json_filename = HiZip.extract_json(args.zip, args.output_dir, args.password)
File "C:\Hitrava-4.0.0\Hitrava.py", line 1128, in extract_json
raise Exception('Invalid ZIP file or ZIP file not found <%s>', zip_filename)
Exception: ('Invalid ZIP file or ZIP file not found <%s>', 'HiZip.zip')
Logs
If applicable, add logging and error information from the application.
To enable full logging, add the command line argument --log_level DEBUG when running the program.

Files
If applicable, add relevant input and output files (by dragging them here).
For JSON conversions, you can use the --json_export command line argument. This will generate a separate .json file with the original Huawei HiTrack data for each activity that you can add here.

Note: be aware that your fitness activity files (may) contain personal data. We will notify that you can remove the attached files from your report as soon as we have downloaded them. We will ONLY use the files for debugging purposes.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

CTHRU commented

Please take care in not posting your passwords here. I edited your comment to remove it.

You probably forgot to rename or copy your ZIP file in the Hitrava installation folder. Please check if your file HiZip.zip is in the installation folder and that it is the correct file.

If the problem persists, let me know. If it is solved, thank you for closing this issue.

no se puede exportar las actividades de octubre
C:\Hitrava-4.0.0>Hitrava.py --zip HiZip.zip -- [password removed]--json_export
Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.
It can be installed using: pip install xmlschema
usage: Hitrava.py [-h] [-z ZIP] [-p PASSWORD] [-j JSON] [--json_export] [-f FILE]
[-s {Walk,Run,Cycle,Swim_Pool,Swim_Open_Water}] [-t TAR] [--from_date FROM_DATE]
[--pool_length POOL_LENGTH] [--tcx_insert_altitude_data] [--output_dir OUTPUT_DIR]
[--use_original_filename] [--output_file_prefix OUTPUT_FILE_PREFIX]
[--suppress_output_file_sequence] [--validate_xml] [--log_level {INFO,DEBUG}]
Hitrava.py: error: unrecognized arguments: -- xxxxxxxxxxxx--json_export

C:\Hitrava-4.0.0>Hitrava.py --zip HiZip.zip -- [password removed]--json_export
Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.
It can be installed using: pip install xmlschema
usage: Hitrava.py [-h] [-z ZIP] [-p PASSWORD] [-j JSON] [--json_export] [-f FILE]
[-s {Walk,Run,Cycle,Swim_Pool,Swim_Open_Water}] [-t TAR] [--from_date FROM_DATE]
[--pool_length POOL_LENGTH] [--tcx_insert_altitude_data] [--output_dir OUTPUT_DIR]
[--use_original_filename] [--output_file_prefix OUTPUT_FILE_PREFIX]
[--suppress_output_file_sequence] [--validate_xml] [--log_level {INFO,DEBUG}]
Hitrava.py: error: unrecognized arguments: -- xxxxxxxxx
no se puede exportar las actividades de octubre
--json_export

[link removed]

CTHRU commented

I'm sorry, you have a lot of different messages with different questions both from Hitrava Script and Hitrava Web. I'll try to respond them as I understand them.

  • Hitrava Web is an alpha version and is currently trial mode only (with restrictions). I think your question is the same as in issue #32. Please read my answer there.

  • Hitrava Script question in your comment above here.
    The --password command line argument is missing and there is no space between your password and the next --json_export command line argument, so you get error 'Hitrava.py: error: unrecognized arguments: -- xxxxxxxxxxxx--json_export. Please take a good look at the base example for conversion or download the Run_Hitrava_Decrypt.cmd file again to adapt the command correctly.
    Your installation directory in the comment above looks fine.

You have:

Hitrava.py --zip HiZip.zip -- yourpasswordgoeshere--json_export

It should be:

Hitrava.py --zip HiZip.zip --password yourpasswordgoeshere --json_export

ok thank you very much for your work I have tried and it continues to fail.
The zip is apparently well renamed and I have set the password as you have suggested.
The web is amazing. I look forward to the moment.

If there is any other solution, if not I will keep trying. Thank you.

this message has something to do? thanks
Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.

CTHRU commented

No, the xmlschema info message is not important for you. You don't use (and don't need to use) the --validate_xml argument.

Do you get a different error now after correcting the script or your command on the command prompt?
If you wish, post the logging again here and I'll have a look at it. Do NOT copy the first line 'C:\Hitrava-4.0.0>Hitrava.py --zip HiZip.zip --password ...' as it contains your password. I specifically added a logging message to see the command line arguments in code WITHOUT the password being exposed.

I have requested a new file from huawei in case it was wrong and I have reinstalled everything. It keeps giving the same error.
Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.
It can be installed using: pip install xmlschema
2020-11-03 12:43:15,026 - INFO - main - Hitrava version 4.0.0 (build 2010.2902) started with arguments ['--zip', 'HiZip.zip', '--password', '********', '--json_export']
2020-11-03 12:43:15,026 - INFO - main - Running on Python version 3.9.0
2020-11-03 12:43:15,030 - ERROR - extract_json - Invalid ZIP file or ZIP file not found <HiZip.zip>
Traceback (most recent call last):
File "C:\Users\jose_\Documents\Hitrava-4.0.0\Hitrava.py", line 2041, in
main()
File "C:\Users\jose_\Documents\Hitrava-4.0.0\Hitrava.py", line 2023, in main
json_filename = HiZip.extract_json(args.zip, args.output_dir, args.password)
File "C:\Users\jose_\Documents\Hitrava-4.0.0\Hitrava.py", line 1128, in extract_json
raise Exception('Invalid ZIP file or ZIP file not found <%s>', zip_filename)
Exception: ('Invalid ZIP file or ZIP file not found <%s>', 'HiZip.zip')

CTHRU commented

Ah, I just saw what is wrong!
Somebody had the same thing earlier. Your Windows Explorer settings are such that extension are not displayed.
However, it lists Hizip**.zip** (with the extension), which means that the real filename in your case is Hizip.zip.zip
As a result, the command can't find the requested 'HiZip.zip' file.
Remove the superfluous .zip part from the filename (and maybe change that setting in Windows Explorer to see extensions, so you can see the FULL name of the file) and try again. Guaranteed it will work.

Amazing. you are a crack. It works now. I do not get to understand well what is the real problem of the conflict with the windows explorer, but it works. Thank you very much for your time and effort.
How can I thank you?

CTHRU commented

Glad I could help out.
If you wish, you can always make me happy by buying me a coffee.