Skip to content

S3 driver: panic: runtime error: invalid memory address or nil pointer dereference  #4411

@jkroepke

Description

@jkroepke

Description

While contributing (project-zot/zot#2532) to https://github.com/project-zot/zot and upgrading to https://github.com/distribution/distribution/releases/tag/v3.0.0-beta.1 the CI reports some panics with the S3 driver.

# panic: runtime error: invalid memory address or nil pointer dereference
# [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x55e3c9ed15a9]
#
# goroutine 89 [running]:
# github.com/distribution/distribution/v3/registry/storage/driver/s3-aws.(*driver).List(0xc002ae1200, {0x55e3cefaaa98, 0xc001bb45a0}, {0xc002ae65e0, 0x4})
# 	github.com/distribution/distribution/v3@v3.0.0-beta.1/registry/storage/driver/s3-aws/s3.go:837 +0x349
# github.com/distribution/distribution/v3/registry/storage/driver/base.(*Base).List(0xc002dffd90, {0x55e3cefaa9b8, 0x55e3d19830e0}, {0xc002ae65e0, 0x4})
# 	github.com/distribution/distribution/v3@v3.0.0-beta.1/registry/storage/driver/base/base.go:234 +0x5f1
# zotregistry.dev/zot/pkg/storage/s3.(*Driver).List(0xc000eee460?, {0xc002ae65e0?, 0xc0028aec90?})
# 	zotregistry.dev/zot/pkg/storage/s3/driver.go:83 +0x34
# zotregistry.dev/zot/pkg/storage/imagestore.(*ImageStore).GetNextRepository(0xc000eee460, {0x0, 0x0})
# 	zotregistry.dev/zot/pkg/storage/imagestore/imagestore.go:319 +0xeb
# zotregistry.dev/zot/pkg/storage/gc.(*GCTaskGenerator).Next(0xc00286ec60)
# 	zotregistry.dev/zot/pkg/storage/gc/gc.go:[783](https://github.com/project-zot/zot/actions/runs/10004288859/job/27652690776?pr=2532#step:9:784) +0x1ff
# zotregistry.dev/zot/pkg/scheduler.(*generator).generate(0xc0027c6fc0, 0xc00288a8c0)
# 	zotregistry.dev/zot/pkg/scheduler/scheduler.go:462 +0x82
# zotregistry.dev/zot/pkg/scheduler.(*Scheduler).generateTasks(0xc00288a8c0)
# 	zotregistry.dev/zot/pkg/scheduler/scheduler.go:355 +0xdd
# zotregistry.dev/zot/pkg/scheduler.(*Scheduler).getTask(0xc00288a8c0)
# 	zotregistry.dev/zot/pkg/scheduler/scheduler.go:360 +0x1c
# zotregistry.dev/zot/pkg/scheduler.(*Scheduler).RunScheduler.func1()
# 	zotregistry.dev/zot/pkg/scheduler/scheduler.go:280 +0xcc
# created by zotregistry.dev/zot/pkg/scheduler.(*Scheduler).RunScheduler in goroutine 1
# 	zotregistry.dev/zot/pkg/scheduler/scheduler.go:258 +0x18e

ref: zotregistry.dev/zot/pkg/storage/s3/driver.go:83

https://github.com/jkroepke/zot/blob/cb04d24813bfbecea4e01bd6561bd27e2c610012/pkg/storage/s3/driver.go#L83

Reproduce

No idea, but here are CI logs:

The CI

Expected behavior

No response

registry version

3.0.0-beta.1

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions