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

nginx import -> Name or service not known #568

Open
list4nestor opened this issue Oct 5, 2021 · 2 comments
Open

nginx import -> Name or service not known #568

list4nestor opened this issue Oct 5, 2021 · 2 comments

Comments

@list4nestor
Copy link

list4nestor commented Oct 5, 2021

Here are logs at import time, behind a proxy:

Importing data from nginx
Traceback (most recent call last):
 File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
 conn = connection.create_connection(
 File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
 File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
 httplib_response = self._make_request(
 File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
 conn.request(method, url, **httplib_request_kw)
 File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
 super(HTTPConnection, self).request(method, url, body=body, headers=headers)
 File "/usr/local/lib/python3.8/http/client.py", line 1256, in request
 self._send_request(method, url, body, headers, encode_chunked)
 File "/usr/local/lib/python3.8/http/client.py", line 1302, in _send_request
 self.endheaders(body, encode_chunked=encode_chunked)
 File "/usr/local/lib/python3.8/http/client.py", line 1251, in endheaders
 self._send_output(message_body, encode_chunked=encode_chunked)
 File "/usr/local/lib/python3.8/http/client.py", line 1011, in _send_output
 self.send(msg)
 File "/usr/local/lib/python3.8/http/client.py", line 951, in send
 self.connect()
 File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
 conn = self._new_conn()
 File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
 raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7faa0f721940>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
 resp = conn.urlopen(
 File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
 retries = retries.increment(
 File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
 raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='nginx.org', port=80): Max retries exceeded with url: /en/security_advisories.html (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7faa0f721940>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/opt/vulnerablecode/vulnerabilities/management/commands/import.py", line 110, in _import_data
 ImportRunner(importer, batch_size).run(cutoff_date=cutoff_date)
 File "/opt/vulnerablecode/vulnerabilities/import_runner.py", line 89, in run
 process_advisories(data_source)
 File "/usr/local/lib/python3.8/contextlib.py", line 75, in inner
 return func(*args, **kwds)
 File "/opt/vulnerablecode/vulnerabilities/import_runner.py", line 116, in process_advisories
 advisory_batches = chain(data_source.updated_advisories(), data_source.added_advisories())
 File "/opt/vulnerablecode/vulnerabilities/importers/nginx.py", line 69, in updated_advisories
 data = requests.get(self.url).content
 File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 75, in get
 return request('get', url, params=params, **kwargs)
 File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
 return session.request(method=method, url=url, **kwargs)
 File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
 resp = self.send(prep, **send_kwargs)
 File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
 r = adapter.send(request, **kwargs)
 File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
 raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='nginx.org', port=80): Max retries exceeded with url: /en/security_advisories.html (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7faa0f721940>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Failure to import data from nginx. Continuing...
@list4nestor list4nestor changed the title nginx import -> nginx import -> Name or service not known Oct 5, 2021
@pombredanne
Copy link
Collaborator

@list4nestor Thank for the report.
Could this be a transient DNS issue?
https://nginx.org/en/security_advisories.html and http://nginx.org/en/security_advisories.html are both available.
What if you re-run the importer from the CLI today?

@pombredanne
Copy link
Collaborator

We have another proxy-related issue in #559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants