Open
Description
I did not investigate how this state was achieved, but it happened in my dev environment and it seems plausible that customer could trigger it as well.
[API] 2025-06-10 14:27:13.146 [erro] coderd.workspaceapps.stats_collector: failed to flush workspace app stats ...
[API] error= report workspace app stats from backlog failed:
[API] github.com/coder/coder/v2/coderd/workspaceapps.(*StatsCollector).flush
[API] /home/coder/coder/coderd/workspaceapps/stats.go:263
[API] - insert workspace app stats failed:
[API] github.com/coder/coder/v2/coderd/workspacestats.(*Reporter).ReportAppStats
[API] /home/coder/coder/coderd/workspacestats/reporter.go:116
[API] - execute transaction:
[API] github.com/coder/coder/v2/coderd/database.(*sqlQuerier).runTx
[API] /home/coder/coder/coderd/database/db.go:213
[API] - pq: insert or update on table "workspace_app_stats" violates foreign key constraint "workspace_app_stats_agent_id_fkey"
Steps to reproduce (somewhat unknown but potentially some or all of these):
- Run workspace with devcontainer and sub agents
- Recreate devcontainer but fail to delete sub agent (inject/stop race)
- Restart workspace
- Recreate devcontainer
- Potentially observe the above in coderd logs
Metadata
Metadata
Assignees
Labels
No labels