Skip to content

panic: interface conversion: error is auth.Error, not *auth.Error #4960

@sashasimkin

Description

@sashasimkin

Which version are you using?

1.14.0

Which operating system are you using?

Linux amd64 Docker

Describe how to replicate the issue

  1. start the server
  2. I'm actually not sure what is happening, but noticed that this is usually a second failure, and I don't have logs for the first one :( I.e. mediamtx crashes once, then on the subsequent reboot I see this error, and then next reboot is fine
  3. This is happening for both authMethod=internal and http

I assume that this is the line that should be changed to (auth.Error), but I'm yet to test it on my deployments:

httpp.RemoteAddr(ctx), err.(*auth.Error).Message) //nolint:errorlint

Server logs

$ cat mediamtx.log | head -50
2025/09/10 08:37:53 INF MediaMTX v1.14.0
2025/09/10 08:37:53 INF configuration loaded from /config/mediamtx.yml
2025/09/10 08:37:53 INF [metrics] listener opened on :9998
2025/09/10 08:37:53 INF [playback] listener opened on :9996
2025/09/10 08:37:53 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2025/09/10 08:37:53 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)
2025/09/10 08:37:53 INF [SRT] listener opened on :8890 (UDP)
2025/09/10 08:37:53 INF [API] listener opened on :9997
panic: interface conversion: error is auth.Error, not *auth.Error

goroutine 21 [running]:
github.com/bluenviron/mediamtx/internal/protocols/httpp.(*handlerExitOnPanic).ServeHTTP.func1()
/s/internal/protocols/httpp/handler_exit_on_panic.go:21 +0x5e
panic({0xf1db40?, 0xc000511bc0?})
/usr/local/go/src/runtime/panic.go:792 +0x132
github.com/bluenviron/mediamtx/internal/playback.(*Server).doAuth(0xc0003e80b0, 0xc0000ac700, {0xc0006340cf, 0x5})
/s/internal/playback/server.go:133 +0x3d0
github.com/bluenviron/mediamtx/internal/playback.(*Server).onList(0xc0003e80b0, 0xc0000ac700)
/s/internal/playback/on_list.go:138 +0x6d
github.com/gin-gonic/gin.(*Context).Next(...)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0004941a0, 0xc0000ac700)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:644 +0x872
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0004941a0, {0x120d918, 0xc00004f180}, 0xc000238140)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:600 +0x1aa
github.com/bluenviron/mediamtx/internal/protocols/httpp.(*handlerFilterRequests).ServeHTTP(0x6?, {0x120d918?, 0xc00004f180?}, 0xc00052fa01?)
/s/internal/protocols/httpp/handler_filter_requests.go:17 +0x4e
github.com/bluenviron/mediamtx/internal/protocols/httpp.(*handlerFilterRequests).ServeHTTP(0xfe9740?, {0x120d918?, 0xc00004f180?}, 0x6?)
/s/internal/protocols/httpp/handler_filter_requests.go:17 +0x4e
github.com/bluenviron/mediamtx/internal/protocols/httpp.(*handlerServerHeader).ServeHTTP(0xc0004a60d0, {0x120d918, 0xc00004f180}, 0xc000238140)
/s/internal/protocols/httpp/handler_server_header.go:14 +0xe5
github.com/bluenviron/mediamtx/internal/protocols/httpp.(*handlerLogger).ServeHTTP(0xc000455d80, {0x120d678, 0xc0000b20e0}, 0xc000238140)
/s/internal/protocols/httpp/handler_logger.go:58 +0x178
github.com/bluenviron/mediamtx/internal/protocols/httpp.(*handlerExitOnPanic).ServeHTTP(0x475939?, {0x120d678?, 0xc0000b20e0?}, 0xc00052fb70?)
/s/internal/protocols/httpp/handler_exit_on_panic.go:26 +0x42
net/http.serverHandler.ServeHTTP({0xc00018b3b0?}, {0x120d678?, 0xc0000b20e0?}, 0x1?)
/usr/local/go/src/net/http/server.go:3301 +0x8e
net/http.(*conn).serve(0xc0001e25a0, {0x120ef10, 0xc000510210})
/usr/local/go/src/net/http/server.go:2102 +0x625
created by net/http.(*Server).Serve in goroutine 36
/usr/local/go/src/net/http/server.go:3454 +0x485

...

There's more stuff going on, but I don't think it's relevant

Network dump

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions