Skip to main content
Question

OGC Geopackage Writer and UNIQUE constraint failed

  • August 27, 2020
  • 6 replies
  • 472 views

joe.fme
Contributor
Forum|alt.badge.img+6

Hello dear Community,

Despite having a Sorter, DulicateFilter and Tester right out of the gate in my model, I still seem to be experiencing this issue on the ID field of my model -

 

OGCGEOPACKAGE writer: failed to execute insert : UNIQUE constraint failed

 

If I run it one at a time, it seems to work, but I'm trying to write to make different Geopackages, with 4 tables in each (with spatial data).

 

I've been racking my brain about this for some time, changing writers from manual to automatic, deleting any output data after each test run to ensure it's not conflicting, making sure there's no duplicates in the ID field that would trip up the writers, but to no avail - and wondered if anyone here may have a lifeline to throw me.

Thank you

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

david_r
Celebrity
  • August 27, 2020

It is possible that the GeometryValidator is the culprit, if there are errors that lead to decomposed/split geometries.

Try moving the DuplicateFilters after the GeometryValidator.


joe.fme
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • August 28, 2020

Hi David, still no luck with this setup unfortunately


jelle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • October 30, 2020

Hi Joe,

I have a similar issue. (How) were you able to solve it?


jelle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • October 30, 2020

Hi Joe and others looking for this problem,

 

I think I found the solution. By default, the Primary Index Column is 'id'. If your data contains an attribute id, it gets mixed up. Creating an attribute id_gpkg for example bypasses the problem. I hope this helps.

 

id_gpkg  

 


arnovananrooij
Contributor
Forum|alt.badge.img+5

Hi Joe and others looking for this problem,

 

I think I found the solution. By default, the Primary Index Column is 'id'. If your data contains an attribute id, it gets mixed up. Creating an attribute id_gpkg for example bypasses the problem. I hope this helps.

 

id_gpkg  

 

Hi Jelle, thank for this solution. I also ran into this problem. Apparently id is not allowed as an attribute name.


kavyajeetbora
Participant
Forum|alt.badge.img+1

It is possible that the GeometryValidator is the culprit, if there are errors that lead to decomposed/split geometries.

Try moving the DuplicateFilters after the GeometryValidator.

For me this worked, I used a deaggregator (flattened at all levels) → Geometry Extractor → DuplicateFilter to remove all the duplicate geometries.