When updating from beta16 to beta17 on a test system, this message came up on a white screen:

The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Argument 1 passed to Drupal\webform\WebformTokenManager::__construct() must implement interface Drupal\Core\Config\ConfigFactoryInterface, instance of Drupal\Core\Extension\ModuleHandler given, called in /home/sensarium/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 272 and defined in Drupal\webform\WebformTokenManager->__construct() (line 46 of modules/webform/src/WebformTokenManager.php).

Just to see what would happen, I opened a terminal session and

1. Cleared all caches (drush cr all)
2. Updated everything pending (drush up -y) --- no result from this, there were no pending updates
3. Ran any pending database updates (drush updb -y) -- this did run all the pending SQL updates
4. Cleared caches again (drush cr all)

The four steps above seemed to "fix" things, but I'm not sure exactly what happened. I tested the new version, and it seems to work, but I only tested a simple contact form.

In reference to the other problems in the parent issue, there are no custom handlers, this is a unmodified version of beta16 that was updated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Graffio created an issue. See original summary.

jrockowitz’s picture

Priority: Normal » Critical

Yep, I just did a clean install of beta16, switched to beta17, and ran the update hooks without clearing the cache, and I am seeing the below error.

10:46  /var/www/sites/d8_webform/modules/sandbox/webform  ((HEAD detached at 8.x-5.0-beta17))$ drush updb -y
The following updates are pending:

webform module : 
  8072 -   Issue #2901738: Add support conditions to WebformHandler. 
  8073 -   Issue #2905955: Update hook webform_update_8048 is broken. 
  8074 -   Issue #2906292: Display element descriptions as help icon (tooltip). 
  8075 -   Issue #2895671: Entity reference format. 

Do you wish to run all pending updates? (y/n): y
You have requested a non-existent service                            [error]
"webform_submission.conditions_validator".
Performing webform_update_8072                                       [ok]
Failed: You have requested a non-existent service                    [error]
"webform_submission.conditions_validator".
Cache rebuild complete.                                              [ok]

This indicates that cache must be cleared before executing the webform module's update hooks. I am going to do some more testing.

jrockowitz’s picture

Status: Active » Needs review
FileSize
450 bytes

Yep clearing the cache before running the update webform hooks is an immediate workaround.

The attached patch adds a cache clear call before the webform update hooks are executed.

Can someone please test it? I will commit it ASAP and tag a new release.

John Graffio’s picture

I ran it again on a restored version, with drush only, and it gets hung on an 8048 database update, but when you run

drush updb -y

again, it works. Site seems stable, everything working.

jrockowitz’s picture

@John Graffio Did you run the update hooks with the patch from #3?

John Graffio’s picture

@Jrockowitz - No, I ran this with the stock beta17 update.

jrockowitz’s picture

@John Graffio I think you are right that running drush updb twice is okay because the first failure is triggering a cache clear. If you can check the patch from #3 I can commit the fix and push a new release.

omdb’s picture

@jrockowitz - I just updated with #3 and it worked.

jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

@omdb Thanks I will commit the patch and tag a new release in the next day or so.

  • jrockowitz authored 7fba8b6 on 8.x-5.x
    Issue #2908014 by jrockowitz, John Graffio: Update to beta17 fails, but...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

I committed the patch.

Status: Fixed » Closed (fixed)

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

r-m-n’s picture

Hi. I just had a problem updating to Webform 8.x-5.0-rc3

Now I get a recoverable fatal error:
Recoverable fatal error: Argument 1 passed to Drupal\webform\WebformTokenManager::__construct() must implement interface Drupal\Core\Config\ConfigFactoryInterface, instance of Drupal\Core\Extension\ModuleHandler given, called in /home/rmnighti/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 266 and defined in Drupal\webform\WebformTokenManager->__construct() (line 46 of modules/webform/src/WebformTokenManager.php).

I'm not a Dev and I don't use Drush. What kind of options do I have to fix this?

jrockowitz’s picture

Before you update the webform module, put your site in maintenance mode, go to /update.php in a web browser, upload the webform module updates, and then run the database updates.

r-m-n’s picture

Thanks for your quick reply. On running update.php I get the following:

UNRESOLVED DEPENDENCY
contribute (Missing)
Webform requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform Examples requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform Node requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform Templates requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform UI requires this module.