Ad Widget

Collapse

Unable to create users ( duplicate key error)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Almas_92
    Junior Member
    • Sep 2022
    • 3

    #1

    Unable to create users ( duplicate key error)

    I am trying to create new user and get this error. I dont know why zabbix is creating user with id ''22'', when it should be 38
    • Error in query [INSERT INTO users (alias,name,surname,url,autologin,autologout,theme ,refresh,rows_per_page,lang,type,passwd,userid) VALUES ('test_zabbix','test','test','','0','0','default', '30s','50','en_GB','1','$2y$10$6W0BCW.xdJenJG8uDUR ouedgsrcSeU1KCC2KBWosWQm//fV6p.mwy','22')] [Duplicate entry '22' for key 'PRIMARY']
    Click image for larger version

Name:	изображение.png
Views:	602
Size:	34.0 KB
ID:	451991
  • Almas_92
    Junior Member
    • Sep 2022
    • 3

    #2
    This error pops up in the web interface. I can create users manually in SQL, but this is not solution. Any help would be appreciated.

    Comment

    • LouieH
      Junior Member
      • Dec 2022
      • 1

      #3
      Just encountered this error. We worked around it by deleting and recreating all of the IDs including and after the offending ID#. Obviously not the nicest strategy, but it worked.

      For example: Deleted ID 4, recreated ID 4. Then the error would show ID 5. Deleted ID 5, recreated ID 5... and so on...

      Comment


      • Almas_92
        Almas_92 commented
        Editing a comment
        Well we found this solution too, but the case is there are bindings to dashboards that are crusial to prod. So some users cant be deleted without deleting dashboard.
    • matsnlc
      Junior Member
      • Feb 2023
      • 4

      #4
      Hi,
      New to Zabbix and ran into this issue on an installation. Solved it by manually updating the table "ids". For some reason the value in column "nextid" was wrong for users so I did a manual update. My next free id was 7, so I executed this:
      UPDATE ids SET nextid=6 WHERE table_name = 'users';

      This solved it for me.

      Comment

      Working...