As reported by @scotwith1t, the upgrade seems to go wrong because there are no upgrades once you switch to v3. This is because I cherry-picked an update hook from v3 to v2 without changing the number. Silly me.

Let's fix this ASAP.

Comments

kristiaanvandeneynde created an issue. See original summary.

kristiaanvandeneynde’s picture

kristiaanvandeneynde’s picture

Status: Active » Fixed

Will cut a release and recommend people affected by this bug run:

drush php-eval \Drupal::service('update.update_hook_registry')->setInstalledVersion('group', 9211);
yazzbe’s picture

In shell (bash) I had to include parentheses.

drush php-eval "\Drupal::service('update.update_hook_registry')->setInstalledVersion('group', 9211);"
kristiaanvandeneynde’s picture

Updated the release notes

aurora.luzzardi’s picture

Are you sure that this only happens from 2.3 to 3.3?
I have this message when upgrading from 3.2.2 to 3.3.1:

 [error]  The installed version of the /Group/ module is too old to update. Update to
an intermediate version first (last removed version: 9211, installed version:
9210).

And then the upgrades runs:

 -------- ----------- --------------- --------------------------------------------------------------
  Module   Update ID   Type            Description
 -------- ----------- --------------- --------------------------------------------------------------
  gnode    8007        hook_update_n   8007 - Updates views to drop obsolete key.
  group    10300       hook_update_n   10300 - Updates database and fields from Group 2 to Group 3.
  group    10301       hook_update_n   10301 - Updates indexes from Group 2 to Group 3.
  group    10302       hook_update_n   10302 - Updates views from Group 2 to Group 3.
  group    10303       hook_update_n   10303 - Updates views to drop obsolete key.
 -------- ----------- --------------- --------------------------------------------------------------

Those should be running even coming from 3.2 installations?

kristiaanvandeneynde’s picture

Dammit you're right I shouldn't have upped that number in 3.3.x.

Will hotfix release in the morning. This mess is coming from the fact that we have two versions being kept in sync but with different update hook numbers :/

The update hooks to go from 2 to 3 don't do anything if you're already on 3.

scotwith1t’s picture

I suppose the good news is that the update hooks, if a user resets the schema version via drush and runs them a second time, should probably not find anything to update anyway. 🤷‍♂️ Thanks for your work on this as always Kristiaan.

nickdjm’s picture

Trying the update out after I reset the installed version to 9211 and I get the following error:

>  [notice] Update started: group_update_10300
>  [error]  The "entity:group_content" plugin does not exist. Valid plugin IDs for Drupal\search_api\Datasource\DatasourcePluginManager are: entity:block_content, entity:comment, entity:consumer, entity:contact_message, entity:content_moderation_state, entity:crop, entity:file, entity:flagging, entity:group_config_wrapper, entity:group, entity:group_relationship, entity:media, entity:node, entity:path_alias, entity:profile, entity:redirect, entity:search_api_task, entity:shortcut, entity:taxonomy_term, entity:user, entity:webform_submission, entity:menu_link_content, entity:paragraph, solr_document, solr_multisite_document 
>  [error]  Update failed: group_update_10300

The only place I see reference to 'group_content' is in my config. All custom and contrib code has been updated appropriately. Should I be updating the config before I try to run the updates? Or should the updates be taking care of that?

tyler.hastain’s picture

It appears that comment #7 solved the problem for us.

kristiaanvandeneynde’s picture

https://www.drupal.org/project/group/releases/3.3.2

Also re #12, it seems like some search_api code is running before Group has had a chance to fully convert group_content to group_relationship.

kekkis’s picture

The group_update_9211 function is now defined twice in group.install in version 2.3.1. I'll create a follow-up.

kekkis’s picture

Added the issue I encountered as a related issue although I recognized it's not actually an issue with this change, rather with another MR sharing the hook ID.

nickdjm’s picture

Re #15 ah yeah, only way we're finding around it is disabling search_api entirely, otherwise it just fails. I'll see if I can find a solution that does not involve uninstalling the module and if it's something group-related I'll open an issue/MR.

aurora.luzzardi’s picture

#10 I did not see the error anymore about the installed version being too old.
But I still see the database updates running after the upgrade from 3.2.2 to 3.3.2
Is that the expected behavior if I'm not upgrading from version 2.x?
My feeling is that upgrades, if needed to run, should check an show a notice/information that they are not running as the current version is already version 3.x

kristiaanvandeneynde’s picture

Hooks group_update_10300 through group_update_10302 run but don't do anything if you were already on v3. Hook group_update_10303 needs to run no matter what version you came from.

aurora.luzzardi’s picture

kristiaanvandeneynde Thanks for explaining!

Status: Fixed » Closed (fixed)

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