amyasnikov/validity

Data Source Syncing Stuck when Sync originate from Complience Tests

Closed this issue · 4 comments

Validity Version

3.0.3

NetBox Version

4.1.1

Python Version

3.12.3

Steps to Reproduce

Launch tests with validity and checking Sync Data Source,
if it fails (in my case because ssh key was not working), the data source will become stuck in a sync state when you go to Operations --> Data sources, impossible to delete it or re-sync it.

I can try to explain more in detail if you need to!

Thank you ;)
Arthur

Note : If I am making too much issues with your plugin, don't hesitate to tell me ! I know we all have things to do everyday !

Traceback

"Unhandled error occured: `<class 'UnboundLocalError'>: cannot access local variable '_' where it is not associated with a value`
  File \"/opt/netbox/venv/lib/python3.12/site-packages/validity/scripts/runtests/base.py\", line 40, in terminate_job_on_error
    yield
  File \"/opt/netbox/venv/lib/python3.12/site-packages/validity/scripts/runtests/split.py\", line 109, in __call__
    self.sync_datasources(params.overriding_datasource, device_filter, logger)\n  File \"/opt/netbox/venv/lib/python3.12/site-packages/validity/scripts/runtests/split.py\", line 40, in sync_datasources
    self.datasource_sync_fn(datasources, device_filter)
  File \"/opt/netbox/venv/lib/python3.12/site-packages/validity/utils/misc.py\", line 74, in datasource_sync
    any(tp.map(sync_func, datasources))
  File \"/usr/lib/python3.12/concurrent/futures/_base.py\", line 619, in result_iterator yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/lib/python3.12/concurrent/futures/_base.py\", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File \"/usr/lib/python3.12/concurrent/futures/_base.py\", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File \"/usr/lib/python3.12/concurrent/futures/_base.py\", line 401, in __get_result
    raise self._exception
  File \"/usr/lib/python3.12/concurrent/futures/thread.py\", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/opt/netbox/venv/lib/python3.12/site-packages/validity/utils/misc.py\", line 66, in sync_func
    datasource.sync(device_filter)
  File \"/opt/netbox/venv/lib/python3.12/site-packages/validity/models/data.py\", line 112, in sync
    return super().sync()
           ^^^^^^^^^^^^^^
  File \"/opt/netbox/netbox/core/models/data.py\", line 164, in sync
    raise SyncError(_(\"Cannot initiate sync; syncing already in progress.\"))
                    ^"

Hey @aascedu, according to the traceback you've provided I can conclude that it's NetBox issue, not Validity one. I suppose you can try to run sync of git-based data source twice (second one must be started before first one finishes) and run into exactly the same situation

Thank you @amyasnikov, You seem very devoted to Netbox and your plugin, I would love to know why ?
Thank you for for all your help!

You seem very devoted to Netbox and your plugin, I would love to know why ?

So, why not? :)
I'm interested in providing high-quality product to the open source community

I'm closing this issue, so please keep track of the netbox issue I've provided above.