I'm getting following error in the middle of running script. This collects running configs from NCM:
2025-02-04 10:31:27 [SERVERNAME] NetworkAutomation: app:backup_archive function:_node_is_active_on_backup_archive module:backupmanagement severity:DEBUG user:tool message:"Node is active"
2025-02-04 10:31:27 [SERVERNAME] NetworkAutomation: app:backup_archive function:_ncm_pull_backup module:backupmanagement severity:DEBUG user:tool message:"[DEVICENAME] is NCM licensed"
2025-02-04 10:31:27 [SERVERNAME] NetworkAutomation: app:backup_archive function:_ncm_pull_backup module:backupmanagement severity:DEBUG user:tool message:"[BEGIN] Get latest backup from Solarwinds NCM"
2025-02-04 10:31:27 [SERVERNAME] NetworkAutomation: app:backup_archive function:_run_sql_query module:solarwindsextract severity:DEBUG user:tool message:"Building SQL query for extract. Query: SELECT TOP 1 Caption, NodeID, Nodes.NodeProperties.ConfigArchive.DownloadTime, Nodes.NodeProperties.ConfigArchive.ConfigType, Nodes.NodeProperties.ConfigArchive.Config FROM Orion.Nodes WHERE NodeID=8301 and Nodes.NodeProperties.ConfigArchive.ConfigType='Running' ORDER BY DownloadTime DESC"
2025-02-04 10:31:27 [SERVERNAME] NetworkAutomation: app:backup_archive function:_run_sql_query module:solarwindsextract severity:DEBUG user:tool message:"Running SQL query against solarwinds api"
2025-02-04 10:31:28 [SERVERNAME] NetworkAutomation: app:backup_archive function:_run_sql_query module:solarwindsextract severity:ERROR user:tool message:"Running SQL query failed!"
Traceback (most recent call last):
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib64/python3.8/http/client.py", line 1348, in getresponse
response.begin()
File "/usr/lib64/python3.8/http/client.py", line 316, in begin
version, status, reason = self._read_status()
File "/usr/lib64/python3.8/http/client.py", line 277, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib64/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/lib64/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib64/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib64/python3.8/http/client.py", line 1348, in getresponse
response.begin()
File "/usr/lib64/python3.8/http/client.py", line 316, in begin
version, status, reason = self._read_status()
File "/usr/lib64/python3.8/http/client.py", line 277, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib64/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/lib64/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib64/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/net/tool/backup_archive/python/localmodules/solarwindsextract.py", line 73, in _run_sql_query
respons = self._swis.query(query)
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/orionsdk/swisclient.py", line 23, in query
return self._req(
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/orionsdk/swisclient.py", line 55, in _req
resp = self._session.request(method,
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/opt/net/tool/backup_archive/.venv/lib64/python3.8/site-packages/requests/adapters.py", line 682, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))