Syncthing: panic: nil pointer dereference because (*db.Lowlevel)getMetaAndCheck() returns nil

Created on 25 Sep 2020  路  1Comment  路  Source: syncthing/syncthing

I have just noticed a panic log from ~1 week ago in my Syncthing home folder. I do not remember what might have caused the panic though, and Syncthing probably automatically recovered after that, so I had no idea until now. The operating system logs also do not show anything special taking place at that time.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x104a217]

goroutine 56 [running]:
github.com/syncthing/syncthing/lib/db.(*metadataTracker).devices(0x0, 0x0, 0x0, 0x0)
    github.com/syncthing/syncthing/lib/db/meta.go:407 +0x47
github.com/syncthing/syncthing/lib/db.(*FileSet).ListDevices(...)
    github.com/syncthing/syncthing/lib/db/set.go:433
github.com/syncthing/syncthing/lib/model.(*model).addAndStartFolderLockedWithIgnores(0x129000d0, 0x12c01ca0, 0xb, 0x12c01cb8, 0x8, 0x0, 0x12c01cd0, 0xb, 0x2, 0x12a46a80, ...)
    github.com/syncthing/syncthing/lib/model/model.go:311 +0x1ee
github.com/syncthing/syncthing/lib/model.(*model).addAndStartFolderLocked(0x129000d0, 0x12c01ca0, 0xb, 0x12c01cb8, 0x8, 0x0, 0x12c01cd0, 0xb, 0x2, 0x12a46a80, ...)
    github.com/syncthing/syncthing/lib/model/model.go:286 +0x12e
github.com/syncthing/syncthing/lib/model.(*model).newFolder(0x129000d0, 0x12c01ca0, 0xb, 0x12c01cb8, 0x8, 0x0, 0x12c01cd0, 0xb, 0x2, 0x12a46a80, ...)
    github.com/syncthing/syncthing/lib/model/model.go:515 +0x217
github.com/syncthing/syncthing/lib/model.(*model).onServe(0x129000d0)
    github.com/syncthing/syncthing/lib/model/model.go:252 +0x151
github.com/syncthing/syncthing/lib/model.(*model).Serve(0x129000d0)
    github.com/syncthing/syncthing/lib/model/model.go:235 +0x21
github.com/thejerf/suture.(*Supervisor).runService.func1(0x128d2460, 0x1, 0x334e6cc0, 0x129000d0)
    github.com/thejerf/[email protected]+incompatible/supervisor.go:600 +0x69
created by github.com/thejerf/suture.(*Supervisor).runService
    github.com/thejerf/[email protected]+incompatible/supervisor.go:588 +0x4b

Syncthing version was v1.10.0-rc.2.

bug

Most helpful comment

Yeah this can apparently happen because we can return a nil metadata object when there are database issues. Needs better error handling.

>All comments

Yeah this can apparently happen because we can return a nil metadata object when there are database issues. Needs better error handling.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trymeouteh picture trymeouteh  路  4Comments

as-com picture as-com  路  3Comments

itsbrianburton picture itsbrianburton  路  4Comments

norgeous picture norgeous  路  3Comments

gabriel-fallen picture gabriel-fallen  路  4Comments