Incus launch crashes incus daemon and fails with: websocket: close 1006 (abnormal closure): unexpected EOF [solved]

I’m trying to get incus setup for the first time. I have pretty much default settings, though I did change the default network. When I launch a new container with incus launch images:ubuntu/22.04 test I get the error message Error: Failed instance creation: websocket: close 1006 (abnormal closure): unexpected EOF and the incus daemon crashes. What is causing this and how can I fix it?

I’ve tried with a custom image too and get the same error. OS is Gentoo Linux, kernel is 6.13.5, incus version is 6.10.1.

My default profile: View paste W4QA
My network: View paste R3HQ

Can you look at the journalctl output when Incus crashes so you can fetch the actual stack trace of the crash?

I’m not using systemd, but all I see in the syslog are some messages about dnsmasq when incus starts. Nothing on the crash. I built incus with debug symbols, but I’m not sure what options I need to run incusd manually.

Okay, found default options. All I was missing was the --group incus-admin option.

Output on crash:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x561f15fc06b9]

goroutine 704 [running]:
github.com/lxc/incus/v6/internal/server/instance/drivers.(*lxc).findIdmap(0xc000badb00)
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/internal/server/instance/drivers/driver_lxc.go:491 +0x439
github.com/lxc/incus/v6/internal/server/instance/drivers.lxcCreate(_, {0x13, {0xc00189e4bc, 0x4}, 0x0, 0x0, {0xc00189e4b0, 0x7}, {0x0, 0x0}, ...}, ...)
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/internal/server/instance/drivers/driver_lxc.go:272 +0x1045
github.com/lxc/incus/v6/internal/server/instance/drivers.create(_, {0x13, {0xc00189e4bc, 0x4}, 0x0, 0x0, {0xc00189e4b0, 0x7}, {0x0, 0x0}, ...}, ...)
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/internal/server/instance/drivers/load.go:146 +0x16e
github.com/lxc/incus/v6/internal/server/instance.CreateInternal(_, {0x13, {0xc00189e4bc, 0x4}, 0x0, 0x0, {0xc00189e4b0, 0x7}, {0x0, 0x0}, ...}, ...)
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/internal/server/instance/instance_utils.go:1023 +0x1435
main.instanceCreateFromImage({_, _}, _, _, _, {0x0, {0x0, 0x0}, 0x0, 0x0, ...}, ...)
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/cmd/incusd/instance.go:161 +0x297
main.createFromImage.func1(0xc00111a280)
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/cmd/incusd/instances_post.go:139 +0x585
github.com/lxc/incus/v6/internal/server/operations.(*Operation).Start.func1(0xc00111a280)
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/internal/server/operations/operations.go:286 +0x26
created by github.com/lxc/incus/v6/internal/server/operations.(*Operation).Start in goroutine 638
        /var/tmp/portage/app-containers/incus-6.10.1/work/incus-6.10.1/internal/server/operations/operations.go:285 +0x105

I also see this output running incusd (pre-crash):

ERROR  [2025-03-12T21:37:16-07:00] Unable to parse system idmap                  err="No map found for user"                   
WARNING[2025-03-12T21:37:16-07:00] AppArmor support has been disabled because of lack of kernel support                        
WARNING[2025-03-12T21:37:16-07:00]  - AppArmor support has been disabled, Disabled because of lack of kernel support 
WARNING[2025-03-12T21:37:16-07:00]  - Couldn't find the CGroup memory swap accounting, swap limits will be ignored 

I’m not using AppArmor, but the idmap error might be related.

Yep, the idmap error is the cause of it.

Any idea how to resolve this? I haven’t touched anything with idmap.

Your system has /etc/subuid and /etc/subgid but no mapping for the root user.

You seem to be using Gentoo or a derivative, so following the install instructions for Gentoo should fix this: https://wiki.gentoo.org/wiki/Incus#Installing

Oh you’re right. Thanks, I guess I missed that when I was installing.

I pushed a fix now which will avoid the crash in the future (erroring out instead).

1 Like