Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

panic on staging: runtime error: slice bounds out of range [:-1] #77

Closed
lidel opened this issue Apr 6, 2023 · 0 comments · Fixed by ipfs/boxo#272 or #79
Closed

panic on staging: runtime error: slice bounds out of range [:-1] #77

lidel opened this issue Apr 6, 2023 · 0 comments · Fixed by ipfs/boxo#272 or #79
Assignees
Labels
bug Something isn't working

Comments

@lidel
Copy link
Collaborator

lidel commented Apr 6, 2023

Happened twice, around boxo/gateway/blocks_gateway.gogetPathRootspathRoots[:len(pathRoots)-1]

2023/04/05 21:20:56 Starting bifrost-gateway 2023-04-05-d8d2849
...
2023-04-06T02:07:08.766Z	ERROR	core/server	gateway/handler.go:315	A panic occurred in the gateway handler!
2023-04-06T02:07:08.766Z	ERROR	core/server	gateway/handler.go:316	runtime error: slice bounds out of range [:-1]
...
2023-04-06T02:07:08.799Z	ERROR	core/server	gateway/handler.go:315	A panic occurred in the gateway handler!
2023-04-06T02:07:08.800Z	ERROR	core/server	gateway/handler.go:316	runtime error: slice bounds out of range [:-1]
goroutine 8209872 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
	/usr/local/go/src/runtime/debug/stack.go:16 +0x19
github.com/ipfs/boxo/gateway.panicHandler({0x123d680, 0xc1cb717680})
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/handler.go:317 +0xfc
panic({0xdfa960, 0xc148178b40})
	/usr/local/go/src/runtime/panic.go:884 +0x213
github.com/ipfs/boxo/gateway.(*BlocksGateway).getPathRoots(0x0?, {0x123da38, 0xc1afb4d890}, {{0x123dc68?, 0xc247a56a10?}})
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/blocks_gateway.go:325 +0x5c6
github.com/ipfs/boxo/gateway.(*BlocksGateway).getNode(0xc204cf1e00, {0x123da38, 0xc1afb4d890}, {{0x123dc68?, 0xc247a56a10?}})
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/blocks_gateway.go:261 +0x6b
github.com/ipfs/boxo/gateway.(*BlocksGateway).Get(0xc204cf1e00, {0x123da38, 0xc1afb4d890}, {{0x123dc68?, 0xc247a56a10?}}, {0xd09fe0?, 0x1231950?, 0xe1ede0?})
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/blocks_gateway.go:143 +0x7a
github.com/ipfs/bifrost-gateway/lib.(*GraphGateway).Get(0xc000184d80, {0x123da38, 0xc1afb4d890}, {{0x123dc68?, 0xc247a56a10?}}, {0xc247a56ad0, 0x1, 0x1})
	/go/src/github.com/ipfs/bifrost-gateway/lib/graph_gateway.go:366 +0x5e5
github.com/ipfs/boxo/gateway.(*ipfsBackendWithMetrics).Get(0xc000129a28, {0x123da38, 0xc1afb4d860}, {{0x123dc68?, 0xc247a56a10?}}, {0xc247a56ad0, 0x1, 0x1})
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/metrics.go:69 +0x4b7
github.com/ipfs/boxo/gateway.(*handler).serveDefaults(0xc00087ecc0, {0x123da38, 0xc1afb4d3b0}, {0x123d680, 0xc1cb717680}, 0xc013ae50b0, {{0x123dc68?, 0xc247a56a10?}}, {{0x123dc68, 0xc247a56a10}}, ...)
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/handler_defaults.go:68 +0x469
github.com/ipfs/boxo/gateway.(*handler).getOrHeadHandler(0xc00087ecc0, {0x123d680, 0xc1cb717680}, 0xc013ae52d0)
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/handler.go:281 +0xc34
github.com/ipfs/boxo/gateway.(*handler).ServeHTTP(0xc00087ecc0, {0x123d680, 0xc1cb717680}, 0xc1824ad500)
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/handler.go:163 +0x234
net/http.(*ServeMux).ServeHTTP(0xc013ae5480?, {0x123d680, 0xc1cb717680}, 0xc1824ad500)
	/usr/local/go/src/net/http/server.go:2500 +0x149
main.withConnect.func1({0x123d680?, 0xc1cb717680?}, 0xc0e2e1be20?)
	/go/src/github.com/ipfs/bifrost-gateway/handlers.go:57 +0x73
net/http.HandlerFunc.ServeHTTP(0x123da38?, {0x123d680?, 0xc1cb717680?}, 0xc000184d80?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
github.com/ipfs/boxo/gateway.WithHostname.func1({0x123d680, 0xc1cb717680}, 0xc1824ad500)
	/go/pkg/mod/github.com/ipfs/boxo@v0.8.1-0.20230405204336-6e1d7a4d43f7/gateway/hostname.go:241 +0x4e2
net/http.HandlerFunc.ServeHTTP(0x0?, {0x123d680?, 0xc1cb717680?}, 0x0?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
github.com/mitchellh/go-server-timing.Middleware.func1({0x7fc9001d18e0, 0xc1cb717590}, 0xc1824ad400)
	/go/pkg/mod/github.com/mitchellh/go-server-timing@v1.0.1/middleware.go:74 +0x32b
net/http.HandlerFunc.ServeHTTP(0x123c810?, {0x7fc9001d18e0?, 0xc1cb717590?}, 0xdd95a0?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerResponseSize.func1({0x123c810?, 0xc11958e1c0?}, 0xc1824ad400)
	/go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/promhttp/instrument_server.go:288 +0xc5
net/http.HandlerFunc.ServeHTTP(0xc042f88a58?, {0x123c810?, 0xc11958e1c0?}, 0xc0000e04e0?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
main.withRequestLogger.func1({0x123c810, 0xc11958e1c0}, 0xc1824ad400)
	/go/src/github.com/ipfs/bifrost-gateway/handlers.go:65 +0x171
net/http.HandlerFunc.ServeHTTP(0x0?, {0x123c810?, 0xc11958e1c0?}, 0x46f24e?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
net/http.serverHandler.ServeHTTP({0xc1afb4c8a0?}, {0x123c810, 0xc11958e1c0}, 0xc1824ad400)
	/usr/local/go/src/net/http/server.go:2936 +0x316
net/http.(*conn).serve(0xc173373200, {0x123da38, 0xc000a1c150})
	/usr/local/go/src/net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3089 +0x5ed
@lidel lidel added the bug Something isn't working label Apr 6, 2023
@hacdias hacdias self-assigned this Apr 6, 2023
lidel added a commit that referenced this issue Apr 6, 2023
lidel added a commit that referenced this issue Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
2 participants