One database update is not able to run. Here is the output I am getting:

 

$ drush updb
 User  1021  1021 - Make sure that generation of automatic path alias is
             enabled for user 1.
Do you wish to run all pending updates? (y/n): y
DB Error: already exists                                             [error]
Performed update: user_update_1021                                   [ok]
Finished performing updates.                                         [ok]

And when attempting to run the db update from the ui:

user module

  • 1021 - Make sure that generation of automatic path alias is enabled for user 1.

 

The following updates returned messages

user module

Update #1021

  • Failed: EntityStorageException: DB Error: already exists in EntityDatabaseStorageController->save() (line 786 of /var/www/web/public/core/modules/entity/entity.controller.inc).

 

Not really sure what to do here, any help is appreciated!

Accepted answer

Turns out there was some sort of conflict with CiviCRM. disabling that, I was able to run the backdrop update.

Comments

@kristin - Thanks. I've passed this report along to folks who are smarter than me. Can you give any more details?

Specifically:
 
1) What was the final outcome. Did this prevent the update and your site is still working or did this break your site?

2) What version were you running before the update?

 


All the other db updates for this version update ran, this is the only one remaining that will not run. The site seems to operate fine, so it is not a breaking error.

 

Prior to this the site was running v1.20.3.

oadaeh's picture

Here is the update that is failing:

/**
* Make sure that generation of automatic path alias is enabled for user 1.
*/
function user_update_1021() {
  if (module_exists('path') && config_get('path.settings', 'user_pattern')) {
    $admin_user = user_load(1);
    if ($admin_user->path['auto'] == FALSE) {
      $admin_user->path['auto'] = TRUE;
      user_save($admin_user);
    }
  }
}

https://github.com/backdrop/backdrop/blob/c144627cadb416d979aaa89bc9659c...

It looks like it's probably failing to create a path alias when saving user with ID 1, because it already exists, so I'd say you probably don't need to do anything, but you could probably edit the user and make sure everything looks okay, especially in URL redirects, to be sure.

 

When I attempt to edit/save user 1 in the UI, I get "DB Error: already exists".

So it would seem it is attempting to duplicate user 1 now?

Odd error. You would need to look at the logs for more information about the error. What field in the db?

Can't just ignore this either because this update failing will prevent future updates from running.

yes, this is all that is in the logs in relation to the issue:

 

EntityStorageException: DB Error: already exists in EntityDatabaseStorageController->save() (line 786 of /var/www/website/public/core/modules/entity/entity.controller.inc).

PEAR_Exception: DB Error: already exists in CRM_Core_Error::exceptionHandler() (line 943 of /var/www/dwebsite/public/modules/civicrm/CRM/Core/Error.php).

 

And correct, this seems to have broken the ability to save user 1, and can't be ignored. But I'm at a loss as to what to do.

Turns out there was some sort of conflict with CiviCRM. disabling that, I was able to run the backdrop update.