Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 6 tasks
rodinmehr opened this issue Jul 19, 2021 · 5 comments · Fixed by #16627
Closed
2 of 6 tasks
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@rodinmehr
Copy link

rodinmehr commented Jul 19, 2021

  • 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

@lunny
Copy link
Member

lunny commented Jul 19, 2021

Could you check if your database user has enough permission to read that table?

@rodinmehr
Copy link
Author

I logged in as an admin user to SQL Server but I can't find any table called "dbo.sys". Generally speaking, database user for Gitea has full permission to change the 'gitea' database (and it has created a lot of tables in it). But I can't find this 'sys.indexes' anywhere!

@zeripath
Copy link
Contributor

@radinmehr What version of SQL Server are you running? It appears you're running a very old version?

@zeripath zeripath added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jul 29, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants