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

Git DataSource sync fails when HTTP proxies are configured #12483

Closed
vrelk-net opened this issue May 4, 2023 · 0 comments · Fixed by #12484
Closed

Git DataSource sync fails when HTTP proxies are configured #12483

vrelk-net opened this issue May 4, 2023 · 0 comments · Fixed by #12484
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@vrelk-net
Copy link

NetBox version

v3.5.0

Python version

3.8

Steps to Reproduce

  1. Configure HTTP_PROXIES in configuration.py
  2. Run a Git based Data Source sync
HTTP_PROXIES = {
    'http': 'http://xxx.xxx.xxx.xxx:3128',
    'https': 'http://xxx.xxx.xxx.xxx:3128',
}

Expected Behavior

If you have HTTP_PROXIES configured, the sync task fails. If you comment out that section of the config, then restart the netbox-rq service, the sync works.

Observed Behavior

May  4 12:39:20 it-netbox python3[141419]: 12:39:20 default: core.jobs.sync_datasource(job=<Job: 54fd9fa1-a5b8-49de-ae4f-6a2288d2fd50>) (54fd9fa1-a5b8-49de-ae4f-6a2288d2fd50)
May  4 12:39:21 it-netbox python3[236504]: 12:39:21 [Job 54fd9fa1-a5b8-49de-ae4f-6a2288d2fd50]: exception raised while executing (core.jobs.sync_datasource)
May  4 12:39:21 it-netbox python3[236504]: Traceback (most recent call last):
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox/venv/lib/python3.8/site-packages/rq/worker.py", line 1359, in perform_job
May  4 12:39:21 it-netbox python3[236504]:     rv = job.perform()
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox/venv/lib/python3.8/site-packages/rq/job.py", line 1178, in perform
May  4 12:39:21 it-netbox python3[236504]:     self._result = self._execute()
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox/venv/lib/python3.8/site-packages/rq/job.py", line 1215, in _execute
May  4 12:39:21 it-netbox python3[236504]:     result = self.func(*self.args, **self.kwargs)
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox-3.5.0/netbox/core/jobs.py", line 33, in sync_datasource
May  4 12:39:21 it-netbox python3[236504]:     raise e
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox-3.5.0/netbox/core/jobs.py", line 20, in sync_datasource
May  4 12:39:21 it-netbox python3[236504]:     datasource.sync()
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox-3.5.0/netbox/core/models/data.py", line 155, in sync
May  4 12:39:21 it-netbox python3[236504]:     with backend.fetch() as local_path:
May  4 12:39:21 it-netbox python3[236504]:   File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
May  4 12:39:21 it-netbox python3[236504]:     return next(self.gen)
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox-3.5.0/netbox/core/data_backends.py", line 99, in fetch
May  4 12:39:21 it-netbox python3[236504]:     config.set("http", "proxy", proxy)
May  4 12:39:21 it-netbox python3[236504]:   File "/opt/netbox/venv/lib/python3.8/site-packages/dulwich/config.py", line 735, in set
May  4 12:39:21 it-netbox python3[236504]:     return self.writable.set(section, name, value)
May  4 12:39:21 it-netbox python3[236504]: NotImplementedError: <bound method StackedConfig.set of <StackedConfig for []>>
@vrelk-net vrelk-net added the type: bug A confirmed report of unexpected behavior in the application label May 4, 2023
tobiasge added a commit to tobiasge/netbox that referenced this issue May 4, 2023
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label May 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants