Problem/Motivation
Trying to upgrade a site from Drupal 8.9 to Drupal 9.x. The site uses Content Moderation and is multilingual.
Once all the Drupal 9.x files are in place, launching a cache rebuild or the database updates will fail early in the process with the message No converter has been registered for paramconverter.latest_revision.
This is because a route rebuild is triggered early, and Content Moderation in D8 sets a "converter" parameter for many entity routes to paramconverter.latest_revision, and Drupal will try to load this converter.
Unfortunately, the paramconverter.latest_revision converter has been removed in Drupal 9.0, see #3093219: Remove content_moderation.module BC layers, so the converter cannot be loaded and it causes the upgrade process to fail.
As a temporary fix, I overrode the service paramconverter_manager with a custom service which overrides ParamConverterManager::getConverter() with a version that returns paramconverter.entity whenever paramconverter.latest_revision is requested.
It allowed me to perform the upgrade to Drupal 9, then I got rid of the custom service.
Steps to reproduce
TBA
Not reproducible with just Drupal core, #4
Reproducible with Acqui Lightning #14
Proposed resolution
Workaround this problem by temporarily adding a paramconverter service. Read the implementation details..
Other workarounds reported to work.
a) Clear cache #7, #17
b) On a complex site writing a custom ParamConverterManager worked #12
c) entity.node.canonical route from the router table in the database, #18
d) drush updb then drush cr, #19, #20
Remaining tasks
Find out if this is still blocking sites from updating
and
Steps to reproduce with Drupal Core
Comments
Comment #3
jabastin arul commentedI am also facing the same issue
Comment #4
mdupontI assume it should be fixed as part of the D8 -> D9 upgrade path. Tagging accordingly.
Where would be a good way to start fixing this? A
hook_update_N()is likely to trigger too late.Comment #5
cilefen commentedComment #6
mdupontJust retested this on a clean install. Cannot reproduce the issue with Drupal Core only when upgrading between 8.9.x and 9.1.x.
Maybe the issue was fixed in the meantime or was caused by a 3rd-party or custom module.
This is what I've done:
- Clone the latest Drupal 8.9.x from git
- Run
composer install- Install on SQLite DB, in English, standard profile
- Enable all the modules except experimental ones
- Add French as an additional language
- Enable Content Moderation editorial workflow for Article content type
- Enable Content Translation for Article nodes
- Create an Article, as published
- Edit the Article, put it in Draft
- Check that we land on the "Latest version" tab
- Translate the article in French, as published
- Edit the Article in French, put it in Draft
- Check the DB: in the
routertable, forentity.node.canonical, in theroutecolumn, converter is set toparamconverter.latest_revision- Switch to the 9.1.x branch or the git repo
- Run
composer install- Visit
update.phpand run the updates- Everything was correctly updated to Drupal 9.1.x
- Check the DB again: in the
routertable, forentity.node.canonical, we now have in theroutecolumnparamconverter.entity, which means it was correctly upgradedComment #7
bburgI just ran into this error. In my case, it seemed that I wasn't able to rebuild the cache due to other errors in code that wasn't fully ready for D9. Once I fixed those, and I was able to rebuild the cache, I was able to get a working site.
Comment #8
greg boggsSomeone in #support also has this error in their D8 to D9 upgrade.
Comment #9
greg boggsComment #10
greg boggsI've asked the affected person to provide more details in how to replicate this error.
Comment #11
avpadernomdupont, who created this bug report, said he hasn't been able to replicate the issue with only Drupal core modules, which seems to indicate it's not a bug in Drupal core.
It could also be Drupal code is assuming some conditions are verified when it's not so. Understanding if this is the case would help.
Comment #12
mdupontIndeed, I got the issue once on a fairly complex multilingual site with content moderation enabled, but could not reproduce it with Drupal core only, or simpler websites.
Writing a custom
ParamConverterManageris the fix that worked.Comment #13
longwaveIf someone can provide steps to reproduce from a clean install, or identify contrib or custom code that triggers this problem, we can see if it is possible to provide a fix in core.
Comment #14
jerdavisI'm having this issue on a Drupal 8 to Drupal 9 upgrade as well. This site was built with Acquia Lightning as the install profile and all modules were updated for d9 compatibility before trying to upgrade core. I haven't been able to track this to a particular contrib module, but of course Lightning does have aspects that touch on content moderation.
Comment #15
jerdavis@mdupont do you have a copy of your custom code you'd be willing to share?
Comment #16
mdupontUnfortunately not. At the time I traced it down to the route rebuild that occurs when doing a cache rebuild or update.php, without being able to pinpoint a specific module or part of the stack that was causing the issue. It might have been something in the code, or elsewhere in the stack (Redis, PHP opcache configuration...), or even something with the data stored in the database.
Comment #17
hatuhay commentedGot this error upgrading from D8.9.18 to D9.6.2, fixed cleaning caches.
Comment #18
jerdavisClearing cache did not fix for us, I was able to work around it by deleting entity.node.canonical route from the router table in the database.
Comment #19
loopy1492 commentedIn our case, we solved the issue with an updb and cr. However, your page might be stuck in another cache layer since you visited the page when it was busted. Be sure to clear varnish and whatnot after you run your drush commands.
Comment #20
alphex commentedJust confirming that I saw this also. 8.9.19 -> 9.2.9
running a DRUSH UPDB and then running DRUSH CR solved the problem.
Comment #22
alvarito75 commentedI'm upgrading Drupal 8.9.20 => 9.3.5
I'm facing the same problem.
I did these steps:
composer update, all went fine in the command line but when I try to use anydrushcommand I got this error The entity type capability_highlight does not have an "revision_created" entity revision metadata key.If I reload the site in the browser I got this error:
Comment #23
mikemadison commentedI ran into this today as well, and was able to temporarily add a services.yml file to a module with the following contents, run database updates / cache rebuild, then remove the service. Note that the services file has to go into a module that is already enabled (because hey, drush and drupal won't bootstrap to enable a new module). You could theoretically also hack a core services file to do this (but that is less advised).
Note: i did have to leave this in the code through production to finalize all updates.
Comment #24
rajab natshahFacing the same issue
Thank you, Mike
Fixed by following the steps in #23
Comment #25
quietone commentedUpdate IS
Is anyone still experiencing this problem? If so, leave a comment.
Comment #27
jbaum_13 commentedWe also ran into this error on D8 to D9 upgrade and also fixed by following the steps in #23
Comment #28
x775 commented#25: I can confirm that we are seeing this error as well.
Is there a way to circumvent or otherwise patch this?
Comment #29
cilefen commented#24 and #27 indicate that #23 is the workaround.
Comment #30
quietone commentedUpdated the IS to emphasize the preferred workaround, #23. Also changed the title to the error message since that is what people will search for.
I don't there is more we can do here. And it has been nearly a year since the status was changed, waiting for steps to reproduce. I think it is time to close this (outdated).
If you arrive here and the workaround does not work for you, you can open a new issue. In that new issue refer to this one. The other option is to seek support in the other Drupal sources of support.
Thanks to everyone who contributed the solutions and tested them.
Comment #31
darktek commented#23 worked for me, thanks man!