souin
souin copied to clipboard
invalid memory address or nil pointer dereference - v1.6.21
When caddy launches the following gets logged on boot:
caddy_1 | {"level":"error","ts":1663771439.8512652,"logger":"http.handlers.cache","msg":"Impossible to open the Nuts DB.db.buildIndexes error: when build activeDataIndex readAt err: crc error"}
And then later on
caddy_1 | panic: runtime error: invalid memory address or nil pointer dereference
caddy_1 | [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1bcf758]
caddy_1 |
caddy_1 | goroutine 114 [running]:
caddy_1 | github.com/xujiajun/nutsdb.(*Tx).getTxID(0x17200c00034e160?)
caddy_1 | github.com/xujiajun/[email protected]/tx.go:123 +0x18
caddy_1 | github.com/xujiajun/nutsdb.newTx(0x0, 0x0)
caddy_1 | github.com/xujiajun/[email protected]/tx.go:111 +0x9f
caddy_1 | github.com/xujiajun/nutsdb.(*DB).Begin(0x0, 0xb8?)
caddy_1 | github.com/xujiajun/[email protected]/tx.go:85 +0x25
caddy_1 | github.com/xujiajun/nutsdb.(*DB).managed(0xc000598ae0?, 0x1?, 0xc0000b3c08)
caddy_1 | github.com/xujiajun/[email protected]/db.go:958 +0x39
caddy_1 | github.com/xujiajun/nutsdb.(*DB).View(...)
caddy_1 | github.com/xujiajun/[email protected]/db.go:295
caddy_1 | github.com/darkweak/souin/cache/providers.(*Nuts).Prefix(0xc0000b3d98?, {0xc0001663a0?, 0xc0001e4dc0?}, 0xe?)
caddy_1 | github.com/darkweak/[email protected]/cache/providers/nutsProvider.go:138 +0x72
caddy_1 | github.com/darkweak/souin/rfc.CachedResponse({0x2665f98, 0xc000115470}, 0xc0002db900, {0xc0001663a0, 0x1d}, {0x0?, 0x0?})
caddy_1 | github.com/darkweak/[email protected]/rfc/bridge.go:23 +0x1fb
caddy_1 | github.com/darkweak/souin/plugins.DefaultSouinPluginCallback.func1(0x0?, {0x2669af0, 0xc00041d7a0}, {0xc0001663a0, 0x1d})
caddy_1 | github.com/darkweak/[email protected]/plugins/base.go:140 +0xf8
caddy_1 | created by github.com/darkweak/souin/plugins.DefaultSouinPluginCallback
caddy_1 | github.com/darkweak/[email protected]/plugins/base.go:138 +0x4e5
Caddy 2.6.0.
Im gonna be switching to redis anyway but just posting it here for visibility.
Did you reset your nuts db (remove the /path/to/nutsdb on the filesystem) after upgrade and before re-run caddy with the plugin?
You were correct that has fixed the "impossible to open nuts DB" error. The nil pointer dereference still happens.