Database update issue with mailer_html_to_text

Created on 19 April 2023, almost 2 years ago
Updated 7 August 2023, over 1 year ago

Problem/Motivation

Running database updates results in:

> [notice] Update started: symfony_mailer_update_10007
> [error] The "mailer_html_to_text" plugin does not exist. Valid plugin IDs for Drupal\symfony_mailer\Processor\EmailAdjusterManager are: mailer_url_to_absolute, email_bcc, email_body, email_cc, mailer_default_headers, email_from, mailer_hooks, mailer_inline_css, email_plain, email_priority, email_reply_to, email_skip_sending, email_subject, email_theme, email_to, email_transport, mailer_wrap_and_convert
> [error] Update failed: symfony_mailer_update_10007

โ€ฆ this seems to be some weird inverse of ๐Ÿ’ฌ Config import issue with mailer_html_to_text Fixed and not sure what even the workaround should be.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Postponed: needs info

Version

1.2

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

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

Comments & Activities

  • Issue created by @mlncn
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom adamps

    Did you try clearing caches?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States shaunole

    I can confirm seeing this issue as well. Performing a cache rebuild prior to the update had no effect on the result.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    We added

    drush pmu -y symfony_mailer symfony_mailer_bc
    drush en -y symfony_mailer symfony_mailer_bc
    

    to our update script temporarily to get around it.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom adamps

    The "mailer_html_to_text" policy should have been removed in symfony_mailer_update_10006(). I wonder how come you still have some remaining? Please can you check your configuration and look for them?

    Could it be related to ๐Ÿ› Update body policy to add text format update 10003 breaks policy translations. Closed: outdated and policy translations? I only use single-language so I'm afraid I don't know much about translations.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom adamps

    Strange ๐Ÿ˜ƒ - thanks for the update

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States shaunole

    After verifying that all pending database updates had been completed, I found that the mailer_html_to_text configuration still existed via:
    drush cget symfony_mailer.mailer_policy._ configuration.mailer_html_to_text

    I was able to resolve this in drush by deleting said configuration and rebuilding cache:

    1. drush cdel symfony_mailer.mailer_policy._ configuration.mailer_html_to_text
    2. drush cr
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom adamps

    It's possible to force rerun database updates. It would be interesting to see the effects of that when the cget symfony_mailer.mailer_policy._ configuration.mailer_html_to_text is present.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada bgilhome Victoria

    The issue is that if the schema version is less than 10006 and the module is upgraded to any commit after the removal of the mailer_html_to_text plugin, then the plugin will still be in config but won't exist. Any db update or probably cache clear will show the error.

    The attached patch checks whether the plugin exists on each hook_update_N before 10006, and if not, runs the 10006 update to update the config so the error is not shown.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom adamps

    @bgilhome That sounds like a different issue - the OP had an error running symfony_mailer_update_10007(). Please raise a new issue with a description of the steps you take and the error you see.

    then the plugin will still be in config but won't exist

    True - but why is this a problem? As far as I can see, the update hook won't try to load any of the EmailAdjuster plug-ins for the policies that it updates.

  • ๐Ÿ‡ต๐Ÿ‡ฑPoland lamp5 Rzeszow

    Same issue.

  • Status changed to Postponed: needs info almost 2 years ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom adamps

    Same issue.

    Thanks - but same as which person commenting? There seem to be a few different reports, and I still don't know how to reproduce any of them.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anup.singh

    anup.singh โ†’ made their first commit to this issueโ€™s fork.

  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Not currently mergeable.
  • @anupsingh-0 opened merge request.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    6 pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anup.singh

    Created a merge request using the suggestion from #9,
    But I added the call on the new update hook too, as it is failing when upgrading core to D10

    Note: this is still not the final fix for this issue, but just a workaround to unblock the broken updb

Production build 0.71.5 2024