jfelten / gitea-helm-chart

MIT License
76 stars 66 forks source link

Gitea failing to initialize postgres #77

Closed kevinlmadison closed 4 years ago

kevinlmadison commented 4 years ago
Server listening on :: port 22.
Server listening on 0.0.0.0 port 22.
2020/09/25 14:59:21 cmd/web.go:107:runWeb() [I] Starting Gitea on PID: 19
2020/09/25 14:59:21 ...dules/setting/git.go:93:newGit() [I] Git Version: 2.24.3, Wire Protocol Version 2 Enabled
2020/09/25 14:59:21 routers/init.go:118:GlobalInit() [T] AppPath: /app/gitea/gitea
2020/09/25 14:59:21 routers/init.go:119:GlobalInit() [T] AppWorkPath: /app/gitea
2020/09/25 14:59:21 routers/init.go:120:GlobalInit() [T] Custom path: /data/gitea
2020/09/25 14:59:21 routers/init.go:121:GlobalInit() [T] Log path: /app/gitea/log
2020/09/25 14:59:22 ...dules/setting/log.go:279:newLogService() [I] Gitea Log Mode: Console(Console:info)
2020/09/25 14:59:22 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
2020/09/25 14:59:22 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
2020/09/25 14:59:22 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
2020/09/25 14:59:22 routers/init.go:63:initDBEngine() [I] Beginning ORM engine initialization.
2020/09/25 14:59:22 routers/init.go:70:initDBEngine() [I] ORM engine initialization attempt #1/10...
2020/09/25 14:59:22 ...rm/session_schema.go:25:Ping() [I] PING DATABASE postgres
2020/09/25 14:59:22 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 [public version] - 4.145925ms
2020/09/25 14:59:22 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] CREATE TABLE IF NOT EXISTS "version" ("id" BIGSERIAL PRIMARY KEY  NOT NULL, "version" BIGINT NULL) [] - 1.302281ms
2020/09/25 14:59:22 ...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.25945ms
2020/09/25 14:59:22 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] ALTER TABLE "version" ADD "id" BIGSERIAL PRIMARY KEY  NOT NULL  [] - 2.568822ms
2020/09/25 14:59:22 routers/init.go:76:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: sync: pq: column "id" of relation "version" already exists
2020/09/25 14:59:22 routers/init.go:77:initDBEngine() [I] Backing off for 3 seconds
2020/09/25 14:59:25 routers/init.go:70:initDBEngine() [I] ORM engine initialization attempt #2/10...
2020/09/25 14:59:25 ...rm/session_schema.go:25:Ping() [I] PING DATABASE postgres
2020/09/25 14:59:25 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 [public version] - 3.877293ms
2020/09/25 14:59:25 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] CREATE TABLE IF NOT EXISTS "version" ("id" BIGSERIAL PRIMARY KEY  NOT NULL, "version" BIGINT NULL) [] - 1.279001ms
2020/09/25 14:59:25 ...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] - 7.861266ms
2020/09/25 14:59:25 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] ALTER TABLE "version" ADD "id" BIGSERIAL PRIMARY KEY  NOT NULL  [] - 2.661133ms
2020/09/25 14:59:25 routers/init.go:76:initDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: migrate: sync: pq: column "id" of relation "version" already exists
2020/09/25 14:59:25 routers/init.go:77:initDBEngine() [I] Backing off for 3 seconds

I have this set to autoinstall, so it's attempting to run gitea migrate in the background. It is creating a single table in my postgres db but nothing further than that. I've been able to successfully install gitea using the ui and connected to the same postgres db but I need this to be automatic. Any ideas? Thank you!

jfelten commented 4 years ago

Haven't done this in awhile, but it looks like it is trying to initialize and already initialized database. I would wipe it and start fresh. If that doesn't work make sure the postgres version is compatible. Otherwise see if there are similar issues or open bugs on the gitea repo.

kevinlmadison commented 4 years ago

I appreciate the input, I wasn't able to resolve that issue, hoping the folks in the gitea repo can help me solve this.