The app.root parameter has been added in Drupal 9 to replace the app.root service. If you are using Drupal 8, that error could possibly be causes by:
- A module that says to be compatible with Drupal 8 and Drupal 9, whose code accesses the app.root container parameter when it runs on Drupal 8
- Other code that tries to access the app.root container parameter when it runs on Drupal 8
This could happen because:
- One of the arguments for a service is
'%app.root%'
(which requires the container parameter) instead of '@app.root'
(which requires the service that exists in Drupal 8.x)
- There is code that uses
$container->getParameter('app.root')
instead of $container->get('app.root')
- There is code that checks whether to use the app.root container parameter or the app.root service, but it fails to use the available one
To understand which code causes the error, it should be sufficient to search for %app.root% or ->getParameter('app.root'). Searching for app.root isn't sufficient, as it would return any line that correctly uses the app.root service.
[Symfony 5] Replace app.root and site.path string services with container parameters has been created has been created on August 13, 2019 and marked as fixed on December 23, 2020. (The patch was committed on Drupal 9.x on March 5, 2020.)
Drupal Console 1.9.4 (released on November 11, 2019) should not contain code that accesses the app.root container parameter, as Drupal core didn't even have that container parameter when Drupal Console 1.9.4 was released.