Error 1054: Unknown column 'INFORMATION_SCHEMA.COLUMNS.ORDINAL_POSITION' in 'order clause' #5752

Closed
opened 2025-11-02 06:34:54 -06:00 by GiteaMirror · 11 comments
Owner

Originally created by @zuosc on GitHub (Jul 17, 2020).

  • Gitea version (or commit ref): gitea/gitea:latest image (sha256:be1649af755b46b7c82a03b265fd96c59678c587aa509ceb94f21556c2b87e03)
  • Git version: 2.26.2, Wire Protocol Version 2 Enabled
  • Operating system: docker
  • 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:

Description

LIKE https://github.com/go-gitea/gitea/issues/10816

when I use watchtower update gitea , it error.

2020/07/17 00:00:23 ...dules/setting/log.go:343:newLogService() [I] Gitea Log Mode: File(File:info)
2020/07/17 00:00:23 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
2020/07/17 00:00:23 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
2020/07/17 00:00:23 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
2020/07/17 00:00:23 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled
2020/07/17 00:00:23 ...es/setting/mailer.go:120:newRegisterMailService() [I] Register Mail Service Enabled
2020/07/17 00:00:23 ...es/setting/mailer.go:131:newNotifyMailService() [I] Notify Mail Service Enabled
2020/07/17 00:00:25 routers/init.go:64:initDBEngine() [I] Beginning ORM engine initialization.
2020/07/17 00:00:25 routers/init.go:71:initDBEngine() [I] ORM engine initialization attempt #1/10...
2020/07/17 00:00:25 ...rm/session_schema.go:25:Ping() [I] PING DATABASE mysql
2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `TABLE_NAME` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? and `TABLE_NAME`=? [giteadb version] - 3.189577ms
2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [giteadb version id] - 2.959628ms
2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [giteadb version version] - 2.821551ms
2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 [1] - 944.612µs
2020/07/17 00:00:25 ...ations/migrations.go:306:Migrate() [I] Migration[140]: Save detected language file size to database instead of percent
2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `TABLE_NAME`, `ENGINE`, `AUTO_INCREMENT`, `TABLE_COMMENT` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? AND (`ENGINE`='MyISAM' OR `ENGINE` = 'InnoDB' OR `ENGINE` = 'TokuDB') [giteadb] - 6.760164ms
2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `COLUMN_NAME`, `IS_NULLABLE`, `COLUMN_DEFAULT`, `COLUMN_TYPE`, `COLUMN_KEY`, `EXTRA`,`COLUMN_COMMENT` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? ORDER BY `INFORMATION_SCHEMA`.`COLUMNS`.ORDINAL_POSITION [giteadb language_stat] - 1.616564ms
2020/07/17 00:00:25 routers/init.go:77:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: do migrate: Sync2: Error 1054: Unknown column 'INFORMATION_SCHEMA.COLUMNS.ORDINAL_POSITION' in 'order clause'
2020/07/17 00:00:25 routers/init.go:78:initDBEngine() [I] Backing off for 3 seconds
Server listening on :: port 22.


Server listening on 0.0.0.0 port 22.


2020/07/17 08:12:11 cmd/web.go:107:runWeb() [I] Starting Gitea on PID: 16

2020/07/17 08:12:11 ...dules/setting/git.go:93:newGit() [I] Git Version: 2.26.2, Wire Protocol Version 2 Enabled

2020/07/17 08:12:11 routers/init.go:119:GlobalInit() [T] AppPath: /app/gitea/gitea

2020/07/17 08:12:11 routers/init.go:120:GlobalInit() [T] AppWorkPath: /app/gitea

2020/07/17 08:12:11 routers/init.go:121:GlobalInit() [T] Custom path: /data/gitea

2020/07/17 08:12:11 routers/init.go:122:GlobalInit() [T] Log path: /data/gitea/log

Received signal 15; terminating.

watchtower info:

time="2020-07-17T07:43:54Z" level=info msg="Running a one time update."
time="2020-07-17T07:43:56Z" level=info msg="Found new gitea/gitea:latest image (sha256:be1649af755b46b7c82a03b265fd96c59678c587aa509ceb94f21556c2b87e03)"
time="2020-07-17T07:43:56Z" level=info msg="Stopping /gitea (f6b0bcab9cc0843dc48fb4d85c04bc3acffbecfc0f4a0066e957a05142f38ed9) with SIGTERM"
time="2020-07-17T07:44:05Z" level=info msg="Creating /gitea"

...

Screenshots

Originally created by @zuosc on GitHub (Jul 17, 2020). - Gitea version (or commit ref): gitea/gitea:latest image (sha256:be1649af755b46b7c82a03b265fd96c59678c587aa509ceb94f21556c2b87e03) - Git version: 2.26.2, Wire Protocol Version 2 Enabled - Operating system: docker - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description LIKE https://github.com/go-gitea/gitea/issues/10816 when I use watchtower update gitea , it error. ``` 2020/07/17 00:00:23 ...dules/setting/log.go:343:newLogService() [I] Gitea Log Mode: File(File:info) 2020/07/17 00:00:23 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled 2020/07/17 00:00:23 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled 2020/07/17 00:00:23 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled 2020/07/17 00:00:23 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled 2020/07/17 00:00:23 ...es/setting/mailer.go:120:newRegisterMailService() [I] Register Mail Service Enabled 2020/07/17 00:00:23 ...es/setting/mailer.go:131:newNotifyMailService() [I] Notify Mail Service Enabled 2020/07/17 00:00:25 routers/init.go:64:initDBEngine() [I] Beginning ORM engine initialization. 2020/07/17 00:00:25 routers/init.go:71:initDBEngine() [I] ORM engine initialization attempt #1/10... 2020/07/17 00:00:25 ...rm/session_schema.go:25:Ping() [I] PING DATABASE mysql 2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `TABLE_NAME` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? and `TABLE_NAME`=? [giteadb version] - 3.189577ms 2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [giteadb version id] - 2.959628ms 2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? AND `COLUMN_NAME` = ? [giteadb version version] - 2.821551ms 2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 [1] - 944.612µs 2020/07/17 00:00:25 ...ations/migrations.go:306:Migrate() [I] Migration[140]: Save detected language file size to database instead of percent 2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `TABLE_NAME`, `ENGINE`, `AUTO_INCREMENT`, `TABLE_COMMENT` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? AND (`ENGINE`='MyISAM' OR `ENGINE` = 'InnoDB' OR `ENGINE` = 'TokuDB') [giteadb] - 6.760164ms 2020/07/17 00:00:25 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `COLUMN_NAME`, `IS_NULLABLE`, `COLUMN_DEFAULT`, `COLUMN_TYPE`, `COLUMN_KEY`, `EXTRA`,`COLUMN_COMMENT` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? ORDER BY `INFORMATION_SCHEMA`.`COLUMNS`.ORDINAL_POSITION [giteadb language_stat] - 1.616564ms 2020/07/17 00:00:25 routers/init.go:77:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: do migrate: Sync2: Error 1054: Unknown column 'INFORMATION_SCHEMA.COLUMNS.ORDINAL_POSITION' in 'order clause' 2020/07/17 00:00:25 routers/init.go:78:initDBEngine() [I] Backing off for 3 seconds ``` ``` Server listening on :: port 22. Server listening on 0.0.0.0 port 22. 2020/07/17 08:12:11 cmd/web.go:107:runWeb() [I] Starting Gitea on PID: 16 2020/07/17 08:12:11 ...dules/setting/git.go:93:newGit() [I] Git Version: 2.26.2, Wire Protocol Version 2 Enabled 2020/07/17 08:12:11 routers/init.go:119:GlobalInit() [T] AppPath: /app/gitea/gitea 2020/07/17 08:12:11 routers/init.go:120:GlobalInit() [T] AppWorkPath: /app/gitea 2020/07/17 08:12:11 routers/init.go:121:GlobalInit() [T] Custom path: /data/gitea 2020/07/17 08:12:11 routers/init.go:122:GlobalInit() [T] Log path: /data/gitea/log Received signal 15; terminating. ``` watchtower info: ``` time="2020-07-17T07:43:54Z" level=info msg="Running a one time update." time="2020-07-17T07:43:56Z" level=info msg="Found new gitea/gitea:latest image (sha256:be1649af755b46b7c82a03b265fd96c59678c587aa509ceb94f21556c2b87e03)" time="2020-07-17T07:43:56Z" level=info msg="Stopping /gitea (f6b0bcab9cc0843dc48fb4d85c04bc3acffbecfc0f4a0066e957a05142f38ed9) with SIGTERM" time="2020-07-17T07:44:05Z" level=info msg="Creating /gitea" ``` ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/upstream label 2025-11-02 06:34:55 -06:00
Author
Owner

@philippbeckmann commented on GitHub (Jul 17, 2020):

Which version of MySQL are you using?

@philippbeckmann commented on GitHub (Jul 17, 2020): Which version of MySQL are you using?
Author
Owner

@zuosc commented on GitHub (Jul 17, 2020):

@philippbeckmann 8.0.17

user docker image

Image details

ID | sha256:b8fd9553f1f06e56173db706cf47dfc64ae3a7aeb213cc0e4fc476983b62bf16 
Size | 444.7 MB
Created | 2019-09-12 12:24:43
Build | Docker 18.06.1-ce on linux, amd64

ENV

PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GOSU_VERSION | 1.7
MYSQL_MAJOR | 8.0
MYSQL_VERSION | 8.0.17-1debian9
@zuosc commented on GitHub (Jul 17, 2020): @philippbeckmann 8.0.17 user docker image Image details ``` ID | sha256:b8fd9553f1f06e56173db706cf47dfc64ae3a7aeb213cc0e4fc476983b62bf16  Size | 444.7 MB Created | 2019-09-12 12:24:43 Build | Docker 18.06.1-ce on linux, amd64 ``` ENV ``` PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOSU_VERSION | 1.7 MYSQL_MAJOR | 8.0 MYSQL_VERSION | 8.0.17-1debian9 ```
Author
Owner

@lafriks commented on GitHub (Jul 20, 2020):

Seems upstream library xorm related issue

@lafriks commented on GitHub (Jul 20, 2020): Seems upstream library xorm related issue
Author
Owner

@lunny commented on GitHub (Jul 21, 2020):

@zuosc Could you please send an issue to https://gitea.com/xorm/xorm/issues/new

@lunny commented on GitHub (Jul 21, 2020): @zuosc Could you please send an issue to https://gitea.com/xorm/xorm/issues/new
Author
Owner

@zuosc commented on GitHub (Jul 21, 2020):

@lunny HERE https://gitea.com/xorm/xorm/issues/1743

@zuosc commented on GitHub (Jul 21, 2020): @lunny HERE https://gitea.com/xorm/xorm/issues/1743
Author
Owner

@jdkendall commented on GitHub (Jul 31, 2020):

@lunny I've submitted a PR that I believe will address the issue, could you please review as you have time?

https://gitea.com/xorm/xorm/pulls/1751

I have not committed to the repo before, so I'm happy to make changes to my PR, code, etc as necessary, just let me know.

(It seems the CI pipeline tests are failing due to a TLS handshake error, I don't think that's related to my code.)

@jdkendall commented on GitHub (Jul 31, 2020): @lunny I've submitted a PR that I believe will address the issue, could you please review as you have time? https://gitea.com/xorm/xorm/pulls/1751 I have not committed to the repo before, so I'm happy to make changes to my PR, code, etc as necessary, just let me know. (It seems the CI pipeline tests are failing due to a TLS handshake error, I don't think that's related to my code.)
Author
Owner

@hasufell commented on GitHub (Aug 30, 2020):

So, how do I update? What's the last commit that is non-broken?

@hasufell commented on GitHub (Aug 30, 2020): So, how do I update? What's the last commit that is non-broken?
Author
Owner

@zeripath commented on GitHub (Aug 30, 2020):

Unfortunately the above PR https://gitea.com/xorm/xorm/pulls/1751 hasn't been merged in to xorm yet so we can't update Gitea to use it.

What version of MySQL are you using? It might be that a different version may work - it would also be helpful to help replicate the problem.

One option is to build Gitea with a patched version of xorm - ensure that it does work and then comment on the above PR to say that it works.

If you could help create a unit test that would fail without https://gitea.com/xorm/xorm/pulls/1751 that would no doubt help speed its adoption.

@zeripath commented on GitHub (Aug 30, 2020): Unfortunately the above PR https://gitea.com/xorm/xorm/pulls/1751 hasn't been merged in to xorm yet so we can't update Gitea to use it. What version of MySQL are you using? It might be that a different version may work - it would also be helpful to help replicate the problem. One option is to build Gitea with a patched version of xorm - ensure that it does work and then comment on the above PR to say that it works. If you could help create a unit test that would fail without https://gitea.com/xorm/xorm/pulls/1751 that would no doubt help speed its adoption.
Author
Owner

@hasufell commented on GitHub (Aug 31, 2020):

I'm not keen to update mysql, because that's generally a whole lot of problems.

1.12.0 works here just fine. If you have a branch that contains the fix... let me know.

I also believe this isn't about missing unit tests. This should have been caught by an integration test for sure.

@hasufell commented on GitHub (Aug 31, 2020): I'm not keen to update mysql, because that's generally a whole lot of problems. 1.12.0 works here just fine. If you have a branch that contains the fix... let me know. I also believe this isn't about missing unit tests. This should have been caught by an integration test for sure.
Author
Owner

@lunny commented on GitHub (Aug 31, 2020):

https://gitea.com/xorm/xorm/pulls/1751 has been merged.

@lunny commented on GitHub (Aug 31, 2020): https://gitea.com/xorm/xorm/pulls/1751 has been merged.
Author
Owner

@lunny commented on GitHub (Sep 3, 2020):

This should be fixed by #12694

@lunny commented on GitHub (Sep 3, 2020): This should be fixed by #12694
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5752