DHIS2 Upgrade from 2.31.5 to 2.32.2 fails with Flyway error(ERROR: Geometry has Z dimension but column does not)

@dmaritim This error typically occurs when there are coordinate values not expected by dhis2. The db column does not support z dimensions, and it looks like some of your org unit coordinate values are having those unsupported values.

You will get the same error when you try this

select ST_SetSRID(ST_GeomFromGeoJSON('{"type":"MultiPolygon", "coordinates":' || coordinates || '}'), 4326) from organisationunit
where featuretype in ('POLYGON', 'MULTI_POLYGON');

If its possible to share your organisation unit data by email, we can take a look at what the incorrect values are.
Or if you are okay with deleting all coordinate data for “POLYGON” and “MULTI_POLYGON”, that should also sort this issue out (but you will lose coordinate data for those org units)

1 Like