Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: ConnectionError: HTTPConnectionPool(host='localhost', port=6969): Max retries exceeded with url: /api?ma_password=**********&apikey=**********&output=json&ma_username=**********&priority=1&mode=addurl&name=https%3A%2F%2Fwww.usenet-crawler.com%2Fgetnzb%2Ffd6066755336b6384209b47b90f21697.nzb%26i%3D299033%26r%3D**********&cat=tve (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x5eee86b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.9.35-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@31efaeb46890fe7c9c2eb33893ff7e8953374982
**Link to Log**: https://gist.github.com/81ccb19b20b08cd8cfaa265e1becae78
### ERROR
<pre>
2017-10-31 03:07:01 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [31efaeb] DailySearchQueueItem Exception, error: HTTPConnectionPool(host='localhost', port=6969): Max retries exceeded with url: /api?ma_password=**********&apikey=**********&output=json&ma_username=**********&priority=1&mode=addurl&name=https%3A%2F%2Fwww.usenet-crawler.com%2Fgetnzb%2Ffd6066755336b6384209b47b90f21697.nzb%26i%3D299033%26r%3D**********&cat=tve (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x5eee86b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/medusa/search/queue.py#L288">medusa/search/queue.py</a>", line 288, in run
    self.success = snatch_episode(result)
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/medusa/search/core.py#L134">medusa/search/core.py</a>", line 134, in snatch_episode
    result_downloaded = sab.send_nzb(result)
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/medusa/clients/nzb/sab.py#L62">medusa/clients/nzb/sab.py</a>", line 62, in send_nzb
    response = session.get(url, params=params, verify=False)
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/ext/requests/sessions.py#L521">ext/requests/sessions.py</a>", line 521, in get
    return self.request('GET', url, **kwargs)
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/medusa/session/core.py#L94">medusa/session/core.py</a>", line 94, in request
    **kwargs)
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/ext/requests/sessions.py#L508">ext/requests/sessions.py</a>", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/ext/requests/sessions.py#L618">ext/requests/sessions.py</a>", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/Medusa/<a href="../blob/31efaeb46890fe7c9c2eb33893ff7e8953374982/ext/requests/adapters.py#L508">ext/requests/adapters.py</a>", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='localhost', port=6969): Max retries exceeded with url: /api?ma_password=**********&apikey=**********&output=json&ma_username=**********&priority=1&mode=addurl&name=https%3A%2F%2Fwww.usenet-crawler.com%2Fgetnzb%2Ffd6066755336b6384209b47b90f21697.nzb%26i%3D299033%26r%3D**********&cat=tve (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x5eee86b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


Discussion:
This shouldn't be an error, only a warning.

Resolving patch:
diff --git a/medusa/clients/nzb/sab.py b/medusa/clients/nzb/sab.py
--- a/medusa/clients/nzb/sab.py
+++ b/medusa/clients/nzb/sab.py
@@ -15,13 +15,13 @@
 from medusa import app
 from medusa.logger.adapters.style import BraceAdapter
 
-from medusa.session.core import MedusaSession
+from medusa.session.core import MedusaSafeSession
 from requests.compat import urljoin
 
 log = BraceAdapter(logging.getLogger(__name__))
 log.logger.addHandler(logging.NullHandler())
 
-session = MedusaSession()
+session = MedusaSafeSession()
 
 
 def send_nzb(nzb):


Test patch: