zoffline / zwift-offline

Use Zwift offline
GNU Affero General Public License v3.0
774 stars 128 forks source link

stravalib.protocol.ApiV3 error #341

Closed jricoclq closed 5 months ago

jricoclq commented 5 months ago

Recently, the server program(standalone.py) has frequently encountered this error, which can cause it to freeze and cause the client to have no task response. It is necessary to restart the server to solve this problem. Please help to take a look. How can this problem be resolved? image 无标题

fatsbrown commented 5 months ago

If the server is running remotely you should consider enabling CDN proxy (https://github.com/zoffline/zwift-offline?tab=readme-ov-file#extra-optional-steps), it will disable urllib3 create_connection patch (https://github.com/zoffline/zwift-offline/blob/master/standalone.py#L38) which may be related to the problem.

Also notice that client ID 28117 was used before https://github.com/zoffline/zwift-offline/commit/3497a108070ddf2e005f14bf13659d7e8ccd1d92 and is no longer valid (see #323).

jricoclq commented 5 months ago

Thank you very much! I try it.

jricoclq commented 5 months ago

55e0a4536c8a43713d0794676a4a7b1 d8f54146378ecb621e30fd0fb611f6f This error still exists, after create a cdn-proxy.txt file in the storage directory.

fatsbrown commented 5 months ago

Try running zoffline from source and update gevent to the latest version manually (pip install -U gevent), maybe it's related to this, since the Windows release uses Python 3.12.3 and gevent 23.9.1

Add support for Python patch releases 3.11.8 and 3.12.2, which changed internal details of threading.

https://www.gevent.org/changelog.html

fatsbrown commented 5 months ago

If you still have the problem you can try running the external uploads in a separate thread (https://github.com/fatsbrown/zwift-offline/commit/5651ee96352e460a31c124e42507393301c94f7d), the upload may still fail but at least Zwift should not freeze.

jricoclq commented 5 months ago

Try running zoffline from source and update gevent to the latest version manually (pip install -U gevent), maybe it's related to this, since the Windows release uses Python 3.12.3 and gevent 23.9.1

Add support for Python patch releases 3.11.8 and 3.12.2, which changed internal details of threading.

https://www.gevent.org/changelog.html

image I have updated Python 3.12.4 and GEVENT24.2.1, but I am not sure if they are related to this GEVENT24.2.1. I am unable to update ZWIFT1.68 now, which is a direct error.

fatsbrown commented 5 months ago

Run pip install -r requirements.txt from zwift-offline directory to ensure you have the correct modules versions.

fatsbrown commented 5 months ago

Also notice that if you installed launcher version 1.1.13 you need to patch cacert.pem again.

jricoclq commented 5 months ago

I have done everything you said, but when updating 1.68, the issue still persists and cannot be updated. image

fatsbrown commented 5 months ago

Your screenshot shows you are accessing from local host (127.0.0.1), CDN proxy will not work in this situation, it only works if the server is running on a different machine.

fatsbrown commented 5 months ago

Also notice that when using CDN proxy, the machine running the server can't have the hosts file modified, it needs to have access to the official Zwift server.

jricoclq commented 5 months ago

image It's also the same error.

fatsbrown commented 5 months ago

See my previous comment.

You need to disable CDN proxy or remove the line from hosts on the server machine.

jricoclq commented 5 months ago

See my previous comment.

You need to disable CDN proxy or remove the line from hosts on the server machine.

image

As you said, I have done everything and there will be no more lag when uploading Strava. However, upgrading to 1.68 and not being able to complete the update has become a common issue for most servers. Like this, the update cannot be completed. I don't know if it's due to changes in this area. 屏幕截图 2024-06-27 221020

屏幕截图 2024-06-27 220919

jricoclq commented 5 months ago

After deleting HOSTS, run ZWIFT to connect to the official server, and it will prompt that it is already the latest version, version 1.67.

fatsbrown commented 5 months ago

After deleting HOSTS, run ZWIFT to connect to the official server, and it will prompt that it is already the latest version, version 1.67.

That's because the 1.68 update is still in phased rollout and is not available for your machine yet. It should be available shortly though. If you have many clients in your server, I suggest that you wait until the phased rollout is finished (usually 2 days after it starts) before updating the server.

However, upgrading to 1.68 and not being able to complete the update has become a common issue for most servers. Like this, the update cannot be completed. I don't know if it's due to changes in this area.

If CDN proxy is disabled, zoffline will try to use Google DNS (8.8.8.8) to resolve the Zwift domain and as you can see in your second screenshot, it's timing out (maybe it's not available in your region?). Alternatively you can run get_gameassets.py in the scripts folder to cache the game assets (remove the line from hosts file before running), but you will also need to delete the lines 37 to 59 of standalone.py

If CDN proxy is enabled, the hosts file in the server machine can't contain the Zwift hosts and the client can't be running on the same machine.

fatsbrown commented 5 months ago

As you can see in https://forums.zwift.com/t/game-update-v-1-68-june-2024/631343/17 the 1.68 update is available to everyone now

Captura de tela 2024-06-27 125334

fatsbrown commented 5 months ago

I have done everything and there will be no more lag when uploading Strava.

Please tell me, https://github.com/fatsbrown/zwift-offline/commit/5651ee96352e460a31c124e42507393301c94f7d was required or only updating Python and requirements was enough?

jricoclq commented 5 months ago

I have done everything and there will be no more lag when uploading Strava.

Please tell me, fatsbrown@5651ee9 was required or only updating Python and requirements was enough?

I did not operate this fatsbrown@5651ee9 , but I upgraded to Python 3.12.4 and gevent 24.2.1. I have only tried 1 kilometer without any error , and I need to try more. Other server members have used it without any errors so far. thank you very much , Please give me two days so that I can try more.

jricoclq commented 5 months ago

I have done everything and there will be no more lag when uploading Strava.

Please tell me, fatsbrown@5651ee9 was required or only updating Python and requirements was enough?

It is useful, and this error did not occur later. Thankyou very much.