Question

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

  • 17 April 2018
  • 6 replies
  • 35 views

Badge

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?


6 replies

Userlevel 2
Badge +16

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)

Badge +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

Badge +2

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!

 

Userlevel 2
Badge +16
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

 

 

Badge

 

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.

 

Badge

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