Skip to content

flake: enterprise/coderd TestAIBridgeListInterceptions/Pagination (pq ParseTimestamp divide by zero) #1301

@flake-investigator

Description

@flake-investigator

CI Run: https://github.com/coder/coder/actions/runs/21400143176
Failing job: https://github.com/coder/coder/actions/runs/21400143176/job/61608694202 (test-go-race-pg)

Commit under test:

Failure signature:

  • enterprise/coderd/aibridge_test.go:284 (subtest TestAIBridgeListInterceptions/Pagination/offset)
    • Error: GET http://127.0.0.1:42895/api/v2/aibridge/interceptions?limit=1&offset=6&q=: returned unexpected 500: "An internal server error occurred."

Panic evidence (root cause):

  • Server logged a recovered panic during the failing request:
    • coderd: panic serving http request (recovered) panic="runtime error: integer divide by zero"
    • stack includes:
      • github.com/lib/pq.ParseTimestamp ... /github.com/coder/pq@v1.10.5-0.20250807075151-6ad9b0a25151/encode.go:430
      • github.com/coder/coder/v2/coderd/database.(*sqlQuerier).GetAPIKeyByID ... coderd/database/queries.sql.go:1194
      • github.com/coder/coder/v2/coderd/httpmw.APIKeyFromRequest ... coderd/httpmw/apikey.go:174

Notes:

  • This is a functional server-side panic leading to a 500 (not a Go race detector finding). I scanned the full job log and did not see WARNING: DATA RACE.
  • The panic is inside our github.com/coder/pq fork while decoding a timestamp; likely an invalid timestamp value being returned/decoded for an API key row during request auth.

Ownership / assignment rationale:

  • Recent substantive changes to the failing test/component are in enterprise/coderd/aibridge_test.go (e.g. commit 78bc586 "add soft warning for AI Bridge GA transition"), so assigning to @kacpersaw to triage.

Suggested reproduction:

  • go test ./enterprise/coderd -run 'TestAIBridgeListInterceptions/Pagination/offset' -race -count=50

Related:

  • Another independent failure in this run: cli TestSSH/StdioExitOnParentDeath (tracked separately in internal#1289).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions