Skip to content

Settings Service crashes during HTTP server initialization with a Go runtime panic in chi route registration #2686

@PerryCodekies

Description

@PerryCodekies

Describe the bug

The container crashed at 6:10am which was my sleeping time, and I am not sure about the cause. I pasted the error logs to 2 different AIs, and both of them suggested the following:

The settings service crashes during HTTP server initialization. The stack trace shows the failure in internal/runtime/maps.fatal and internal/runtime/maps.(*Iter).Next, then in github.com/go-chi/chi/v5.(*node).setEndpoint, (*node).InsertRoute, (*Mux).handle, (*Mux).Mount, and (*Mux).Route, before reaching github.com/opencloud-eu/opencloud/services/settings/pkg/server/http.Server at server.go:78.

Observed behavior

The service terminates with a fatal panic instead of starting normally. The crash happened around 6:10am my timezone.

Expected behavior

The HTTP server should initialize successfully and continue running.

Stack trace excerpt

Details

goroutine 576 [running]:
internal/runtime/maps.fatal({0x55da94145d90?, 0x55da91576e85?})
runtime/panic.go:1181 +0x18
internal/runtime/maps.(*Iter).Next(0x3208b045cc01?)
internal/runtime/maps/table.go:819 +0x86
github.com/go-chi/chi/v5.(*node).setEndpoint(0x3208afb72e60, 0x3ff, {0x55da97f31140, 0x3208b01ff120}, {0x3208b09b044e, 0x2})
github.com/go-chi/chi/v5@v5.2.5/tree.go:359 +0x449
github.com/go-chi/chi/v5.(*node).InsertRoute(0x3208b1e3d3c0?, 0x3ff, {0x3208b09b044e, 0x2}, {0x55da97f31140, 0x3208b01ff120})
github.com/go-chi/chi/v5@v5.2.5/tree.go:174 +0x3c5
github.com/go-chi/chi/v5.(*Mux).handle(0x3208b1ab8120, 0x3ff, {0x3208b09b044e, 0x2}, {0x55da97f31140, 0x3208b01ff120})
github.com/go-chi/chi/v5@v5.2.5/mux.go:436 +0x269
github.com/go-chi/chi/v5.(*Mux).Mount(0x3208b1ab8120, {0x55da953afa20, 0x1}, {0x55da97f36a60, 0x3208b1ab81e0})
github.com/go-chi/chi/v5@v5.2.5/mux.go:335 +0x385
github.com/go-chi/chi/v5.(*Mux).Route(0x3208b1ab8120, {0x55da953afa20, 0x1}, 0x3208b045d570)
github.com/go-chi/chi/v5@v5.2.5/mux.go:278 +0xff
github.com/opencloud-eu/opencloud/services/settings/pkg/server/http.Server({0x3208b045dbb8, 0x7, 0x0?})
github.com/opencloud-eu/opencloud/services/settings/pkg/server/http/server.go:78 +0x13cd
github.com/opencloud-eu/opencloud/services/settings/pkg/command.Server.func2(0x3208b043c608, {0x55da93fd50fd?, 0x4?, 0x55da93fd4f95?})
github.com/opencloud-eu/opencloud/services/settings/pkg/command/server.go:61 +0x83f
github.com/spf13/cobra.(*Command).execute(0x3208b043c608, {0x55da985dc560, 0x0, 0x0})
github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb14
github.com/spf13/cobra.(*Command).ExecuteC(0x3208b043c308)
github.com/spf13/cobra@v1.10.2/command.go:1148 +0x465
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.10.2/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/cobra@v1.10.2/command.go:1064
github.com/opencloud-eu/opencloud/services/settings/pkg/command.Execute(0x3208b196dd48)
github.com/opencloud-eu/opencloud/services/settings/pkg/command/root.go:35 +0x128
github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/service.NewService.func19({0x55da97f5b290?, 0x3208affd5810?}, 0x0?)
github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/service/service.go:224 +0x7c
github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/service.NewService.NewService.func1.NewSutureServiceBuilder.func63.1({0x55da97f5b290?, 0x3208affd5810?})
github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/service/sutureservice.go:21 +0x25
github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/service.SutureService.Serve(...)
github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/service/sutureservice.go:30
github.com/thejerf/suture/v4.(*Supervisor).runService.func2()
github.com/thejerf/suture/v4@v4.0.6/supervisor.go:570 +0xd4
created by github.com/thejerf/suture/v4.(*Supervisor).runService in goroutine 98
github.com/thejerf/suture/v4@v4.0.6/supervisor.go:544 +0x189

Notes

I do not have exact reproduction steps. It crashed during my sleeping time. Also, I have been experiencing multiple crashes, which frozen my whole unRAID, making it unresponsive, and ultimately forced me to do a force restart of the server. This is the first time the container crashes itself without crashing my whole unRAID server.

Setup

I use unRAID 7.2.4, and setup OpenCloud as one of the Docker containers.

Start-up command:

Details

docker run
  -d
  --name='opencloud'
  --net='bridge'
  --pids-limit 2048
  -e TZ="Asia/SomeWhere"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="myUNRAIDSERVER"
  -e HOST_CONTAINERNAME="opencloud"
  -e 'OC_URL'='https://cloud.mydomain.com'
  -e 'IDM_ADMIN_PASSWORD'='somestrongpassword'
  -e 'OC_INSECURE'='false'
  -e 'OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD'='false'
  -e 'PROXY_TLS'='false'
  -e 'PROXY_ENABLE_BASIC_AUTH'='false'
  -e 'NOTIFICATIONS_SMTP_SENDER'='OpenCloud'
  -e 'NOTIFICATIONS_SMTP_USERNAME'='some@gmail.com'
  -e 'NOTIFICATIONS_SMTP_HOST'='smtp.gmail.com'
  -e 'NOTIFICATIONS_SMTP_PORT'='587'
  -e 'NOTIFICATIONS_SMTP_PASSWORD'='somepassword'
  -e 'NOTIFICATIONS_SMTP_ENCRYPTION'='starttls'
  -e 'COLLABORA_DOMAIN'=''
  -e 'ONLYOFFICE_DOMAIN'=''
  -e 'START_ADDITIONAL_SERVICES'='"notifications"'
  -e 'PROXY_ENABLE_APP_AUTH'='false'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:9200]'
  -l net.unraid.docker.icon='https://avatars.githubusercontent.com/u/188916550?s=200&v=4'
  -p '9200:9200/tcp'
  -v '/mnt/user/appdata/opencloud/config':'/etc/opencloud':'rw'
  -v '/mnt/user/opencloud/data':'/var/lib/opencloud':'rw'
  --user 99:100
  --memory=8g
  --entrypoint /bin/sh 'opencloudeu/opencloud-rolling:latest'
  -c "opencloud init || true; opencloud server"

WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
f2ca2bae5dde853934f81dada5480819495896375ec60316c415092e82bc3954

Start Up Logs:

Details

2026/04/27 17:43:07 Could not create config: config file already exists, use --force-overwrite to overwrite or --diff to show diff
{"level":"error","error":"error connecting to nats cluster opencloud-cluster: error connecting to nats at 127.0.0.1:9233 with tls enabled (false): nats: no servers available for connection","time":"2026-04-27T17:43:08Z","caller":"github.com/cenkalti/backoff@v2.2.1+incompatible/retry.go:24","message":"can't connect to nats (jetstream) server, retrying in 1.212528625s"}
{"level":"error","error":"error connecting to nats cluster opencloud-cluster: error connecting to nats at 127.0.0.1:9233 with tls enabled (false): nats: no servers available for connection","time":"2026-04-27T17:43:10Z","caller":"github.com/cenkalti/backoff@v2.2.1+incompatible/retry.go:24","message":"can't connect to nats (jetstream) server, retrying in 2.993594913s"}
{"level":"error","error":"error connecting to nats cluster opencloud-cluster: error connecting to nats at 127.0.0.1:9233 with tls enabled (false): nats: no servers available for connection","time":"2026-04-27T17:43:13Z","caller":"github.com/cenkalti/backoff@v2.2.1+incompatible/retry.go:24","message":"can't connect to nats (jetstream) server, retrying in 6.851978312s"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Qualification

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions