Skip to content

Conversation

@petkostas
Copy link
Contributor

@petkostas petkostas commented Oct 22, 2025

Summary

After upgrading from v1.0.2-beta8 to v1.0.3-beta7, DevLake instances crash on startup with the following error:

│ [GIN-debug] Listening and serving HTTP on :8080                                                      │
│ panic: sql: Scan error on column index 0, name "priority": converting NULL to int is unsupported (50 │
│ Wraps: (2) sql: Scan error on column index 0, name "priority"                                        │
│ Wraps: (3) converting NULL to int is unsupported                                                     │
│ Error types: (1) *hintdetail.withDetail (2) *fmt.wrapError (3) *errors.errorString                   │
│                                                                                                      │
│ goroutine 116 [running]:                                                                             │
│ github.com/apache/incubator-devlake/server/services.dequeuePipeline({0x2c8cb78, 0x0, 0x0})           │
│     /app/server/services/pipeline.go:270 +0x10d3                                                     │
│ github.com/apache/incubator-devlake/server/services.RunPipelineInQueue(0x1)                          │
│     /app/server/services/pipeline.go:335 +0x42c                                                      │
│ created by github.com/apache/incubator-devlake/server/services.pipelineServiceInit                   │
│     /app/server/services/pipeline.go:112 +0x23d

This occurs in dequeuePipeline() when attempting to query the priority column.
The migration script 20250813_add_pipeline_priority.go adds the priority column to existing tables but doesn't set default values for existing rows, leaving them as NULL.
When the pipeline service queries these NULL values into Go's int type (which is not nullable), it causes a panic.

Does this close any open issues?

Closes #8621

@petkostas petkostas self-assigned this Oct 22, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. component/framework This issue or PR relates to the framework pr-type/bug-fix This PR fixes a bug priority/high This issue is very important severity/p0 This bug blocks key user journey and function labels Oct 22, 2025
- The newly introduced priority field is set to NULL by default, which
causes pre-existing pipelines to crash devlake when starting after a
version upgrade.
@petkostas petkostas force-pushed the fix/issue-8621-fix-null-priority branch from ddd154f to a5e659d Compare October 23, 2025 07:29
Copy link
Contributor

@klesh klesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the issue.

@klesh klesh merged commit 5425d9e into main Oct 24, 2025
10 checks passed
@klesh klesh deleted the fix/issue-8621-fix-null-priority branch October 24, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/framework This issue or PR relates to the framework pr-type/bug-fix This PR fixes a bug priority/high This issue is very important severity/p0 This bug blocks key user journey and function size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][pipeline] Devlake instance crashes on pipelineServiceInit after image update

2 participants