miniflux / v2

Minimalist and opinionated feed reader
https://miniflux.app
Apache License 2.0
6.99k stars 727 forks source link

Panic serving upon YouTube feed subscription #2741

Closed jeromecst closed 3 months ago

jeromecst commented 4 months ago

I recently updated my miniflux docker container to the latest version and now I get a 502 Bad Gateway nginx on my web server when adding a YouTube feed. Here's the Miniflux logs

level=INFO msg="http: panic serving @: runtime error: invalid memory address or nil pointer dereference\ngoroutine 663 [running]:\nnet/http.(*conn).serve.func1()\n\t/usr/local/go/src/net/http/server.go:1903 +0xbe\npanic({0x560613cec9c0?, 0x56061442bc90?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x132\nminiflux.app/v2/internal/ui.(*handler).submitSubscription(0xc000ba28e0, {0x560613dd1fe0, 0xc0012e02a0}, 0xc001787e60)\n\t/go/src/app/internal/ui/subscription_submit.go:121 +0x8ca\nnet/http.HandlerFunc.ServeHTTP(0xc001787d40?, {0x560613dd1fe0?, 0xc0012e02a0?}, 0x560613a02510?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\nminiflux.app/v2/internal/ui.(*middleware).handleAppSession-fm.(*middleware).handleAppSession.func1({0x560613dd1fe0, 0xc0012e02a0}, 0xc001787d40)\n\t/go/src/app/internal/ui/middleware.go:125 +0x9b4\nnet/http.HandlerFunc.ServeHTTP(0xc001787c20?, {0x560613dd1fe0?, 0xc0012e02a0?}, 0x560613a05668?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\nminiflux.app/v2/internal/ui.(*middleware).handleUserSession-fm.(*middleware).handleUserSession.func1({0x560613dd1fe0, 0xc0012e02a0}, 0xc001787c20)\n\t/go/src/app/internal/ui/middleware.go:59 +0x385\nnet/http.HandlerFunc.ServeHTTP(0xc0017bd410?, {0x560613dd1fe0?, 0xc0012e02a0?}, 0x560613a05678?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\nminiflux.app/v2/internal/http/server.middleware.func1({0x560613dd1fe0, 0xc0012e02a0}, 0xc001787b00)\n\t/go/src/app/internal/http/server/middleware.go:43 +0x351\nnet/http.HandlerFunc.ServeHTTP(0xc0017879e0?, {0x560613dd1fe0?, 0xc0012e02a0?}, 0x1?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\ngithub.com/gorilla/mux.(*Router).ServeHTTP(0xc000668000, {0x560613dd1fe0, 0xc0012e02a0}, 0xc0017877a0)\n\t/go/pkg/mod/github.com/gorilla/mux@v1.8.1/mux.go:212 +0x1e2\nnet/http.serverHandler.ServeHTTP({0x560613dd0040?}, {0x560613dd1fe0?, 0xc0012e02a0?}, 0x6?)\n\t/usr/local/go/src/net/http/server.go:3142 +0x8e\nnet/http.(*conn).serve(0xc000e7a510, {0x560613dd3cb0, 0xc000e77680})\n\t/usr/local/go/src/net/http/server.go:2044 +0x5e8\ncreated by net/http.(*Server).Serve in goroutine 14\n\t/usr/local/go/src/net/http/server.go:3290 +0x4b4"

I didn't notice this problem when adding other feeds like LeMonde.

My docker compose config:

 services:
  miniflux:
    image: miniflux/miniflux:latest
    container_name: miniflux
    environment:
      - DATABASE_MAX_CONNS=32
      - CLEANUP_ARCHIVE_READ_DAYS=270
      - FETCH_YOUTUBE_WATCH_TIME=1
      - RUN_MIGRATIONS=1
      - POLLING_FREQUENCY=10
      - FORCE_REFRESH_INTERVAL=-1
      - CLEANUP_ARCHIVE_UNREAD_DAYS=-1
      - DATABASE_URL=postgres://secret@hidden/miniflux?sslmode=disable
      - LISTEN_ADDR=/tmp/miniflux/miniflux.sock
      - BASE_URL=https://....
    volumes:
      - /share/miniflux:/tmp/miniflux
    restart: unless-stopped

Nginx config:

        server {
                server_name ........;
                listen [::]:443 ssl http2;
                listen 443 ssl http2;

                location / {
                        proxy_set_header   X-Forwarded-Host   $http_host;
                        proxy_set_header   X-Forwarded-For    $remote_addr;
                        proxy_pass http://unix:/share/miniflux/miniflux.sock;
                }
        }

edit: adding nginx & docker configs

vlabo commented 4 months ago

I have the exact same issue. No special config. v2.1.4

runtime error: invalid memory address or nil pointer dereference\ngoroutine 2126 [running]:\nnet/http.(*conn).serve.func1()\n\t/usr/local/go/src/net/http/server.go:1903 +0xbe\npanic({0x5571d6fc19c0?, 0x5571d7700c90?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x132\nminiflux.app/v2/internal/ui.(*handler).submitSubscription(0xc00103dea0, {0x5571d70a6fe0, 0xc0018220e0}, 0xc000fa8b40)\n\t/go/src/app/internal/ui/subscription_submit.go:121 +0x8ca\nnet/http.HandlerFunc.ServeHTTP(0xc000fa8a20?, {0x5571d70a6fe0?, 0xc0018220e0?}, 0x5571d6cd7510?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\nminiflux.app/v2/internal/ui.(*middleware).handleAppSession-fm.(*middleware).handleAppSession.func1({0x5571d70a6fe0, 0xc0018220e0}, 0xc000fa8a20)\n\t/go/src/app/internal/ui/middleware.go:125 +0x9b4\nnet/http.HandlerFunc.ServeHTTP(0xc000fa8900?, {0x5571d70a6fe0?, 0xc0018220e0?}, 0x5571d6cda668?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\nminiflux.app/v2/internal/ui.(*middleware).handleUserSession-fm.(*middleware).handleUserSession.func1({0x5571d70a6fe0, 0xc0018220e0}, 0xc000fa8900)\n\t/go/src/app/internal/ui/middleware.go:59 +0x385\nnet/http.HandlerFunc.ServeHTTP(0xc000ea8450?, {0x5571d70a6fe0?, 0xc0018220e0?}, 0x5571d6cda678?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\nminiflux.app/v2/internal/http/server.middleware.func1({0x5571d70a6fe0, 0xc0018220e0}, 0xc000fa87e0)\n\t/go/src/app/internal/http/server/middleware.go:43 +0x351\nnet/http.HandlerFunc.ServeHTTP(0xc000fa8480?, {0x5571d70a6fe0?, 0xc0018220e0?}, 0x1?)\n\t/usr/local/go/src/net/http/server.go:2171 +0x29\ngithub.com/gorilla/mux.(*Router).ServeHTTP(0xc0002246c0, {0x5571d70a6fe0, 0xc0018220e0}, 0xc000fa8360)\n\t/go/pkg/mod/github.com/gorilla/mux@v1.8.1/mux.go:212 +0x1e2\nnet/http.serverHandler.ServeHTTP({0x5571d70a5040?}, {0x5571d70a6fe0?, 0xc0018220e0?}, 0x6?)\n\t/usr/local/go/src/net/http/server.go:3142 +0x8e\nnet/http.(*conn).serve(0xc000fb2120, {0x5571d70a8cb0, 0xc000abfdd0})\n\t/usr/local/go/src/net/http/server.go:2044 +0x5e8\ncreated by net/http.(*Server).Serve in goroutine 20\n\t/usr/local/go/src/net/http/server.go:3290 +0x4b4"
RUN_MIGRATIONS=1
DATABASE_URL=postgres://user:passward@192.168.88.10:5442?sslmode=disable
fguillot commented 4 months ago

Fix: #2742

fguillot commented 3 months ago

Fix available in v2.2.0