Skip to main content

FME Server throws this error when I try to create a new user account:


Error: org.postgresql.util.PSQLException:
ERROR: duplicate key value violates unique constraint
"fme_useraccount_pkey" Detail: Key (useraccount_id)=(#) already
exists.

where "#" increments after every attempt. It seems to be getting hung up on this user account id every time I try to create a new user. There is no such user already created. Background: we recently migrated FME Server to a new hosting environment and the issue only appeared after the migration.

version: FME Server 2016.1.2.1 - Build 16674 - win64

Any idea what could be going wrong here?

Looks like you migrated to a new database, with a new sequence for generating ID's for the user accounts.

But the existing (and most likely migrated) user accounts had used the same ID values.

If that is the case, you have 2 options:

1) change the sequence in Postgres (only if you are knowing what to do in the SQL database, and probably Safe Support can help here).

2) create as many "dummy" users and errors until you get to the number that was not yet used (equal to the number of migrated users). Then the issue will have solved itself.

(I would go for option 1 and ask Safe for support: safe.com/support or use the live chat on this page)


Hi @lbohy

Did you create a new database when you installed the new FME Server? If this happened after migration ensure you're connected to a new database created and configured for that version of FME Server


Looks like you migrated to a new database, with a new sequence for generating ID's for the user accounts.

But the existing (and most likely migrated) user accounts had used the same ID values.

If that is the case, you have 2 options:

1) change the sequence in Postgres (only if you are knowing what to do in the SQL database, and probably Safe Support can help here).

2) create as many "dummy" users and errors until you get to the number that was not yet used (equal to the number of migrated users). Then the issue will have solved itself.

(I would go for option 1 and ask Safe for support: safe.com/support or use the live chat on this page)

Hi Eric,

 

When you reference safe support, can you please send then to safe.com/support over support@safe.com

 

 

Thanks!

 


Hi Eric,

 

When you reference safe support, can you please send then to safe.com/support over support@safe.com

 

 

Thanks!

 

Hi Jen,

 

Done.

 

Erik

 

 


 

RESOLVED: Thanks for the help. There must've been a hiccup in the migration where the seed was reset to 0. With guidance from Laura Wu, Safe Support, we ran:

 

 

SELECT
setval('public.fme_useraccount_useraccount_id_seq', n)

 

where 'n' is the next seed number above our existing user count.

 

 

We ran into a similar problem with our roles sequence, but that was easily fixed in the exact same manner.

 

 

Thanks.

 


Looks like you migrated to a new database, with a new sequence for generating ID's for the user accounts.

But the existing (and most likely migrated) user accounts had used the same ID values.

If that is the case, you have 2 options:

1) change the sequence in Postgres (only if you are knowing what to do in the SQL database, and probably Safe Support can help here).

2) create as many "dummy" users and errors until you get to the number that was not yet used (equal to the number of migrated users). Then the issue will have solved itself.

(I would go for option 1 and ask Safe for support: safe.com/support or use the live chat on this page)

I used option 2 and created dummy user. It works


Reply