Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninstalling via a config import crashes #353

Open
joachim-n opened this issue Mar 8, 2024 · 3 comments
Open

uninstalling via a config import crashes #353

joachim-n opened this issue Mar 8, 2024 · 3 comments

Comments

@joachim-n
Copy link

I'm uninstalling this module and its dependencies by importing config to the state from before I enabled it. This is because I'm figuring out this bug: https://www.drupal.org/project/search_api/issues/3151796 -- this may be relevant, as the crash from that might mean my site is in an unstable state!

The config import crashes with:

The "" plugin does not exist. Valid plugin IDs for Drupal\search_api\DataType\DataTypePluginManager are: text, string, integer, decimal, date, boolean, rpt, location

Backtrace shows that this happens when search_api_location module is being uninstalled and config that depends on it is being saved in ConfigManager::uninstall():

    $entities = $this->getConfigEntitiesToChangeOnDependencyRemoval($type, [$name], FALSE);
    // Fix all dependent configuration entities.
    /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
    foreach ($entities['update'] as $entity) {
      $entity->save();
    }

The search_api_index entity localgov_directories_index_default is being saved when the crash happens.

FieldsProcessorPluginBase is trying to get the type of the field localgov_location:

    // If the "all supported fields" option is checked, we need to reset the
    // fields array and fill it with all fields defined on the index.
    if ($this->configuration['all_fields']) {
      $this->configuration['fields'] = [];
      foreach ($this->index->getFields() as $field_id => $field) {
        if (!$field->isHidden() && $this->testType($field->getType())) {

I'm wondering if there's a missing config dependency somewhere, as I would have thought localgov_directories module would be getting uninstalled BEFORE search_api, so its config entities should be gone already.

@joachim-n
Copy link
Author

Ah. localgov_directories isn't installed. This might be the problem!

@ekes
Copy link
Member

ekes commented Mar 12, 2024

Ah. localgov_directories isn't installed. This might be the problem!

Not sure I'm quite following this one yet. Although it's quite possible, even likely, we do things that are causing access to non-existing config on uninstallation. Is there a good 'how to reproduce'?

@joachim-n
Copy link
Author

Basically, when I first installed all the modules (IIRC it was directories AND events AND dependencies), the whole thing crashed. I then tried to revert the site to its previous state by doing a config import. It might be that the first crash during installation causes the crash during import.

I'm leaving this for now as it's a rabbithole, might return to it if I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants