Skip to main content
Question

ERROR - throwing a duplicate user key error when trying to create a new account in FME Server


Forum|alt.badge.img

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?

Did this help you find an answer to your question?

6 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • April 17, 2018

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)


Forum|alt.badge.img+2

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


Forum|alt.badge.img+2
erik_jan wrote:

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!

 


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • April 17, 2018
jlutherthomas wrote:
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

 

 


Forum|alt.badge.img
  • Author
  • May 31, 2018

 

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.

 


piertard
Contributor
Forum|alt.badge.img
  • Contributor
  • September 18, 2019
erik_jan wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings