For reasons I can't understand, I am unable to create users in my Drupal installation (which wasn't a problem last time I tried).
If I try in the UI (at /admin/people/create
) or if I try with drush user-create
, in both cases the error message I get reads like:
WD rules: Unable to modify data "account:field-user-image:alt": Invalid data value given.
↪ Be sure it matches [warning] the required data type and format.
WD rules: Unable to evaluate action data_set.
WD user: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate
↪ entry '187810' for key[error] 'PRIMARY': INSERT INTO {users} (uid, name, pass, mail,
↪ created, access, status, data) VALUES (:db_insert_placeholder_0,
↪ :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3,
↪ :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6,
↪ :db_insert_placeholder_7);
Array
(
[:db_insert_placeholder_0] => 187810
[:db_insert_placeholder_1] => [email protected]
[:db_insert_placeholder_2] => $S$XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXX
[:db_insert_placeholder_3] => [email protected]
[:db_insert_placeholder_4] => 1329491489
[:db_insert_placeholder_5] => 0
[:db_insert_placeholder_6] => 1
[:db_insert_placeholder_7] => a:1:{s:34:"user_relationships_ui_auto_approve";a:0:{}}
)
in drupal_write_record() (line 6975 of /var/www/html/includes/common.inc).
WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate
↪ entry '187810' for key[error] 'PRIMARY': INSERT INTO {users} (uid, name, pass, mail,
↪ created, access, status, data) VALUES (:db_insert_placeholder_0,
↪ :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3,
↪ :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6,
↪ :db_insert_placeholder_7);
Array
(
[:db_insert_placeholder_0] => 187810
[:db_insert_placeholder_1] => [email protected]
[:db_insert_placeholder_2] => $S$XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXX
[:db_insert_placeholder_3] => [email protected]
[:db_insert_placeholder_4] => 1329491489
[:db_insert_placeholder_5] => 0
[:db_insert_placeholder_6] => 1
[:db_insert_placeholder_7] => a:1:{s:34:"user_relationships_ui_auto_approve";a:0:{}}
)
in drupal_write_record() (line 6975 of /var/www/html/includes/common.inc).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
↪ '187810' for key 'PRIMARY': INSERT INTO {users} (uid, name,
↪ pass, mail, created, access, status, data) VALUES (:db_insert_placeholder_0,
↪ :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3,
↪ :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6,
↪ :db_insert_placeholder_7); Array
(
[:db_insert_placeholder_0] => 187810
[:db_insert_placeholder_1] => [email protected]
[:db_insert_placeholder_2] => $S$XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXX
[:db_insert_placeholder_3] => [email protected]
[:db_insert_placeholder_4] => 1329491489
[:db_insert_placeholder_5] => 0
[:db_insert_placeholder_6] => 1
[:db_insert_placeholder_7] => a:1:{s:34:"user_relationships_ui_auto_approve";a:0:{}}
)
in drupal_write_record() (line 6975 of /var/www/html/includes/common.inc).
Drush command terminated abnormally due to an unrecoverable error.
(where ↪
indicates that I've wrapped lines for legibility).
Now I can see that this is because it is trying to enter a duplicate users.uid
into the database, but I can't work out why that would be the case. At no point have we manually entered users.uid
values, so the autoincrement
should just be doing its thing.
Is there something I'm missing? Is there some way for me to reset something so that Drupal (or mySQL) just resets its autoincrement value and tries to do the insert with a valid UID?
Alternately, should I just mess with the database manually? It'd be awkward to do, as there are a surprising number of fields to have to mess with, but I could do that if it's easier?
Update: A friend suggested running mysqlcheck
, but that is passing ok. Also, Clive's suggestion of resetting the autoincrement for the table doesn't seem to have resolved the problem.