sissbruecker / linkding

Self-hosted bookmark manager that is designed be to be minimal, fast, and easy to set up using Docker.
MIT License
5.75k stars 274 forks source link

Any breaking changes lately? Container stopped working out of the blue. #622

Closed C8opmBM closed 7 months ago

C8opmBM commented 7 months ago

Hello, I've been quietly running linkding for some time without any issue. It's setup behind caddy with authelia. Today, it stopped working. I checked everything I could think of, deleted data, checked cloudflare domain, checked for new envs, nothing.

The error in caddy is i/o timeout, which it seems to be translating: _This means Caddy wasn’t able to connect to your upstream and it gave up after 3 seconds (the default dialtimeout). Make sure your upstream address is correct and that if you’re using a hostname instead of an IP address, that your DNS resolvers are correctly configured on your machine.

I checked the above, nothing seems to be pointing to an error.

Any advice? Did anything change recently? I have no issue with my other (70+) containers.

My compose (working up until today):

  linkding:
    container_name: linkding
    image: sissbruecker/linkding:latest
    hostname: linkding
    profiles:
      - social
    networks:
      - social
    volumes:
      - ${CONFIGDIR}/linkding/data:/etc/linkding/data
    environment:
      PUID: ${TZ}
      PGID: ${TZ}
      TZ: ${TZ}
      LD_SUPERUSER_NAME: ${LD_SUPERUSER_NAME}
      LD_DISABLE_BACKGROUND_TASKS: "true"
      LD_ENABLE_AUTH_PROXY: "true"
      LD_AUTH_PROXY_USERNAME_HEADER: HTTP_REMOTE_USER
      LD_AUTH_PROXY_LOGOUT_URL: ${LD_AUTH_PROXY_LOGOUT_URL}
      LD_CSRF_TRUSTED_ORIGINS: ${LD_CSRF_TRUSTED_ORIGINS}
    restart: unless-stopped

Caddy config:

(restricted-access) {
        forward_auth authelia:9091 {
                uri /api/verify?rd=https://auth.{$DOMAIN}/
                copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
        }
}

(cloudflare-tls) {
        tls {$EMAIL} {
                dns cloudflare {$CLOUDFLARE_API_TOKEN}
        }
}

(headers) {
        header {
                Permissions-Policy interest-cohort=()
                Strict-Transport-Security max-age=31536000;
                X-Content-Type-Options nosniff
                Content-Security-Policy upgrade-insecure-requests
                Referrer-Policy strict-origin-when-cross-origin
                ?X-Frame-Options SAMEORIGIN
        }
}

(main) {
        crowdsec

        respond /robots.txt 200 {
                body "User-agent: *
    Disallow: /

    User-agent: AdsBot-Google
    Disallow: /

    User-agent: AdsBot-Google-Mobile
    Disallow: /"

                close
        }

        encode zstd gzip

        log {
                output file {$LOG_FILE} {
                        roll_size 12mb
                        roll_keep 5
                        roll_keep_for 72h
                }
                format json {
                        time_format wall
                        time_local
                }
                level INFO
        }
}

link.{$DOMAIN} {
        import restricted-access
        reverse_proxy linkding:9090
        import headers
        import cloudflare-tls
        import main
}

Caddy Error log


