souin: 404 causes invalid memory address or nil pointer dereference - NutsDB - Souin 1.6.22

Fetching a resource that doesnt exists ‘missing.js’ causes a complete crash of caddy / souin on the latest tag

caddy_1                | {"level":"debug","ts":1665914150.4616704,"logger":"http.handlers.cache","msg":"Incoming request: &{Method:GET URL:/missing.js Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Accept:[*/*] Accept-Encoding:[gzip] Accept-Language:[en-US,en;q=0.9] Cache-Control:[max-age=0] Connection:[keep-alive] Date:[Sun, 16 Oct 2022 09:55:50 UTC] Proxy-Connection:[keep-alive] Referer:[http://localhost/missing.js] Sec-Fetch-Dest:[serviceworker] Sec-Fetch-Mode:[same-origin] Sec-Fetch-Site:[same-origin] Service-Worker:[script] User-Agent:[Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36]] Body:{} GetBody:<nil> ContentLength:0 TransferEncoding:[] Close:false Host:localhost Form:map[] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:172.18.0.1:46930 RequestURI:/missing.js TLS:<nil> Cancel:<nil> Response:<nil> ctx:0xc003f4c630}"}
caddy_1                | panic: runtime error: invalid memory address or nil pointer dereference
caddy_1                | [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1be7418]
caddy_1                | 
caddy_1                | goroutine 917 [running]:
caddy_1                | github.com/xujiajun/nutsdb.(*Tx).getTxID(0x1200c000714160?)
caddy_1                |        github.com/xujiajun/nutsdb@v0.9.0/tx.go:123 +0x18
caddy_1                | github.com/xujiajun/nutsdb.newTx(0x0, 0x0)
caddy_1                |        github.com/xujiajun/nutsdb@v0.9.0/tx.go:111 +0x9f
caddy_1                | github.com/xujiajun/nutsdb.(*DB).Begin(0x0, 0xd8?)
caddy_1                |        github.com/xujiajun/nutsdb@v0.9.0/tx.go:85 +0x25
caddy_1                | github.com/xujiajun/nutsdb.(*DB).managed(0xc003f4c720?, 0x1?, 0xc0002f7bf8)
caddy_1                |        github.com/xujiajun/nutsdb@v0.9.0/db.go:958 +0x39
caddy_1                | github.com/xujiajun/nutsdb.(*DB).View(...)
caddy_1                |        github.com/xujiajun/nutsdb@v0.9.0/db.go:295
caddy_1                | github.com/darkweak/souin/cache/providers.(*Nuts).Prefix(0xc0002f7d88?, {0xc0002ac378?, 0xc0041840d0?}, 0xe?)
caddy_1                |        github.com/darkweak/souin@v1.6.22/cache/providers/nutsProvider.go:143 +0x72
caddy_1                | github.com/darkweak/souin/rfc.CachedResponse({0x268c8f8, 0xc00084a630}, 0xc004262900, {0xc0002ac378, 0x14}, {0xc0079e9e40?, 0x4d9565?})
caddy_1                |        github.com/darkweak/souin@v1.6.22/rfc/bridge.go:24 +0x1fb
caddy_1                | github.com/darkweak/souin/plugins.DefaultSouinPluginCallback.func1(0x70?, {0x26904b0, 0xc0009ee000}, {0xc0002ac378, 0x14})
caddy_1                |        github.com/darkweak/souin@v1.6.22/plugins/base.go:145 +0xf8
caddy_1                | created by github.com/darkweak/souin/plugins.DefaultSouinPluginCallback
caddy_1                |        github.com/darkweak/souin@v1.6.22/plugins/base.go:143 +0x4e5

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

Can you retry with the latest release @mattvb91? 🙏