Results 1 to 3 of 3

Thread: Duplicate entry '' for key 'username'

  1. #1
    New user
    Join Date
    06-22-09.
    Posts
    9

    Default Duplicate entry '' for key 'username'

    Hello,

    When I try to add a new backend user I get this error:

    Fatal error: Uncaught exception Exception with message Query error: Duplicate entry '' for key 'username' (INSERT INTO tl_user (language, showHelp, thumbnails, useRTE, useCE, inherit, alpty, fop, tstamp) VALUES ('sv', 1, 1, 1, 1, 'group', 'a:3:{i:0;s:7:\"regular\";i:1;s:8:\"redirect\";i:2 ;s:7:\"forward\";}', 'a:3:{i:0;s:2:\"f1\";i:1;s:2:\"f2\";i:2;s:2:\"f3\" ;}', 0)) thrown in system/modules/core/library/Contao/Database/Statement.php on line 282
    #0 system/modules/core/library/Contao/Database/Statement.php(253): Contao\Database\Statement->query()
    #1 system/modules/core/drivers/DC_Table.php(640): Contao\Database\Statement->execute()
    #2 system/modules/core/classes/Backend.php(424): Contao\DC_Table->create()
    #3 contao/main.php(129): Contao\Backend->getBackendModule('user')
    #4 contao/main.php(276): Main->run()
    #5 {main}

    What does it mean and how do I fix it?
    Thankful for all help!

  2. #2
    User
    Join Date
    07-23-10.
    Posts
    86

    Default

    Duplicate entry '' for key 'username'
    It looks like the User allready exists?! Did you try a other username? Or just put a number in the end of the Username to see if it is a duplicate name.

  3. #3
    New user cliffen's Avatar
    Join Date
    10-18-13.
    Location
    Lüneburg
    Posts
    22

    Default

    Hi,

    i can reproduce the error in a test environment.

    - I modified my DCA definion of the field 'username' in tl_user (deleted the eval-Array, so the field is not mandatory).
    - Then i added a new user with an empty username
    - Adding a second new user is impossible ... i get the same error like the one above

    So, check your database table 'tl_user' for an empty 'username' and put in a value.
    And check the dca config. Be sure 'username' is mandatory!

    Greetings, Cliff
    Extensions :: Github :: No support via PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •