versity/versitygw

gateway crash with s3cmd setacl

Closed this issue · 0 comments

Describe the bug
panic when running setacl from s3cmd:

s3cmd -c ./s3cfg2.local --access_key=s3cmd -c ./s3cfg2.local --no-check-certificate setacl --acl-public s3://test-bucket

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1bdb5a7]

goroutine 48 [running]:
github.com/versity/versitygw/auth.UpdateACL(0xc00022f9e0, {{0x0, 0x0}, {0xc0000467e0, 0x14}, {0x2ffa540, 0x0, 0x0}}, {0x27ad8e0, 0x2ffa540})
	/Users/lukemccrone/devel/versitygw/auth/acl.go:140 +0x8e7
github.com/versity/versitygw/s3api/controllers.S3ApiController.PutBucketActions({{0x27b60b0, 0xc0000121e0}, {0x27ad8e0, 0x2ffa540}, {0x0, 0x0}, {0x0, 0x0}}, 0xc0003a5200)
	/Users/lukemccrone/devel/versitygw/s3api/controllers/base.go:661 +0x1ead
github.com/gofiber/fiber/v2.(*App).next(0xc0003e2a00, 0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/router.go:145 +0x527
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1030 +0x172
github.com/versity/versitygw/s3api.New.AclParser.func7(0x0?)
	/Users/lukemccrone/devel/versitygw/s3api/middlewares/acl-parser.go:59 +0xa52
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1027 +0x15d
github.com/versity/versitygw/s3api.New.VerifyMD5Body.func6(0x0?)
	/Users/lukemccrone/devel/versitygw/s3api/middlewares/md5.go:32 +0x4f2
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1027 +0x15d
github.com/versity/versitygw/s3api.New.ProcessChunkedBody.func5(0xc0003a5200)
	/Users/lukemccrone/devel/versitygw/s3api/middlewares/chunk.go:33 +0x655
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1027 +0x15d
github.com/versity/versitygw/s3api.New.VerifyV4Signature.func4(0xc0003a5200)
	/Users/lukemccrone/devel/versitygw/s3api/middlewares/authentication.go:146 +0xdff
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1027 +0x15d
github.com/versity/versitygw/s3api.New.VerifyPresignedV4Signature.func3(0xc0003a5200)
	/Users/lukemccrone/devel/versitygw/s3api/middlewares/presign-auth.go:33 +0xa5c
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1027 +0x15d
github.com/versity/versitygw/s3api.New.RequestLogger.func2(0x1?)
	/Users/lukemccrone/devel/versitygw/s3api/middlewares/logger.go:42 +0x1d1
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1027 +0x15d
github.com/versity/versitygw/s3api.New.DecodeURL.func1(0xc000231650?)
	/Users/lukemccrone/devel/versitygw/s3api/middlewares/url-decoder.go:34 +0x245
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/ctx.go:1027 +0x15d
github.com/gofiber/fiber/v2/middleware/logger.New.func3(0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/middleware/logger/logger.go:119 +0x4d2
github.com/gofiber/fiber/v2.(*App).next(0xc0003e2a00, 0xc0003a5200)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/router.go:145 +0x527
github.com/gofiber/fiber/v2.(*App).handler(0xc0003e2a00, 0x105bed5ae?)
	/Users/lukemccrone/go/pkg/mod/github.com/gofiber/fiber/v2@v2.52.1/router.go:172 +0x114
github.com/valyala/fasthttp.(*Server).serveConn(0xc0001ed440, {0x27b0058?, 0xc000178380})
	/Users/lukemccrone/go/pkg/mod/github.com/valyala/fasthttp@v1.52.0/server.go:2374 +0x1bed
github.com/valyala/fasthttp.(*workerPool).workerFunc(0xc0004500a0, 0xc00040d940)
	/Users/lukemccrone/go/pkg/mod/github.com/valyala/fasthttp@v1.52.0/workerpool.go:224 +0xe5
github.com/valyala/fasthttp.(*workerPool).getCh.func1()
	/Users/lukemccrone/go/pkg/mod/github.com/valyala/fasthttp@v1.52.0/workerpool.go:196 +0x4b
created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 7
	/Users/lukemccrone/go/pkg/mod/github.com/valyala/fasthttp@v1.52.0/workerpool.go:195 +0x355

To Reproduce

  • create bucket
  • s3cmd -c ./s3cfg2.local --access_key=s3cmd -c ./s3cfg2.local --no-check-certificate setacl --acl-public s3://test-bucket

Expected behavior
successful setacl