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

Timeout during schema files download #20

Open
cukiernick opened this issue Sep 16, 2022 · 1 comment
Open

Timeout during schema files download #20

cukiernick opened this issue Sep 16, 2022 · 1 comment

Comments

@cukiernick
Copy link

Timeout exception can be raised during schema download, and scan_models can still succeed (capabilites.txt file is created, no exception is raised).
Some yang files may be missing, and because scan_models verifies only capabilities.txt against the remote ones, there is no attempt to download missing yang files on subsequent calls.

Traceback of worker thread:

Exception in thread download_worker_0:
Traceback (most recent call last):
  File "/usr/lib64/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/home/user/ws/.venv39-yang/lib64/python3.9/site-packages/ncdiff/model.py", line 497, in run
    self.downloader.download(module)
  File "/home/user/ws/.venv39-yang/lib64/python3.9/site-packages/ncdiff/model.py", line 794, in download                                    
    reply = super(ModelDevice, self.device).execute(
  File "/home/user/ws/.venv39-yang/lib64/python3.9/site-packages/ncclient/manager.py", line 246, in execute                                                                                                          return cls(self._session,
  File "/home/user/ws/.venv39-yang/lib64/python3.9/site-packages/ncclient/operations/retrieve.py", line 199, in request                                                                                              return self._request(node)
  File "/home/user/ws/.venv39-yang/lib64/python3.9/site-packages/ncclient/operations/rpc.py", line 381, in _request                                                                                                  raise TimeoutExpiredError('ncclient timed out while waiting for an rpc reply.')
ncclient.operations.errors.TimeoutExpiredError: ncclient timed out while waiting for an rpc reply.

Main thread interrupted with ^C:

Traceback (most recent call last):
  File "/home/user/ws/solutions/c/yang/reprod.py", line 67, in <module>
    session.scan_models()
  File "/home/user/ws/.venv39-yang/lib64/python3.9/site-packages/ncdiff/manager.py", line 274, in scan_models
    d.download_all(check_before_download=(download == 'check'))
  File "/home/user/ws/.venv39-yang/lib64/python3.9/site-packages/ncdiff/model.py", line 763, in download_all
    self.download_queue.join()
  File "/usr/lib64/python3.9/queue.py", line 90, in join
    self.all_tasks_done.wait()
  File "/usr/lib64/python3.9/threading.py", line 312, in wait
    waiter.acquire()
KeyboardInterrupt
@yuekyang
Copy link
Collaborator

Would increasing timeout help in your case?

>>> from ncdiff import manager
>>> m = manager.connect(host='2.3.4.5', port=830,
                        username='admin', password='admin',
                        hostkey_verify=False, look_for_keys=False)
>>> m.timeout = 120
>>> m.scan_models()

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