add duration=3.011847193
add err_id=sdrtahbb9
add err_trace=reverseproxy.statusError (reverseproxy.go:1267)
add level=error
add logger=http.log.error.log4
add msg=dial tcp 172.20.207.3:9090: i/o timeout
request=
add client_ip=192.168.1.153
headers=
add Accept=[ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8" ]
add Accept-Encoding=[ "gzip, deflate, br" ]
add Accept-Language=[ "en-US,en;q=0.8" ]
add Cookie=[ ]
add Referer=[ "https://auth.my.domain/" ]
add Sec-Ch-Ua=[ ""Not A(Brand";v="99", "Brave";v="121", "Chromium";v="121"" ]
add Sec-Ch-Ua-Mobile=[ "?0" ]
add Sec-Ch-Ua-Platform=[ ""Windows"" ]
add Sec-Fetch-Dest=[ "document" ]
add Sec-Fetch-Mode=[ "navigate" ]
add Sec-Fetch-Site=[ "same-site" ]
add Sec-Fetch-User=[ "?1" ]
add Sec-Gpc=[ "1" ]
add Upgrade-Insecure-Requests=[ "1" ]
add User-Agent=[ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" ]
add host=link.my.domain
add method=GET
add proto=HTTP/2.0
add remote_ip=192.168.1.153
add remote_port=50642
tls=
add cipher_suite=4867
add proto=h2
add resumed=false
add server_name=link.my.domain
add version=772
add uri=/
add status=502
add ts=1706603535.085497

Linkding log (doesn't seem to have any error)

01/30/2024
10:11:52 AM
[uWSGI] getting INI configuration from uwsgi.ini
01/30/2024
10:11:52 AM
[uwsgi-static] added mapping for /static => static
01/30/2024
10:11:52 AM
[uwsgi-static] added mapping for /static => data/favicons
01/30/2024
10:11:52 AM
*** Starting uWSGI 2.0.22 (64bit) on [Tue Jan 30 10:11:52 2024] ***
01/30/2024
10:11:52 AM
compiled with version: 8.3.0 on 24 November 2023 08:40:15
01/30/2024
10:11:52 AM
os: Linux-6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023
01/30/2024
10:11:52 AM
nodename: linkding
01/30/2024
10:11:52 AM
machine: aarch64
01/30/2024
10:11:52 AM
clock source: unix
01/30/2024
10:11:52 AM
detected number of CPU cores: 4
01/30/2024
10:11:52 AM
current working directory: /etc/linkding
01/30/2024
10:11:52 AM
writing pidfile to /tmp/linkding.pid
01/30/2024
10:11:52 AM
detected binary path: /opt/venv/bin/uwsgi
01/30/2024
10:11:52 AM
!!! no internal routing support, rebuild with pcre support !!!
01/30/2024
10:11:52 AM
setgid() to 33
01/30/2024
10:11:52 AM
setuid() to 33
01/30/2024
10:11:52 AM
your memory page size is 4096 bytes
01/30/2024
10:11:52 AM
detected max file descriptor number: 1048576
01/30/2024
10:11:52 AM
building mime-types dictionary from file /etc/mime.types...565 entry found
01/30/2024
10:11:52 AM
lock engine: pthread robust mutexes
01/30/2024
10:11:52 AM
thunder lock: disabled (you can enable it with --thunder-lock)
01/30/2024
10:11:52 AM
uWSGI http bound on :9090 fd 4
01/30/2024
10:11:52 AM
uwsgi socket 0 bound to TCP address 127.0.0.1:44323 (port auto-assigned) fd 3
01/30/2024
10:11:52 AM
Python version: 3.10.6 (main, Aug 23 2022, 09:47:38) [GCC 8.3.0]
01/30/2024
10:11:52 AM
Python main interpreter initialized at 0x557460d390
01/30/2024
10:11:52 AM
python threads support enabled
01/30/2024
10:11:52 AM
your server socket listen backlog is limited to 100 connections
01/30/2024
10:11:52 AM
your mercy for graceful operations on workers is 60 seconds
01/30/2024
10:11:53 AM
mapped 274608 bytes (268 KB) for 4 cores
01/30/2024
10:11:53 AM
*** Operational MODE: preforking+threaded ***
01/30/2024
10:11:54 AM
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x557460d390 pid: 1 (default app)
01/30/2024
10:11:54 AM
*** uWSGI is running in multiple interpreter mode ***
01/30/2024
10:11:54 AM
spawned uWSGI master process (pid: 1)
01/30/2024
10:11:54 AM
spawned uWSGI worker 1 (pid: 18, cores: 2)
01/30/2024
10:11:54 AM
spawned uWSGI worker 2 (pid: 20, cores: 2)
01/30/2024
10:11:54 AM
*** Stats server enabled on 127.0.0.1:9191 fd: 14 ***
01/30/2024
10:11:54 AM
spawned uWSGI http 1 (pid: 22)
01/30/2024
10:12:07 AM
[pid: 20|app: 0|req: 1/1] 127.0.0.1 () {28 vars in 302 bytes} [Tue Jan 30 08:12:06 2024] GET /health => generated 42 bytes in 321 msecs (HTTP/1.1 200) 8 headers in 251 bytes (1 switches on core 0)
01/30/2024
10:12:37 AM
[pid: 18|app: 0|req: 1/2] 127.0.0.1 () {28 vars in 301 bytes} [Tue Jan 30 08:12:37 2024] GET /health => generated 42 bytes in 325 msecs (HTTP/1.1 200) 8 headers in 251 bytes (1 switches on core 0)
01/30/2024
10:13:07 AM
[pid: 20|app: 0|req: 2/3] 127.0.0.1 () {28 vars in 302 bytes} [Tue Jan 30 08:13:07 2024] GET /health => generated 42 bytes in 6 msecs (HTTP/1.1 200) 8 headers in 251 bytes (1 switches on core 1)
01/30/2024
10:13:37 AM
[pid: 18|app: 0|req: 2/4] 127.0.0.1 () {28 vars in 302 bytes} [Tue Jan 30 08:13:37 2024] GET /health => generated 42 bytes in 4 msecs (HTTP/1.1 200) 8 headers in 251 bytes (1 switches on core 1)
01/30/2024
10:14:08 AM
[pid: 18|app: 0|req: 3/5] 127.0.0.1 () {28 vars in 302 bytes} [Tue Jan 30 08:14:08 2024] GET /health => generated 42 bytes in 2 msecs (HTTP/1.1 200) 8 headers in 251 bytes (1 switches on core 0)
C8opmBM commented 7 months ago

Somehow, it solved itself out the next day... could have been some DNS issue, I dont know :)