Problem/Motivation

After a composer update, drush updatedb gives these errors :
> [notice] Update started: varbase_security_update_9001
> [error] The SQL storage cannot change the schema for an existing field (uid in user entity) with data.
> [error] Update failed: varbase_security_update_9001
and
[error] Update aborted by: varbase_security_update_9001
[error] Finished performing updates.
In the back-office of Drupal at admin/config/development/update-helper, I have pending updates that I cannot resolve/

Can somebody help me? Thank you

Proposed resolution

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release varbase-9.0.5, varbase_core-9.0.14

Varbase update type:

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Comments

jeanpaulbouvet created an issue. See original summary.

jeanpaulbouvet’s picture

Ok, it seems that nobody hat the same problem and could help me.
The only way I've found to avoid the problem ist to uninstall varbase_security before upgrading the database.
But if I want to enable varbase_security after I've pending updates to do. So for the moment I don't use varbase_security.
Any help would be appreciated

jeanpaulbouvet’s picture

Category: Support request » Bug report
Rajab Natshah’s picture

Assigned: Unassigned » Rajab Natshah

Thanks, Bouvet for reporting.

I confirm the issue.
Faced the issue when upgrading from Drupal 8 to Drupal 9.3.x
But not in Drupal 9.1.x or Drupal 9.2.x
I recommend to upgrade to Varbase 9.0.3 first .. then update to Varbase 9.0.4

Rajab Natshah’s picture

Just to note that I had a full test on Updating Varbase 9.0.3 to Varbase 9.0.4
Before releasing Varbase 9.0.4
And listed the following in the release notes.


Updating Varbase 9.0.3 to Varbase 9.0.4

On navigating to "/update.php"
Test updating Varbase 9.0.3 to Varbase 9.0.4

On navigating to "/admin/config/development/update-helper"
Then the Varbase update instructions are listed
Varbase update instructions for Varbase 9.0.4

jeanpaulbouvet’s picture

Assigned: Rajab Natshah » Unassigned

I resolved my problem but I'm not sure to understand how it works:
as there was this "SQL storage cannot change the schema for an existing field (uid in user entity)" I used devel_entity_updates
1 - make a drush updatedb
it gives you the error
[error] Update aborted by: varbase_security_update_9001
[error] Finished performing updates.
2 - drush entity-updates
[success] No entity schema updates required
3 - drush updatedb
the update of varbase_security_update_9001 is OK

Important: do not make a drush entity-updates before updating database -> it gives you an error "The SQL storage cannot change the schema for an existing field (uid in user entity) with data."

jeanpaulbouvet’s picture

Forget my above comment. It doesn't work!

Thank you for your help, Rajab.
When I wrote my first comment, I had first upgraded from Drupal 9.2.8 to 9.3.2 (no problem) and from Varbase 9.0.2 to 9.0.4. (composer update) and had this [error] Update failed: varbase_security_update_9001.

I have tried this morning to start over with your Varbase update tool. ./bin/update-varbase.sh and have the same error.
The problem is with this tool I cannot forced a first upgrade to Varbase 9.0.3.
So I haved tried to update by hand:
composer require drupal/core-recommended:9.2.x --update-with-all-dependencies
but doing this I have an Upgrading vardot/varbase (9.0.2 => 9.0.4).
I'm new with composer. How do I do to upgrade to Varbase 9.0.3 first .. then update to Varbase 9.0.4?

Rajab Natshah’s picture

Bouvet, Thank you for following up.
Better direction is important, as you listed.

Devel Entity Updates has issues with every Drupal major release.

Having a quick fix release to fix the varbase_security_update_9001
As you said on using the Devel Entity Updates command will fix some issues. But not all

Important to use for

Entity updates to clear up any mismatched entity and/or field definitions
And Fix changes were detected in the entity type and field definitions.

field definitions are important, the order of updating them is important too.

Sometimes it's important to do that in a number of stages.

Varbase is using the Entity Definition Update Manager

  • Fix Error when updating with field definitions by changing the logic in varbase_security_update_9001 not bring SQL errors on updates to Varbase 9.04
  • Change the logic in Update Steps in the Varbase Updater to force all upgrades from Drupal 8 to Drupal 9.2.x first, then Drupal 9.3.x
Rajab Natshah’s picture

Rajab Natshah’s picture

Title: Error when updatedb after update Varbase 9.04 » Fix Error when updating with field definitions by changing the logic in varbase_security_update_9001 not bring SQL errors on updates to Varbase 9.04
Rajab Natshah’s picture

Title: Fix Error when updating with field definitions by changing the logic in varbase_security_update_9001 not bring SQL errors on updates to Varbase 9.04 » Fix Error when updating with field definitions by changing the logic in varbase_security_update_9001 not bring SQL errors on updates to Varbase 9.0.4

  • Rajab Natshah committed 5d5fa0c on 9.0.x
    Issue #3259184 by Rajab Natshah, jeanpaulbouvet: Fix Error when updating...

  • Rajab Natshah committed 58920c3 on 9.1.x
    Issue #3259184 by Rajab Natshah, jeanpaulbouvet: Fix Error when updating...
Rajab Natshah’s picture

Issue summary: View changes
Rajab Natshah’s picture

Title: Fix Error when updating with field definitions by changing the logic in varbase_security_update_9001 not bring SQL errors on updates to Varbase 9.0.4 » Fix Error when updating with field definitions by changing the logic in varbase_security_update_9001 not to bring SQL errors on updates to Varbase 9.0.4
Rajab Natshah’s picture

Rajab Natshah’s picture

Rajab Natshah’s picture

Assigned: Unassigned » Mohammed J. Razem
Issue summary: View changes
Status: Active » Needs review
Issue tags: +varbase-9.0.5, +varbase_core-9.0.14
Rajab Natshah’s picture

Assigned: Mohammed J. Razem » Unassigned
Rajab Natshah’s picture

Status: Needs review » Fixed
Rajab Natshah’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Rajab Natshah’s picture

Issue summary: View changes