Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Duplicate entry when new user register

Hi,

I am getting this error when a new user tries to register.

Duplicate entry '14136-3' for key 'PRIMARY'|Gdn_Database|Query|insert GDN_UserRole (UserID, RoleID) values (:UserID, :RoleID)

I did a clean install of Vanilla 2.6.4 and then I switched to an old database.
MySQL 8.0.12

Any ideas?
Thanks

Comments

  • Maybe something to do with Roles. Do your new roles have the same ID's as the old roles?

  • @pdimitrov said:
    Hi,

    I am getting this error when a new user tries to register.

    Duplicate entry '14136-3' for key 'PRIMARY'|Gdn_Database|Query|insert GDN_UserRole (UserID, RoleID) values (:UserID, :RoleID)

    I did a clean install of Vanilla 2.6.4 and then I switched to an old database.
    MySQL 8.0.12

    Any ideas?
    Thanks

    some ideas are here:

    https://open.vanillaforums.com/discussion/comment/229612/#Comment_229612

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • I've noticed every time I run utility/structure I keep getting this:

    alter table GDN_AccessToken
    -- [Existing: DateInserted timestamp not null default CURRENT_TIMESTAMP, New: DateInserted timestamp not null default current_timestamp]
    change DateInserted DateInserted timestamp not null default current_timestamp,
    -- [Existing: DateExpires timestamp not null default CURRENT_TIMESTAMP, New: DateExpires timestamp not null default current_timestamp]
    change DateExpires DateExpires timestamp not null default current_timestamp;

    update GDN_User User
    set Permissions = ''
    where Permissions <> '';

    insert GDN_UserMeta
    (UserID, Name, Value)
    values ('0', 'stubcontent.record.locale', 'en');

  • R_JR_J Ex-Fanboy Munich Admin

    Don't mind those values, based on the way the structure routine works you cannot get rid of this messages (although deactivating the stub content plugin should eliminate one of them, I guess).

    I don't know how your problem first came up, but I think you will have to solve it manually. It will be easier if you do not have a lot of custom roles in your forum.
    If I were you, I would

    • do a backup of the GDN_UserRole table (or maybe even the complete database)
    • drop the table GDN_UserRole
    • run utility strucutre to rebuild the table
    • do a SQL like SELECT UserID, 8 FROM GDN_User INTO GND_UserRole (that is not the correct syntax!)
    • change the role of the admin and moderators users in that table and fix all other special roles

    But you should only do this if you feel comfortable with SQL. Otherwise you should ask someone for help.

  • It is interesting that when I check in the mysql gdn_role I do not see duplicated role IDs but when I login to the dashboard of the forum and go to roles & permissions I see duplicated roles for super moderator, administrator and registered users. The rest of the roles are single. And if I delete any of this duplicated roles it deletes both.

  • pdimitrovpdimitrov New
    edited December 2018

    I think pretty soon I can write a book about updating Vanilla on an IIS. There are no completed instructions anywhere so most of the stuff I had to figure it out. I got it to work only 2 issues left one of them with SMTP. The other is rebuilding manually the role database which is a pain because I have to reassign the roles to many users. Soon I will be posting the first and only one completed guide for updating Vanilla on IIS.

  • R_JR_J Ex-Fanboy Munich Admin

    The role table issue has happened to many users. That at least should be not IIS specific

Sign In or Register to comment.