Pfuenzle / AnisearchKomga

A Metadata Provider for Komga using AniSearch
37 stars 18 forks source link

connection refused #2

Closed ofsaleem closed 2 years ago

ofsaleem commented 2 years ago

im running komga in docker and i've been trying to run anisearch in docker as well, using the docker-compose file you provided, however the container keeps crashing with a connection refused

Traceback (most recent call last):

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn

    conn = connection.create_connection(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create_connection

    raise err

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection

    sock.connect(sa)

ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen

    httplib_response = self._make_request(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request

    conn.request(method, url, **httplib_request_kw)

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request

    super(HTTPConnection, self).request(method, url, body=body, headers=headers)

  File "/usr/lib/python3.8/http/client.py", line 1256, in request

    self._send_request(method, url, body, headers, encode_chunked)

  File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request

    self.endheaders(body, encode_chunked=encode_chunked)

  File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders

    self._send_output(message_body, encode_chunked=encode_chunked)

  File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output

    self.send(msg)

  File "/usr/lib/python3.8/http/client.py", line 951, in send

    self.connect()

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect

    conn = self._new_conn()

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn

    raise NewConnectionError(

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f4850d5c640>: Failed to establish a new connection: [Errno 111] Connection refused

Using user [my-email-address]@gmail.com

Using user [my-email-address]@gmail.com

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/adapters.py", line 440, in send

    resp = conn.urlopen(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen

    retries = retries.increment(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment

    raise MaxRetryError(_pool, url, error or ResponseError(cause))

urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8089): Max retries exceeded with url: /api/v1/series?size=50000 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4850d5c640>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "mangaMetadata.py", line 377, in <module>

    x = requests.get(komgaurl + '/api/v1/series?size=50000', auth = (komgaemail, komgapassword))

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/api.py", line 75, in get

    return request('get', url, params=params, **kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/api.py", line 61, in request

    return session.request(method=method, url=url, **kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/sessions.py", line 529, in request

    resp = self.send(prep, **send_kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/sessions.py", line 645, in send

    r = adapter.send(request, **kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/adapters.py", line 519, in send

    raise ConnectionError(e, request=request)

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8089): Max retries exceeded with url: /api/v1/series?size=50000 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4850d5c640>: Failed to establish a new connection: [Errno 111] Connection refused'))

Traceback (most recent call last):

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn

    conn = connection.create_connection(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create_connection

    raise err

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection

    sock.connect(sa)

ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen

    httplib_response = self._make_request(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request

    conn.request(method, url, **httplib_request_kw)

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request

    super(HTTPConnection, self).request(method, url, body=body, headers=headers)

  File "/usr/lib/python3.8/http/client.py", line 1256, in request

    self._send_request(method, url, body, headers, encode_chunked)

  File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request

    self.endheaders(body, encode_chunked=encode_chunked)

  File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders

    self._send_output(message_body, encode_chunked=encode_chunked)

  File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output

    self.send(msg)

  File "/usr/lib/python3.8/http/client.py", line 951, in send

    self.connect()

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect

    conn = self._new_conn()

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn

    raise NewConnectionError(

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f703cd29640>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/adapters.py", line 440, in send

    resp = conn.urlopen(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen

    retries = retries.increment(

  File "/home/crawler/.local/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment

    raise MaxRetryError(_pool, url, error or ResponseError(cause))

urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8089): Max retries exceeded with url: /api/v1/series?size=50000 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f703cd29640>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "mangaMetadata.py", line 377, in <module>

    x = requests.get(komgaurl + '/api/v1/series?size=50000', auth = (komgaemail, komgapassword))

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/api.py", line 75, in get

    return request('get', url, params=params, **kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/api.py", line 61, in request

    return session.request(method=method, url=url, **kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/sessions.py", line 529, in request

    resp = self.send(prep, **send_kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/sessions.py", line 645, in send

    r = adapter.send(request, **kwargs)

  File "/home/crawler/.local/lib/python3.8/site-packages/requests/adapters.py", line 519, in send

    raise ConnectionError(e, request=request)

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8089): Max retries exceeded with url: /api/v1/series?size=50000 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f703cd29640>: Failed to establish a new connection: [Errno 111] Connection refused'))

i've confirmed that in a browser, http://localhost:8089/api/v1/series?size=50000 works fine. my docker-compose file for anisearch has this line - KOMGAURL=http://localhost:8089 do i need to put the url in differently?

thanks!

vinnpinn commented 2 years ago

Hey, you can't use localhost within a docker container since this tries to resolve to the localhost of that docker container. Try using the IP of your computer as if you were to access komga from a different device in your local network.

Pfuenzle commented 2 years ago

Right, you could either put both containers in a docker network and use the Containername of the komga container as the hostname, or you use the host IP as a hostname (most likely 172.17.0.1, you can search for it by running "ip a" in a terminal and looking for the "docker0" entry)

ofsaleem commented 2 years ago

thanks team, i am embarrassed i didn't make that connection myself (pun intended) lmao