Skip to content

ORM engine initialization failed: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'. #16483

Closed
@rodinmehr

Description

@rodinmehr
  • Gitea version (or commit ref): gitea-1.14.4-windows-4.0-amd64
  • Git version: 2.32.0
  • Operating system: Windows
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
2021/07/19 13:22:43 routers/init.go:68:initDBEngine() [I] Beginning ORM engine initialization.
2021/07/19 13:22:43 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #1/10...
2021/07/19 13:22:43 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE  mssql
2021/07/19 13:22:43 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:22:43 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:22:46 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #2/10...
2021/07/19 13:22:46 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:22:46 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:22:46 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:22:49 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #3/10...
2021/07/19 13:22:49 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:22:49 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:22:49 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:22:52 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #4/10...
2021/07/19 13:22:52 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:22:52 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:22:52 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:22:55 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #5/10...
2021/07/19 13:22:55 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:22:55 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:22:55 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:22:58 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #6/10...
2021/07/19 13:22:58 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:22:59 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:22:59 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:23:02 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #7/10...
2021/07/19 13:23:02 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:23:02 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:23:02 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:23:05 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #8/10...
2021/07/19 13:23:05 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:23:05 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:23:05 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:23:08 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #9/10...
2021/07/19 13:23:08 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:23:08 routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #9/10 failed. Error: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.
2021/07/19 13:23:08 routers/init.go:82:initDBEngine() [I] Backing off for 3 seconds
2021/07/19 13:23:11 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #10/10...
2021/07/19 13:23:11 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql
2021/07/19 13:23:11 routers/init.go:157:GlobalInit() [F] ORM engine initialization failed: sync database struct error: mssql: Invalid object name 'SYS.INDEXES'.

SQL Server V18.5

Description

After Gitea setup, when I want to run it, I get the previously mentioned errors.
I checked the created database (gitea) but I couldn't find a table called 'dbo.sys' in it (I can see all of the other tables including 'dbo.project', 'dbo.user', etc). I'm not sure where I should look for this 'sys.indexes' column. Is there any suggestion? How can I fix this problem?

P.S: There is another issue like this as well with no solution. issues-6201

Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions