Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 panic on object creation #821

Closed
roman-khimov opened this issue Sep 11, 2023 · 0 comments · Fixed by #822
Closed

S3 panic on object creation #821

roman-khimov opened this issue Sep 11, 2023 · 0 comments · Fixed by #822
Assignees
Labels
bug Something isn't working
Milestone

Comments

@roman-khimov
Copy link
Member

Current Behavior

https://http.fs.neo.org/HXSaMJXk2g8C14ht8HSi7BBaiYZ1HeWh2xnWPGQCg4H6/722-1694457866/index.html#suites/b576f3ca5f4b61bb9c08457d0f3c6a57/67a2c94c8b063135/

2023-09-11T19:51:25.428Z	debug	layer/object.go:252	put object	{"reqId": "9deaa8b2-07a2-41ce-8a3b-26588f0e9116", "bucket": "86a17023-150e-4c6d-a49b-1331d0689590", "cid": "9awqoozRE4ETsiJ1uT2YBBbCJn1qiCRZZydAu4t6BwdN", "object": "cc1bd22c-24cd-431f-a9a0-3baa2232bb9e", "oid": "qQaEA5nUX1UtADHBtZp44xuhyhNiMRf8W1suDpUhC4L"}
2023-09-11T19:51:25.440Z	info	http/server.go:3215	http: panic serving 192.168.130.1:57052: runtime error: invalid memory address or nil pointer dereference
goroutine 4743 [running]:
net/http.(*conn).serve.func1()
	net/http/server.go:1854 +0xbf
panic({0xf257e0, 0x1b93fd0})
	runtime/panic.go:890 +0x263
io.copyBuffer({0x7fd5c72fad28, 0xc000112460}, {0x0, 0x0}, {0xc00975e000, 0x4000000, 0x4000000})
	io/io.go:427 +0x197
io.CopyBuffer({0x7fd5c72fad28?, 0xc000112460?}, {0x0?, 0x0?}, {0xc00975e000?, 0x0?, 0x0?})
	io/io.go:400 +0x3c
github.com/nspcc-dev/neofs-s3-gw/internal/neofs.(*NeoFS).CreateObject(0xc0016a7d10, {0x1409ee8, 0xc0009fb890}, {{0xc0006b24d0}, {0x7f, 0x8f, 0xab, 0xed, 0x8c, 0x28, ...}, ...})
	github.com/nspcc-dev/neofs-s3-gw/internal/neofs/neofs.go:281 +0x90c
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).objectPutAndHash(0xc0000ccd90, {0x1409ee8, 0xc0009fb890}, {{0xc0006b24d0}, {0x7f, 0x8f, 0xab, 0xed, 0x8c, 0x28, ...}, ...}, ...)
	github.com/nspcc-dev/neofs-s3-gw/api/layer/object.go:414 +0x168
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).putLockObject(0x1409a50?, {0x1409ee8, 0xc0009fb890}, 0xc000867480, {0xc, 0x66, 0x88, 0x63, 0xbf, 0xc7, ...}, ...)
	github.com/nspcc-dev/neofs-s3-gw/api/layer/system_object.go:129 +0x23e
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).PutLockInfo(0xc0000ccd90, {0x1409ee8, 0xc0009fb890}, 0xc000bdea98)
	github.com/nspcc-dev/neofs-s3-gw/api/layer/system_object.go:71 +0x435
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).PutObject(0xc0000ccd90, {0x1409ee8, 0xc0009fb890}, 0xc000aa6360)
	github.com/nspcc-dev/neofs-s3-gw/api/layer/object.go:275 +0x1129
github.com/nspcc-dev/neofs-s3-gw/api/handler.(*handler).PutObjectHandler(0xc0016fe150, {0x1408a90, 0xc000a85d40}, 0xc00087ba00)
	github.com/nspcc-dev/neofs-s3-gw/api/handler/put.go:249 +0x629
net/http.HandlerFunc.ServeHTTP(...)
	net/http/server.go:2122
github.com/nspcc-dev/neofs-s3-gw/api/metrics.APIStats.func1({0x1408a60?, 0xc0009fb650}, 0xc00087ba00)
	github.com/nspcc-dev/neofs-s3-gw/api/metrics/api.go:122 +0x271
net/http.HandlerFunc.ServeHTTP(...)
	net/http/server.go:2122
github.com/nspcc-dev/neofs-s3-gw/api.(*maxClients).Handle.func1({0x1408a60, 0xc0009fb650}, 0xc00087ba00)
	github.com/nspcc-dev/neofs-s3-gw/api/max_clients.go:51 +0x2f2
net/http.HandlerFunc.ServeHTTP(0xc0016fe150?, {0x1408a60?, 0xc0009fb650?}, 0xc00087ba00?)
	net/http/server.go:2122 +0x2f
github.com/nspcc-dev/neofs-s3-gw/api.appendCORS.func1.1({0x1408a60, 0xc0009fb650}, 0xc0009fc501?)
	github.com/nspcc-dev/neofs-s3-gw/api/router.go:143 +0x6e
net/http.HandlerFunc.ServeHTTP(0x1409ee8?, {0x1408a60?, 0xc0009fb650?}, 0xc0009fc580?)
	net/http/server.go:2122 +0x2f
github.com/nspcc-dev/neofs-s3-gw/api.AttachUserAuth.func1.1({0x1408a60, 0xc0009fb650}, 0xc00087b800)
	github.com/nspcc-dev/neofs-s3-gw/api/user_auth.go:53 +0x634
net/http.HandlerFunc.ServeHTTP(0x1409ee8?, {0x1408a60?, 0xc0009fb650?}, 0x10?)
	net/http/server.go:2122 +0x2f
github.com/nspcc-dev/neofs-s3-gw/api.logErrorResponse.func1.1({0x1409660?, 0xc00083aee0}, 0xc00087b800)
	github.com/nspcc-dev/neofs-s3-gw/api/router.go:155 +0x104
net/http.HandlerFunc.ServeHTTP(0x1409660?, {0x1409660?, 0xc00083aee0?}, 0x2?)
	net/http/server.go:2122 +0x2f
github.com/nspcc-dev/neofs-s3-gw/api.setRequestID.func1({0x1409660, 0xc00083aee0}, 0xc00087b600)
	github.com/nspcc-dev/neofs-s3-gw/api/router.go:135 +0x463
net/http.HandlerFunc.ServeHTTP(0xc00087b500?, {0x1409660?, 0xc00083aee0?}, 0xc000bdf9e8?)
	net/http/server.go:2122 +0x2f
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00047e780, {0x1409660, 0xc00083aee0}, 0xc00087b400)
	github.com/gorilla/[email protected]/mux.go:210 +0x1cf
net/http.serverHandler.ServeHTTP({0x1407370?}, {0x1409660, 0xc00083aee0}, 0xc00087b400)
	net/http/server.go:2936 +0x316
net/http.(*conn).serve(0xc0008afdd0, {0x1409ee8, 0xc005724990})
	net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
	net/http/server.go:3089 +0x5ed

Expected Behavior

No panic.

Steps to Reproduce

A lot of S3 tests fail this way (but some objects are created).
https://http.fs.neo.org/HXSaMJXk2g8C14ht8HSi7BBaiYZ1HeWh2xnWPGQCg4H6/722-1694457866/index.html#suites/b576f3ca5f4b61bb9c08457d0f3c6a57/67a2c94c8b063135/

@roman-khimov roman-khimov added the bug Something isn't working label Sep 11, 2023
roman-khimov added a commit that referenced this issue Sep 12, 2023
@roman-khimov roman-khimov added this to the v0.28.2 milestone Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants