after 10.2.0 updb updae taxonomy_filter_user_context runs repeatedly

Created on 27 December 2023, 12 months ago
Updated 29 May 2024, 7 months ago

Problem/Motivation

after 10.2.0 updb updae taxonomy_filter_user_context runs during every drush updb command and seems not to ever compete.

Steps to reproduce

- update to D10.2.0
- run - drush -n -y updb
the following text is output:

-------- ------------------- ------------- ---------------------------------
Module Update ID Type Description
-------- ------------------- ------------- ---------------------------------
views taxonomy_filter_u post-update Removes User context from views
ser_context with taxonomy filters.
-------- ------------------- ------------- ---------------------------------

Proposed resolution

The resolution of this problem inside views.post_update.php is beyond my expertise

/**
 * Removes User context from views with taxonomy filters.
 */
function views_post_update_taxonomy_filter_user_context(array &$sandbox = NULL): void {
  /** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
  $view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
  \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function (ViewEntityInterface $view) use ($view_config_updater): bool {
    return $view_config_updater->needsTaxonomyTermFilterUpdate($view);
  });
}



Remaining tasks

find out what core maintainers understand about this proble.

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States websiteworkspace

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @websiteworkspace
  • Run it with update.php. What happens then?

  • πŸ‡ΊπŸ‡ΈUnited States websiteworkspace

    Thank you for your suggestion @cilefen.

    The update runs correctly when executed via {site}/update.php.

    This problem with drush compatibility seems somewhat important since many drupal site builders are using shell scripts to run code updates, including composer.phar module updates that also include running drush updb and drush cr.

    Might the conclusion to reach be that there is some kind of problem with the code path that drush uses to execute the updates?

  • Status changed to Postponed: needs info 12 months ago
  • That conclusion needs supporting evidence. This is the only such report.

    What is the Drush exit code when this update does not complete? May we see exactly what you type and the complete output? What does the β€œ-n” flag do? What is the Drush version?

  • πŸ‡§πŸ‡¬Bulgaria mihailnovak

    Drupal 10.2
    php 8.2.13
    MariaDB

    Hello,
    i got the same error without using drush. The database update did not complete. Here is the error

    views module
    Update taxonomy_filter_user_context
    Failed: InvalidArgumentException: A valid cache entry key is required. Use getAll() to get all table data. in Drupal\views\ViewsData->get() (line 137 of /home/jewishba/public_html/web/anc/core/modules/views/src/ViewsData.php).

  • πŸ‡ΊπŸ‡ΈUnited States emptyvoid

    I'm getting the same error any attempt on drupal or via update.php in the browser fails.

    drush updatedb
     -------- ------------------- ------------- --------------------------------- 
      Module   Update ID           Type          Description                      
     -------- ------------------- ------------- --------------------------------- 
      views    taxonomy_filter_u   post-update   Removes User context from views  
               ser_context                       with taxonomy filters.           
     -------- ------------------- ------------- --------------------------------- 
    >  [notice] Update started: views_post_update_taxonomy_filter_user_context
    >  [error]  Attempt to save a configuration entity 'resource_fc_educator_toolkit' with UUID '00047496-17b5-478f-b1bc-4dbd21dfea40' when this UUID is already used for 'resource_fc_educator_toolkitt' 
    >  [error]  Update failed: views_post_update_taxonomy_filter_user_context 
     [error]  Update aborted by: views_post_update_taxonomy_filter_user_context 
     [error]  Finished performing updates. 
    
    

    The thing is the signature 'resource_fc_educator_toolkitt' doesn't exist.
    The original 'resource_fc_educator_toolkit' does exist. backing up and testing and manually removing the view doesn't fix the issue..
    The update still fails with the same error even after running cron, cache rebuild, etc.

    It's blocking the database update for Drupal 10.2.1 on my build.

  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Check all your Views that have a taxonomy term filter and try to resave them manually. Does that work? Are there any broken handlers on them? After resaving manually, does the update run?
    All the update does if resave the View if it has such a taxonomy term filter, and apparently that is failing, usually this is due to a pre-existing problem in the View and has very little to do with the actual update. The update just surfaces the issue.

  • πŸ‡©πŸ‡ͺGermany macdev_drupal Wiesbaden

    Same here. It fails for a part of our code base:

    hm-medien.de > [warning] Trying to access array offset on value of type null HandlerBase.php:724
    hm-medien.de > [error] A valid cache entry key is required. Use getAll() to get all table data.
    hm-medien.de > [error] Update failed: views_post_update_taxonomy_filter_user_context
    hm-medien.de > [error] Update aborted by: views_post_update_taxonomy_filter_user_context

    Will investigate further.
    Had some config changes after core / module Updates in views config ymls which have not been commited yet.
    On the main part of our code base the update did run well.

  • πŸ‡ΊπŸ‡ΈUnited States gr8tkicks

    When using the administrative interface I get the following error which is more helpful then the drush error:

    Update taxonomy_filter_user_context
    Failed: InvalidArgumentException: A valid cache entry key is required. Use getAll() to get all table data. in Drupal\views\ViewsData->get() (line 137 of /var/www/docroot/core/modules/views/src/ViewsData.php).

Production build 0.71.5 2024