Incus 6 problem importing exported LXD image

Hello, I’m playing with incus 6. I’m trying to import an exported image from LXD 4.8 I’m ending up with the following error. Anything thoughts? Importing an exported Incus image works fine.

Incus import web-apps.tar.gz web-apps
DEBUG [2025-02-19T03:01:27Z] Handling API request ip=@ method=GET protocol=unix url=/1.0 username=root
DEBUG [2025-02-19T03:01:27Z] Handling API request ip=@ method=POST protocol=unix url=/1.0/instances username=root
DEBUG [2025-02-19T03:01:27Z] Responding to instance create
Importing instance: 100% (823.29MB/s)DEBUG [2025-02-19T03:01:28Z] Reading backup file info
Error: Post “http://unix.socket/1.0/instances”: EOF
INFO [2025-02-19T03:01:29Z] http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 22749 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1947 +0xbe
panic({0x1c6e3a0?, 0x30ae230?})
/usr/local/go/src/runtime/panic.go:785 +0x132
main.createFromBackup.func4({0x230d470?, 0xc000169880?}, 0x0?)
/build/incus/cmd/incusd/instances_post.go:707 +0x57
github.com/lxc/incus/v6/internal/server/db.(*Cluster).transaction.func1.1({0x230d470?, 0xc000169880?}, 0xc000169880?)
/build/incus/internal/server/db/db.go:344 +0x45
github.com/lxc/incus/v6/internal/server/db/query.Transaction({0x230d3c8?, 0xc0008288a0?}, 0xc000728c30, 0xc0007dea60)
/build/incus/internal/server/db/query/transaction.go:29 +0x198
github.com/lxc/incus/v6/internal/server/db.(*Cluster).transaction.func1({0x230d3c8, 0xc0008288a0})
/build/incus/internal/server/db/db.go:347 +0x56
github.com/lxc/incus/v6/internal/server/db/query.Retry({0x230d3c8, 0xc0008288a0}, 0xc0007deb18)
/build/incus/internal/server/db/query/retry.go:28 +0xda
github.com/lxc/incus/v6/internal/server/db.(*Cluster).transaction(0xc0007c4400, {0x230d3c8, 0xc0008288a0}, 0xc0007deea8)
/build/incus/internal/server/db/db.go:341 +0x6f
github.com/lxc/incus/v6/internal/server/db.(*Cluster).Transaction(0x2303430?, {0x230d3c8?, 0xc0008288a0?}, 0xc000842b70?)
/build/incus/internal/server/db/db.go:305 +0xa5
main.createFromBackup(0xc000b7b100, 0xc000b10b40, {0x1f2d208, 0x7}, {0x7f50f8742008, 0xc000bc0840}, {0x0, 0x0}, {0xc000a3fb88, 0x8})
/build/incus/cmd/incusd/instances_post.go:705 +0xb97
main.instancesPost(0xc0003d6d88?, 0xc000b10b40)
/build/incus/cmd/incusd/instances_post.go:901 +0x27f
main.(*Daemon).createCmd.func1.2({0x2092b00?, 0xc000533e40?, 0x80?})
/build/incus/cmd/incusd/daemon.go:778 +0xcc
main.(*Daemon).createCmd.func1({0x23090b8, 0xc000b08620}, 0xc000b10a00)
/build/incus/cmd/incusd/daemon.go:789 +0x12d8
net/http.HandlerFunc.ServeHTTP(0xc000b108c0?, {0x23090b8?, 0xc000b08620?}, 0x1?)
/usr/local/go/src/net/http/server.go:2220 +0x29
github.com/gorilla/mux.(*Router).ServeHTTP(0xc000176900, {0x23090b8, 0xc000b08620}, 0xc000b10780)
/root/go/pkg/mod/github.com/gorilla/mux@v1.8.1/mux.go:212 +0x1e2
main.(*httpServer).ServeHTTP(0xc0006df490, {0x23090b8, 0xc000b08620}, 0xc000b10780)
/build/incus/cmd/incusd/api.go:387 +0x129
net/http.serverHandler.ServeHTTP({0x23036b0?}, {0x23090b8?, 0xc000b08620?}, 0x6?)
/usr/local/go/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc000b2bef0, {0x230d3c8, 0xc000828420})
/usr/local/go/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 123
/usr/local/go/src/net/http/server.go:3360 +0x485

Any chance you can send me that backup file or make another similarly problematic backup from a basic instance that you could share?

Sure it’s happening with any exported images. Here’s a small alpine image I’m getting the same results with. alpine.tar.gz - Google Drive

One additional note. Extracting and replacing rootfs in a working container does start.

Thanks, I’ll take a look!

Incus definitely shouldn’t be crashing, at worst, it should complain about some missing/incorrect data, so let’s see what’s going on here.

I did figure out an export from LXD 4.8 into LXD 5. Then an export from LXD 5 to Incus 6 does work as well.