Description
- Gitea version (or commit ref):
1.2.1-linux-amd64
- Git version:
2.8.4
- Operating system:
Centos 7 (7.4.1708)
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- Not relevant
- Log gist: gitea.log
Description
Database setup:
- Postgresql database (version 9.6)
- database instance
appsdb
- user
gitea
, created schemagitea
SEARCH_PATH
set to'$user'
forgitea
user (no public inSEARCH_PATH
) with commandALTER ROLE gitea SET search_path TO "$user";
Problem 1: After filling install form, tables were created, but instalation fails with log message
[...itea/routers/init.go:56 GlobalInit()] [E] Failed to initialize ORM engine: sync database struct error: pq: > relation "UQE_user_lower_name" already exists
When I manually deleted all database tables, gitea
started without problem (tables were recreated). I had to manually add user (gitea admin create-user
) and then I was able to login.
Problem 2: After steps from section above, I've stopped gitea
. The, attemt to start gitea web
again failed with the same error as during instalation ('... relation "UQE_user_lower_name" already exists...'
).
I've tried to drop index, but the same problem occured with another index. After several iterations I've dropped all indices (except primary keys); then gitea web
started and recreated all deleted indices.
However, to drop all indices before each start is not usable.
Possibly relevant info
I've found several links which seems to provide some relevant information:
- Fail to initialize ORM engine (Postgresql) - attempting to create indexes that exist? gogs/gogs#3359
- Tables/Indexes trying to be recreated when not using the 'public' PostgreSQL schema go-xorm/xorm#436
- PostgreSQL schema go-xorm/xorm#361
- Changing SEARCH_PATH in Postgres does not work intermittently go-xorm/xorm#379
Activity