gvellut / jncep

Command-line tool to generate EPUB files for J-Novel Club pre-pub novels
GNU General Public License v3.0
43 stars 11 forks source link

TimeoutError when using track or update #18

Closed kidburglar closed 2 years ago

kidburglar commented 2 years ago

Hello,

First and all, thanks for your tool without it, I would not be able to read so much.

I recently updated because the API change and I got a pretty old version of jncep but after update I got the next issue. I only took the part of the log that, I think, is interesting I can provide a bigger log if needed.

2022-03-22 19:35:28,685 jncep.utils  ERROR    *** An unrecoverable error occured ***
2022-03-22 19:35:28,685 jncep.utils  ERROR    
2022-03-22 19:35:28,690 jncep.cli    DEBUG    Traceback (most recent call last):
   File "/home/user/GITS/jncep/env/lib/python3.7/site-packages/asks/utils.py", line 15, in timeout_manager
    return await coro(*args)
   File "/usr/lib/python3.7/contextlib.py", line 188, in __aexit__
    await self.gen.athrow(typ, value, traceback)
   File "/home/user/GITS/jncep/env/lib/python3.7/site-packages/anyio/_backends/_trio.py", line 112, in fail_after
    raise TimeoutError().with_traceback(exc.__traceback__) from None
   File "/home/user/GITS/jncep/env/lib/python3.7/site-packages/anyio/_backends/_trio.py", line 110, in fail_after
    yield CancelScope(cancel_scope)
   File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
   File "/home/user/GITS/jncep/env/lib/python3.7/site-packages/trio/_timeouts.py", line 108, in fail_at
    raise TooSlowError
 TimeoutError

By changing few timeout values (I did initial value * 6) in jnclabs.py I got it working, but I don't know if it is maybe because I got a very long list to track or if it's an issue with my internet provider / DNS that made the response slow.

        labs_api_default_timeout=60,
        jnc_api_default_timeout=60,
        cdn_default_timeout=120,
        jncweb_default_timeout=60,
        connection_timeout=60,

Have a good day.

Cheers

gvellut commented 2 years ago

Thank you for your feedback.

Is the error for the track or the update command?

Could you paste the full log? I know it might be very large but I would like to see which of the API is slow or if it is a specific series. The timeouts are for each network request individually so it shouldn't matter if you have a lot of series.

But if I can't find anything I will hardcode an increase of the timeouts like you did or at least add a flag.

kidburglar commented 2 years ago

Hello @gvellut

Sorry, I had no time yesterday to add the logs, I did a gist because it's massive (https://gist.github.com/kidburglar/1ef4bbb9c9f344ff32cb928f0e47645e)

To reproduce, I did the next steps

pyhton3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python setup.py install
# I set the env variable for my email and password with export
# I renamed the tracked file to force it to do the sync
jncep track sync
gvellut commented 2 years ago

Thank you. I think I misunderstood one of the timeout arguments for the network library. I will change that and test.