Skip to content

Update from 3.10.8 to 4.10.6 fails, Settings.editable column doesn't exist in GN 4 #6054

Description

@juanluisrp

Describe the bug

Using a 3.10.8 database and trying to start GN 4.0.6-SNAPSHOT throws an error while executing the migration scripts. Error is

2021-11-23 11:52:24,642 INFO  [geonetwork.databasemigration] -          - SQL migration WEB-INF/classes/setup/sql/migrate/v3110 prefix:migrate- ...
2021-11-23 11:52:24,670 INFO  [geonetwork.databasemigration] -           Errors occurs during SQL migration file: ERROR: column "editable" of relation "settings" does not exist
  Position: 22
2021-11-23 11:52:24,670 ERROR [geonetwork.databasemigration] - ERROR: column "editable" of relation "settings" does not exist
  Position: 22
org.postgresql.util.PSQLException: ERROR: column "editable" of relation "settings" does not exist
  Position: 22
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
	at org.fao.geonet.lib.DbLib.runSQL(DbLib.java:166)
	at org.fao.geonet.lib.DbLib.insertData(DbLib.java:88)
	at org.fao.geonet.DatabaseMigration.doMigration(DatabaseMigration.java:228)
	at org.fao.geonet.DatabaseMigration.migrateDatabase(DatabaseMigration.java:148)
	at org.fao.geonet.DatabaseMigration.postProcessAfterInitialization(DatabaseMigration.java:120)

To Reproduce

Steps to reproduce the behavior:

  1. Populate a database with a dump of GN 3.10.8 database.
  2. Start GN 4.0.6-SNAPSHOT using that database

Expected behavior
The migration process should finish successfully.

Additional info
It looks like this PR (#5565) has not been added to main branch and the Settings table doesn't have an editable column in that version.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions