4.2: Database migration seems to fail for non-empty database - Column "X21.ALLOW_WIKI_EDITING" not found
See original GitHub issueI’ve upgraded from 4.1 to 4.2 and now I’m getting this error:
org.h2.jdbc.JdbcSQLException: Column "X21.ALLOW_WIKI_EDITING" not found; SQL statement:
CREATE FORCE VIEW PUBLIC._1 AS
SELECT
X21.UPDATED_DATE AS X22,
X21.ALLOW_WIKI_EDITING AS X23,
X21.EXTERNAL_ISSUES_URL AS X24,
X21.PARENT_REPOSITORY_NAME AS X25,
X21.EXTERNAL_WIKI_URL AS X26,
X21.DEFAULT_BRANCH AS X27,
X21.DESCRIPTION AS X28,
X21.ORIGIN_REPOSITORY_NAME AS X29,
X21.ORIGIN_USER_NAME AS X30,
X21.PARENT_USER_NAME AS X31,
X21.PRIVATE AS X32,
X21.REPOSITORY_NAME AS X33,
X21.USER_NAME AS X34,
X21.ENABLE_WIKI AS X35,
X21.ENABLE_ISSUES AS X36,
X21.REGISTERED_DATE AS X37,
X21.LAST_ACTIVITY_DATE AS X38
FROM PUBLIC.REPOSITORY X21 [42122-192]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:147)
at org.h2.expression.Alias.optimize(Alias.java:51)
at org.h2.command.dml.Select.prepare(Select.java:852)
...
I’ve double-checked using empty databases, i.e.:
rm -rf ~/.gitbucket
git checkout 4.1
./sbt.sh package
./sbt.sh executable
java -jar target/executable/gitbucket.war
./sbt.sh clean; rm -rf target; git clean -f
git checkout 4.2
./sbt.sh package
./sbt.sh executable
java -jar target/executable/gitbucket.war
For these, it works without an issue. So the migration seems to fail only when the database actually contains data.
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Second Prisma migrate run (with no interim schema changes ...
Bug description After introspecting a MySQL database and running an initial migration, and then making no changes of any kind to the schema ......
Read more >Database migration fails after installing the recently released ...
The database migration fails and our instance is now essentially broken, so we are humbly asking for some know-how about how to unbrick...
Read more >Caused by: org.flywaydb.core.api.FlywayException: Validate ...
I simply migrate database from H2 DB to MYSQL. Then I simply updated the V2__create_shipwreck.sql. Please guide how I can solve it. I...
Read more >Help with db:migrate - seems to be missing tables/columns
Hi,. I'm trying to put redmine 3.0.3 on a new linux server (Red Hat Enterprise Linux Server release 6.6, with Linux 2.6.32-279.11.1.el6.x86_64).
Read more >Migration troubleshooting in development - Prisma
This guide describes how to resolve issues with Prisma Migrate in a development environment, which often involves resetting your database.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is the complete work-around. With this, I’m able to login:
/console/login.jsp
to the urlHere the commands for the h2 console:
Just tried upgrading from 4.0.0 to 4.3 and also got this error. Seems the fix in 4.2.1 does not work in this scenario. I followed the instructions from the gitbucket README (that is, I just replaced the gitbucket.war). Is there an additional step required during upgrade for this scenario, or is there some bug in the procedure?
The workaround from this comment worked for me; but I had to add
to the executed statements (to avoid getting an error as described here: https://github.com/gitbucket/gitbucket/issues/1255).
Is there anything I need to look out for now? Everything seems to work fine; in VERSIONS table I see that gitbucket-core has been upgraded to 4.3.0.