Gitea Version
NOT NULL constraint failed: action_run.concurrency_group
What happened?
Description
When triggering a workflow (e.g. issues event) on Gitea 1.27.1/1.27.2 with SQLite, the workflow is detected and matched correctly, but the run is never inserted into the database. The action_run table remains empty, and the following error is logged: [E] repo owner/repo.git: PrepareRunAndInsert: InsertRun: constraint failed: NOT NULL constraint failed: action_run.concurrency_group (1299)
Root Cause
The action_run table defines concurrency_group as NOT NULL without a DEFAULT value. In services/actions/run.go, db.Insert(ctx, run) is called before the concurrency configuration is parsed and concurrency_group is populated (lines 73-88). At insert time, the field is still NULL/empty, so SQLite rejects the insert. Adding a concurrency: block in the workflow YAML does not work around this, because the concurrency evaluation happens after the initial insert.
Comparison with other tables
| Table |
Field |
Constraint |
Has DEFAULT? |
action_run |
concurrency_group |
NOT NULL |
❌ No |
Database SQLite3
How to reproduce
- Create a workflow triggered by
issues event (or any event): yaml name: Issue Notify on: issues: types: [opened, edited, closed, reopened] jobs: notify: runs-on: ubuntu-latest steps: - run: echo "triggered"
- Edit an issue
- Check
act_run table — it's empty
- Check Gitea logs —
NOT NULL constraint failed: action_run.concurrency_group (1299)
Expected behavior
The run should be inserted into action_run successfully, even when no concurrency: block is specified in the workflow YAML.
Suggested fix
Add DEFAULT '' to the concurrency_group column in action_run, consistent with the other two tables. Either:
- Fix the xorm tag / migration to include
NOT NULL DEFAULT '' (matching action_run_attempt and action_run_job)
- Or remove the
NOT NULL constraint entirely
Workaround
Drop the empty action_run table and restart Gitea — xorm will recreate it. However, this only works if the table has no data. For tables with existing data, a proper migration is needed.
How are you running Gitea?
No response
Gitea Version
NOT NULL constraint failed: action_run.concurrency_group
What happened?
Description
When triggering a workflow (e.g.
issuesevent) on Gitea 1.27.1/1.27.2 with SQLite, the workflow is detected and matched correctly, but the run is never inserted into the database. Theaction_runtable remains empty, and the following error is logged:[E] repo owner/repo.git: PrepareRunAndInsert: InsertRun: constraint failed: NOT NULL constraint failed: action_run.concurrency_group (1299)Root Cause
The
action_runtable definesconcurrency_groupasNOT NULLwithout a DEFAULT value. Inservices/actions/run.go,db.Insert(ctx, run)is called before the concurrency configuration is parsed andconcurrency_groupis populated (lines 73-88). At insert time, the field is still NULL/empty, so SQLite rejects the insert. Adding aconcurrency:block in the workflow YAML does not work around this, because the concurrency evaluation happens after the initial insert.Comparison with other tables
action_runconcurrency_groupDatabase SQLite3
How to reproduce
issuesevent (or any event):yaml name: Issue Notify on: issues: types: [opened, edited, closed, reopened] jobs: notify: runs-on: ubuntu-latest steps: - run: echo "triggered"act_runtable — it's emptyNOT NULL constraint failed: action_run.concurrency_group (1299)Expected behavior
The run should be inserted into
action_runsuccessfully, even when noconcurrency:block is specified in the workflow YAML.Suggested fix
Add
DEFAULT ''to theconcurrency_groupcolumn inaction_run, consistent with the other two tables. Either:NOT NULL DEFAULT ''(matchingaction_run_attemptandaction_run_job)NOT NULLconstraint entirelyWorkaround
Drop the empty
action_runtable and restart Gitea — xorm will recreate it. However, this only works if the table has no data. For tables with existing data, a proper migration is needed.How are you running Gitea?
No response