ccfos/nightingale

Error when starting with postgres

Open

#2,768 opened on Jul 4, 2025

View on GitHub
 (1 comment) (0 reactions) (1 assignee)Go (1,720 forks)github user discovery
help wanted

Repository metrics

Stars
 (13,061 stars)
PR merge metrics
 (PR metrics pending)

Description

Question and Steps to reproduce

手动创建的数据库 CREATE DATABASE nightingale OWNER nightingale; GRANT ALL PRIVILEGES ON DATABASE nightingale TO nightingale;

执行了这里的两个sql https://github.com/ccfos/nightingale/tree/main/docker/compose-postgres/initsql_for_postgres

Relevant logs and configurations

启动报错
runner.cwd: /app
runner.hostname: nightingale-64c5c98bc5-pmzx5
runner.fd_limits: (soft=1048576, hard=1048576)
runner.vm_limits: (soft=unlimited, hard=unlimited)
Database exist
2025-07-04 14:23:46.220223 ERROR ormx/ormx.go:68 /home/runner/work/nightingale/nightingale/models/migrate/migrate.go:105 ERROR: syntax error at or near "not" (SQLSTATE 42601)
[0.338ms] [rows:0] ALTER TABLE "user_token" ALTER COLUMN "username" TYPE varchar(255) not null default '' USING "username"::varchar(255) not null default ''
2025-07-04 14:23:46.220254 ERROR migrate/migrate.go:107 failed to migrate table:&{0    0 0} ERROR: syntax error at or near "not" (SQLSTATE 42601)
2025/07/04 14:23:46 target.go:664: target table is empty, skip migration.
2025-07-04 14:23:46.381657 ERROR ormx/ormx.go:68 /home/runner/work/nightingale/nightingale/models/notify_rule.go:97 failed to encode args[0]: unable to encode true into binary format for int2 (OID 21): cannot find encode plan
[0.637ms] [rows:0] SELECT count(*) as total,max(update_at) as last_updated FROM "notify_rule" WHERE enable = true
failed to sync notify rules: failed to exec NotifyRuleStatistics: failed to encode args[0]: unable to encode true into binary format for int2 (OID 21): cannot find encode plan

Version

8.0.0-beta.14

Contributor guide