Skip to content

Indices trying to be created second time #2755

Closed
@petrstupka

Description

@petrstupka
  • 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 schema gitea
  • SEARCH_PATH set to '$user' for gitea user (no public in SEARCH_PATH) with command ALTER 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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions