Hi, I am trying to upgrade from version 6.1 to 6.2 using a custom war file and I am getting a lot of sql exceptions from asadmin deploy dataverse.war and in server.log I found the following messages, the last one is about a sql file for db migration that seems to be missing:
I checked the war file with the following command and the sql file is there. Any ideas for the cause of this problem and how I can solve it?
jar tf dataverse.war | grep "db/migration/V6.1.0.4__5645-geospatial-fieldname-fix.sql"
WEB-INF/classes/db/migration/V6.1.0.4__5645-geospatial-fieldname-fix.sql
Hmm...
Caused by: org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V6.1.0.4__5645-geospatial-fieldname-fix.sql failed
------------------------------------------------------------
SQL State : 23505
Error Code : 0
Message : ERROR: duplicate key value violates unique constraint "datasetfieldtype_name_key"
Detail: Key (name)=(northLatitude) already exists.
Location : db/migration/V6.1.0.4__5645-geospatial-fieldname-fix.sql (/usr/local/payara6/glassfish/domains/domain1/applications/dataverse/WEB-INF/classes/db/migration/V6.1.0.4__5645-geospatial-fieldname-fix.sql)
Line : 1
Statement : UPDATE datasetfieldtype
SET name = 'northLatitude'
WHERE name = 'northLongitude'
#5645 was fixed by @Juan Pablo Tosca Villanueva in PR #10306 in 6.2.
And yes, that PR is where src/main/resources/db/migration/V6.1.0.3__5645-geospatial-fieldname-fix.sql comes from. (The version got bumped to .4 in #10346.)
This is all the script is doing...
UPDATE datasetfieldtype
SET name = 'northLatitude'
WHERE name = 'northLongitude';
UPDATE datasetfieldtype
SET name = 'southLatitude'
WHERE name = 'southLongitude';
I'm not sure why this result in the error you're seeing: Message : ERROR: duplicate key value violates unique constraint "datasetfieldtype_name_key" Detail: Key (name)=(northLatitude) already exists.
@César Ferreira does "northLatitude" already exist in your pre-6.2 database?
Yes, I already have these fields, maybe it is because I already updated the metadata blocks from the tsv files?
If you applied the new TSVs to an instance running an older version, that would make things break, yes.
The easiest way to go around this is probably to edit your database before you restart Dataverse and remove any such failing entries.
Thank you, that fixed the problem.
César Ferreira has marked this topic as resolved.
Last updated: Oct 30 2025 at 06:21 UTC