Gitea: v56 migration fails on 1.9 (potential issue with "dropTableColumns" operation)

Created on 1 Aug 2019  路  5Comments  路  Source: go-gitea/gitea

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: https://github.com/go-gitea/gitea/pull/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).

kinbug

Most helpful comment

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

All 5 comments

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

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

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?

@zeripath I think it is create table regexp not drop

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

flozz picture flozz  路  3Comments

thehowl picture thehowl  路  3Comments

kolargol picture kolargol  路  3Comments

BRMateus2 picture BRMateus2  路  3Comments

jonasfranz picture jonasfranz  路  3Comments