Crash on start: Cannot drop IDX_repository_repository_id index, index was already dropped on previous restart #5909

Closed
opened 2025-11-02 06:40:01 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @blackandred on GitHub (Aug 28, 2020).

  • Gitea version (or commit ref): Release 1.12.3
  • Git version: 2.24.3
  • Operating system: Alpine (Docker)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
    • MSSQL
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2020/08/28 10:45:46 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [repository public] - 2.87067ms
2020/08/28 10:45:46 ...rm/session_schema.go:339:Sync2() [W] Table repository column id db type is SERIAL, struct type is BIGSERIAL
2020/08/28 10:45:46 ...rm/session_schema.go:360:Sync2() [W] Table repository Column original_service_type db default is 0, struct default is 
2020/08/28 10:45:46 ...rm/session_schema.go:360:Sync2() [W] Table repository Column size db default is , struct default is 0
2020/08/28 10:45:46 ...rm/session_schema.go:365:Sync2() [W] Table repository Column size db nullable is true, struct nullable is false
2020/08/28 10:45:46 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] DROP INDEX "public"."IDX_repository_repository_id" [] - 3.675591ms
2020/08/28 10:45:46 routers/init.go:135:GlobalInit() [F] ORM engine initialization failed: sync database struct error: pq: index "IDX_repository_repository_id" does not exist

Description

Each time I restart Gitea container it is attempting to drop an index that does not exists, then I add that index, restart and it works. Next restart - again it tries to drop it, but it already dropped it before...

Originally created by @blackandred on GitHub (Aug 28, 2020). - Gitea version (or commit ref): Release 1.12.3 - Git version: 2.24.3 - Operating system: Alpine (Docker) - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] SQLite - [ ] MSSQL - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ``` 2020/08/28 10:45:46 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [repository public] - 2.87067ms 2020/08/28 10:45:46 ...rm/session_schema.go:339:Sync2() [W] Table repository column id db type is SERIAL, struct type is BIGSERIAL 2020/08/28 10:45:46 ...rm/session_schema.go:360:Sync2() [W] Table repository Column original_service_type db default is 0, struct default is 2020/08/28 10:45:46 ...rm/session_schema.go:360:Sync2() [W] Table repository Column size db default is , struct default is 0 2020/08/28 10:45:46 ...rm/session_schema.go:365:Sync2() [W] Table repository Column size db nullable is true, struct nullable is false 2020/08/28 10:45:46 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] DROP INDEX "public"."IDX_repository_repository_id" [] - 3.675591ms 2020/08/28 10:45:46 routers/init.go:135:GlobalInit() [F] ORM engine initialization failed: sync database struct error: pq: index "IDX_repository_repository_id" does not exist ``` ## Description Each time I restart Gitea container it is attempting to drop an index that does not exists, then I add that index, restart and it works. Next restart - again it tries to drop it, but it already dropped it before...
GiteaMirror added the topic/repo-migrationissue/needs-feedback labels 2025-11-02 06:40:01 -06:00
Author
Owner

@blackandred commented on GitHub (Aug 28, 2020):

To get up the instance I solve it temporarily with this: CREATE INDEX "IDX_repository_repository_id" ON repository(id); but next time it would not get up.

@blackandred commented on GitHub (Aug 28, 2020): To get up the instance I solve it temporarily with this: `CREATE INDEX "IDX_repository_repository_id" ON repository(id);` but next time it would not get up.
Author
Owner

@zeripath commented on GitHub (Aug 28, 2020):

@blackandred your log snippet is too small to give us an idea of where and what is causing the DROP INDEX.

For example, presumably this happening during automatic migration? What is the last successful migration?

What is the value of your VERSION table?

In general it is also helpful to see the contents of app.ini.

@zeripath commented on GitHub (Aug 28, 2020): @blackandred your log snippet is too small to give us an idea of where and what is causing the DROP INDEX. For example, presumably this happening during automatic migration? What is the last successful migration? What is the value of your VERSION table? In general it is also helpful to see the contents of app.ini.
Author
Owner

@blackandred commented on GitHub (Aug 29, 2020):

2020/08/29 17:26:15 ...dules/setting/log.go:233:newLogService() [I] Gitea v1.12.3 built with GNU Make 4.2.1, go1.14.6 : bindata, sqlite, sqlite_unlock_notify
2020/08/29 17:26:15 ...dules/setting/log.go:279:newLogService() [I] Gitea Log Mode: File(File:info)
2020/08/29 17:26:15 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
2020/08/29 17:26:15 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
2020/08/29 17:26:15 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
2020/08/29 17:26:15 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled
2020/08/29 17:26:15 routers/init.go:63:initDBEngine() [I] Beginning ORM engine initialization.
2020/08/29 17:26:15 routers/init.go:70:initDBEngine() [I] ORM engine initialization attempt #1/10...
2020/08/29 17:26:15 ...rm/session_schema.go:25:Ping() [I] PING DATABASE postgres
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 [public version] - 2.867047ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version id] - 8.029082ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version version] - 3.214737ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "version" FROM "version" WHERE "id"=$1 LIMIT 1 [1] - 1.070953ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 [public] - 1.5132ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [user public] - 60.672138ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [user public] - 4.421751ms
2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table user column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table user Column max_repo_creation db default is '-1', struct default is -1
2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table user Column allow_create_organization db default is , struct default is true
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [public_key public] - 10.457912ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [public_key public] - 1.430424ms
2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table public_key column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [access_token public] - 9.639862ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [access_token public] - 1.556258ms
2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table access_token column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [repository public] - 49.726673ms
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [repository public] - 1.96682ms
2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table repository column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table repository Column original_service_type db default is 0, struct default is 
2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table repository Column size db default is , struct default is 0
2020/08/29 17:26:15 ...rm/session_schema.go:365:Sync2() [W] Table repository Column size db nullable is true, struct nullable is false
2020/08/29 17:26:15 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] DROP INDEX "public"."IDX_repository_repository_id" [] - 2.554176ms
2020/08/29 17:26:15 routers/init.go:76:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: sync database struct error: pq: index "IDX_repository_repository_id" does not exist
2020/08/29 17:26:15 routers/init.go:77:initDBEngine() [I] Backing off for 3 seconds
2020/08/29 17:26:18 routers/init.go:70:initDBEngine() [I] ORM engine initialization attempt #2/10...
2020/08/29 17:26:18 ...rm/session_schema.go:25:Ping() [I] PING DATABASE postgres
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 [public version] - 2.769564ms
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version id] - 8.277985ms
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version version] - 3.75282ms
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "version" FROM "version" WHERE "id"=$1 LIMIT 1 [1] - 793µs
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 [public] - 938.887µs
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [user public] - 52.342361ms
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [user public] - 2.29228ms
2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table user column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table user Column max_repo_creation db default is '-1', struct default is -1
2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table user Column allow_create_organization db default is , struct default is true
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [public_key public] - 9.257306ms
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [public_key public] - 1.394398ms
2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table public_key column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [access_token public] - 7.999499ms
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [access_token public] - 1.54166ms
2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table access_token column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length,
	    CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey,
	    CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey
	FROM pg_attribute f
	    JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid
	    LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum
	    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
	    LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey)
	    LEFT JOIN pg_class AS g ON p.confrelid = g.oid
	    LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
	WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [repository public] - 54.168861ms
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [repository public] - 2.39787ms
2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table repository column id db type is SERIAL, struct type is BIGSERIAL
2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table repository Column original_service_type db default is 0, struct default is 
2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table repository Column size db default is , struct default is 0
2020/08/29 17:26:18 ...rm/session_schema.go:365:Sync2() [W] Table repository Column size db nullable is true, struct nullable is false
2020/08/29 17:26:18 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] DROP INDEX "public"."IDX_repository_repository_id" [] - 1.60874ms
2020/08/29 17:26:18 routers/init.go:76:initDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: sync database struct error: pq: index "IDX_repository_repository_id" does not exist
2020/08/29 17:26:18 routers/init.go:77:initDBEngine() [I] Backing off for 3 seconds
@blackandred commented on GitHub (Aug 29, 2020): ```log 2020/08/29 17:26:15 ...dules/setting/log.go:233:newLogService() [I] Gitea v1.12.3 built with GNU Make 4.2.1, go1.14.6 : bindata, sqlite, sqlite_unlock_notify 2020/08/29 17:26:15 ...dules/setting/log.go:279:newLogService() [I] Gitea Log Mode: File(File:info) 2020/08/29 17:26:15 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled 2020/08/29 17:26:15 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled 2020/08/29 17:26:15 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled 2020/08/29 17:26:15 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled 2020/08/29 17:26:15 routers/init.go:63:initDBEngine() [I] Beginning ORM engine initialization. 2020/08/29 17:26:15 routers/init.go:70:initDBEngine() [I] ORM engine initialization attempt #1/10... 2020/08/29 17:26:15 ...rm/session_schema.go:25:Ping() [I] PING DATABASE postgres 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 [public version] - 2.867047ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version id] - 8.029082ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version version] - 3.214737ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "version" FROM "version" WHERE "id"=$1 LIMIT 1 [1] - 1.070953ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 [public] - 1.5132ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [user public] - 60.672138ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [user public] - 4.421751ms 2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table user column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table user Column max_repo_creation db default is '-1', struct default is -1 2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table user Column allow_create_organization db default is , struct default is true 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [public_key public] - 10.457912ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [public_key public] - 1.430424ms 2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table public_key column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [access_token public] - 9.639862ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [access_token public] - 1.556258ms 2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table access_token column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [repository public] - 49.726673ms 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [repository public] - 1.96682ms 2020/08/29 17:26:15 ...rm/session_schema.go:339:Sync2() [W] Table repository column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table repository Column original_service_type db default is 0, struct default is 2020/08/29 17:26:15 ...rm/session_schema.go:360:Sync2() [W] Table repository Column size db default is , struct default is 0 2020/08/29 17:26:15 ...rm/session_schema.go:365:Sync2() [W] Table repository Column size db nullable is true, struct nullable is false 2020/08/29 17:26:15 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] DROP INDEX "public"."IDX_repository_repository_id" [] - 2.554176ms 2020/08/29 17:26:15 routers/init.go:76:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: sync database struct error: pq: index "IDX_repository_repository_id" does not exist 2020/08/29 17:26:15 routers/init.go:77:initDBEngine() [I] Backing off for 3 seconds 2020/08/29 17:26:18 routers/init.go:70:initDBEngine() [I] ORM engine initialization attempt #2/10... 2020/08/29 17:26:18 ...rm/session_schema.go:25:Ping() [I] PING DATABASE postgres 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 [public version] - 2.769564ms 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version id] - 8.277985ms 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = $1 AND table_name = $2 AND column_name = $3 [public version version] - 3.75282ms 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "version" FROM "version" WHERE "id"=$1 LIMIT 1 [1] - 793µs 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 [public] - 938.887µs 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [user public] - 52.342361ms 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [user public] - 2.29228ms 2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table user column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table user Column max_repo_creation db default is '-1', struct default is -1 2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table user Column allow_create_organization db default is , struct default is true 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [public_key public] - 9.257306ms 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [public_key public] - 1.394398ms 2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table public_key column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [access_token public] - 7.999499ms 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [access_token public] - 1.54166ms 2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table access_token column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT column_name, column_default, is_nullable, data_type, character_maximum_length, CASE WHEN p.contype = 'p' THEN true ELSE false END AS primarykey, CASE WHEN p.contype = 'u' THEN true ELSE false END AS uniquekey FROM pg_attribute f JOIN pg_class c ON c.oid = f.attrelid JOIN pg_type t ON t.oid = f.atttypid LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = f.attnum LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_constraint p ON p.conrelid = c.oid AND f.attnum = ANY (p.conkey) LEFT JOIN pg_class AS g ON p.confrelid = g.oid LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1AND s.table_schema = $2 AND f.attnum > 0 ORDER BY f.attnum; [repository public] - 54.168861ms 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1 AND schemaname=$2 [repository public] - 2.39787ms 2020/08/29 17:26:18 ...rm/session_schema.go:339:Sync2() [W] Table repository column id db type is SERIAL, struct type is BIGSERIAL 2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table repository Column original_service_type db default is 0, struct default is 2020/08/29 17:26:18 ...rm/session_schema.go:360:Sync2() [W] Table repository Column size db default is , struct default is 0 2020/08/29 17:26:18 ...rm/session_schema.go:365:Sync2() [W] Table repository Column size db nullable is true, struct nullable is false 2020/08/29 17:26:18 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] DROP INDEX "public"."IDX_repository_repository_id" [] - 1.60874ms 2020/08/29 17:26:18 routers/init.go:76:initDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: sync database struct error: pq: index "IDX_repository_repository_id" does not exist 2020/08/29 17:26:18 routers/init.go:77:initDBEngine() [I] Backing off for 3 seconds ```
Author
Owner

@blackandred commented on GitHub (Aug 29, 2020):

Last migration:

# SELECT * FROM version;
 id | version 
----+---------
  1 |     141
(1 row)
@blackandred commented on GitHub (Aug 29, 2020): Last migration: ``` # SELECT * FROM version; id | version ----+--------- 1 | 141 (1 row) ```
Author
Owner

@stale[bot] commented on GitHub (Nov 9, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Nov 9, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@zeripath commented on GitHub (Nov 9, 2020):

Sorry about this I must have missed your reply. Did you ever work out what the problem was?
What version of postgres are you using?
Is this fixed on Master?

@zeripath commented on GitHub (Nov 9, 2020): Sorry about this I must have missed your reply. Did you ever work out what the problem was? What version of postgres are you using? Is this fixed on Master?
Author
Owner

@zeripath commented on GitHub (Jun 21, 2021):

I think this is now very out of date and very stale and the issues have been fixed in 1.13.5. Please reopen if they are still a problem.

@zeripath commented on GitHub (Jun 21, 2021): I think this is now very out of date and very stale and the issues have been fixed in 1.13.5. Please reopen if they are still a problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5909