Skip to content

[bug] 500 Internal Server Error: failed to resolve api.github.com #251

@mcay23

Description

@mcay23

Describe the bug
Hello, when accessing the website, keep getting 500 Internal Server Error
I'm accessing through tailscale. After a server restart, will work normally for some time (1-2 days). Then this issue appears after which I have to restart the app again to fix it. No issues with other services running on the same VM

calibre-web.log

calibre-web.log

The server encountered an internal error and was unable to complete your request. There is an error in the application.
Traceback (most recent call last):
File "/lsiopy/lib/python3.10/site-packages/urllib3/connection.py", line 196, in _new_conn
sock = connection.create_connection(
File "/lsiopy/lib/python3.10/site-packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/lsiopy/lib/python3.10/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
File "/lsiopy/lib/python3.10/site-packages/urllib3/connectionpool.py", line 490, in _make_request
raise new_e
File "/lsiopy/lib/python3.10/site-packages/urllib3/connectionpool.py", line 466, in _make_request
self._validate_conn(conn)
File "/lsiopy/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
conn.connect()
File "/lsiopy/lib/python3.10/site-packages/urllib3/connection.py", line 615, in connect
self.sock = sock = self._new_conn()
File "/lsiopy/lib/python3.10/site-packages/urllib3/connection.py", line 203, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x7f582d9dc940>: Failed to resolve 'api.github.com' ([Errno -3] Temporary failure in name resolution)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/lsiopy/lib/python3.10/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/lsiopy/lib/python3.10/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "/lsiopy/lib/python3.10/site-packages/urllib3/util/retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/crocodilestick/calibre-web-automated/releases/latest (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f582d9dc940>: Failed to resolve 'api.github.com' ([Errno -3] Temporary failure in name resolution)"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/app/calibre-web/cps/usermanagement.py", line 97, in decorated_view
return login_required(func)(*args, **kwargs)
File "/app/calibre-web/cps/cw_login/utils.py", line 296, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File "/app/calibre-web/cps/web.py", line 842, in index
return render_books_list("newest", sort_param, 1, page)
File "/app/calibre-web/cps/web.py", line 453, in render_books_list
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
File "/app/calibre-web/cps/render_template.py", line 164, in render_title_template
cwa_update_notification()
File "/app/calibre-web/cps/render_template.py", line 148, in cwa_update_notification
update_available, current_version, tag_name = cwa_update_available()
File "/app/calibre-web/cps/render_template.py", line 121, in cwa_update_available
response = requests.get("https://api.github.com/repos/crocodilestick/calibre-web-automated/releases/latest")
File "/lsiopy/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/lsiopy/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/lsiopy/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/lsiopy/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/lsiopy/lib/python3.10/site-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/crocodilestick/calibre-web-automated/releases/latest (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f582d9dc940>: Failed to resolve 'api.github.com' ([Errno -3] Temporary failure in name resolution)"))

To Reproduce
Steps to reproduce the behavior:

---
services:
  calibre-web-automated:
    image: crocodilestick/calibre-web-automated:latest
    container_name: calibre-web-automated
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/GMT+7
    volumes:
      - ./config:/config
      - ./book-upload:/cwa-book-ingest
      - /media/mypassport/calibre:/calibre-library
    ports:
      - 8084:8083
    restart: unless-stopped

sudo docker compose up -d

directory looks like

  • docker-compose.yml
  • config
  • book-upload

Expected behavior
No error

Configuration(please complete the following information):

  • OS: Proxmox running Debian 12.2.0
  • Hardware: AMD Ryzen

Additional context
Here is the log file: https://pastebin.com/qSvkWkqh
Do you know what could be causing this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    in progressA fix is currently being worked on / is in testing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions