Skip to content

gitlab-exporter panics on GitLab <17 #3

@ankobyshev

Description

@ankobyshev

gitlab-exporter panics on GitLab <17 because Project.updatedAt is queried but not present in GraphQL schema.

GitLab 16.11 ProjectType has createdAt/lastActivityAt but no updatedAt.
Exporter logs gqlerror and then panics with nil pointer dereference.

Expected:

  • fail cleanly without panic
  • document minimum GitLab version, or
  • support fallback for GitLab 16.x

Log:

time=2026-05-15T07:45:07.425Z level=DEBUG msg="[CATCHUP] Processing projects..." iteration=1 after=2026-05-14T07:45:07Z before=2026-05-15T07:45:07Z
time=2026-05-15T07:45:07.500Z level=ERROR msg=gqlerror query=getProjects ids=[gid://gitlab/Project/225] error[0].path="fragment ProjectFieldsCore.updatedAt" error[0].message="Field 'updatedAt' doesn't exist on type 'Project'"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xac099a]

goroutine 7 [running]:
go.cluttr.dev/gitlab-exporter/exporter/internal/gitlab/graphql.(*Client).ListProjects(0xc000393d40, {0xffbf20, 0xc000397400}, {0xc00041c110, 0x1, 0x1}, 0xc00059c0f0, 0xc00059c108, 0xc0002b9600)
	/builds/gitlab-exporter/gitlab-exporter/exporter/internal/gitlab/graphql/projects.go:101 +0x1da
go.cluttr.dev/gitlab-exporter/exporter/internal/gitlab/graphql.(*Client).GetProjects(0x0?, {0xffbf20?, 0xc000397400?}, {0xc00041c110?, 0x0?, 0x0?}, 0x20?, 0x0?)
	/builds/gitlab-exporter/gitlab-exporter/exporter/internal/gitlab/graphql/projects.go:138 +0x59
go.cluttr.dev/gitlab-exporter/exporter/internal/tasks.(*Controller).getUpdatedProjects(0xc000428000, {0xffbf20, 0xc000397400}, {0xc0003a4200, 0x1, 0x1?}, 0xc00059c0f0, 0xc00059c108, 0x1)
	/builds/gitlab-exporter/gitlab-exporter/exporter/internal/tasks/controller.go:509 +0x245
go.cluttr.dev/gitlab-exporter/exporter/internal/tasks.(*Controller).process(0xc000428000, {0xffbf20, 0xc000397400}, {0xc0003a4200?, 0xafb93d?, 0xc0004280a8?}, 0xc00059c0f0, 0xc00059c108, 0x0?)
	/builds/gitlab-exporter/gitlab-exporter/exporter/internal/tasks/controller.go:417 +0x88
go.cluttr.dev/gitlab-exporter/exporter/internal/tasks.(*Controller).CatchUp.func2()
	/builds/gitlab-exporter/gitlab-exporter/exporter/internal/tasks/controller.go:395 +0xb4
created by go.cluttr.dev/gitlab-exporter/exporter/internal/tasks.(*Controller).CatchUp in goroutine 6
	/builds/gitlab-exporter/gitlab-exporter/exporter/internal/tasks/controller.go:392 +0x4d3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions