Skip to content

v56 migration fails on 1.9 (potential issue with "dropTableColumns" operation) #7694

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

Closed
2 of 7 tasks
netvl opened this issue Aug 1, 2019 · 5 comments · Fixed by #7710
Closed
2 of 7 tasks

v56 migration fails on 1.9 (potential issue with "dropTableColumns" operation) #7694

netvl opened this issue Aug 1, 2019 · 5 comments · Fixed by #7710
Labels

Comments

@netvl
Copy link

netvl commented Aug 1, 2019

Description

Upgrading from a very old gitea version (unfortunately, I lost the exact version number) to the latest version (1.9.0 as of now) fails with the following error:

2019/08/01 00:24:50 routers/init.go:86:GlobalInit() [F] ORM engine initialization failed: migrate: do migrate: incomplete input

It seems that this is caused by an attempt to execute an incomplete SQL query:

2019/08/01 00:24:50 .../xorm/session_raw.go:226:Exec() [I] [SQL] CREATE TABLE `new_org_user_new` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `uid` INTEGER NULL, `org_id` INTEGER NULL, `is_public` INTEGER NULL,

which happens in this migration: https://github.com/go-gitea/gitea/blob/master/models/migrations/v56.go.

I may be wrong, but it seems to me that this behavior is caused by this PR: #6849.

When I used an older version (1.8.3) in my docker setup, it got upgraded perfectly (and now I guess I can try upgrading to 1.9).

@lunny lunny added the type/bug label Aug 1, 2019
@lunny
Copy link
Member

lunny commented Aug 1, 2019

So it works when you upgrade from your old version to 1.8.3 and then to 1.9.0 ?

@netvl
Copy link
Author

netvl commented Aug 1, 2019

Yes, I've just checked that. 1.9.0 runs just fine now.

@zeripath
Copy link
Contributor

zeripath commented Aug 1, 2019

Damn.

I think there must be an error in the drop tables regexp.

How this is missed in our migration tests I'm not sure.

What version of Gitea did you have?

@lafriks
Copy link
Member

lafriks commented Aug 1, 2019

@zeripath I think it is create table regexp not drop

@zeripath
Copy link
Contributor

zeripath commented Aug 1, 2019

OK so I've been able to replicate it by going back to version 1.3.3!

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants