Constructing service “validation.constraint” after upgrade to Drupal 8.4.0

by 94638857   Last Updated October 11, 2017 18:07 PM

I know there is another thread for this here: What is the cause for Symfony RuntimeException: Constructing service "validation.constraint" after upgrade to Drupal 8.4.0?

However, I do not have the necessary reputation to submit a comment.

I am experiencing the same issue as the OP there. I created an issue on dupal.org here: https://www.drupal.org/node/2915332

The responses to the OP suggest that the problem is related to Drush. I do not believe it is.

When updating from 8.3.7 to 8.4.0, I recieve the following error:

Constructing service "validation.constraint" from a parent definition
is not supported at build time. in
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php:847
Stack trace:
#0
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(451):
Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\DefinitionDecorator),
'validation.cons...')
#1
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(957):
Symfony\Component\DependencyInjection\ContainerBuilder->get('validation.cons...',
1)
#2
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(954):
Symfony\Component\DependencyInjection\ContainerBuilder->resolveServices(Object(Symfony\Component\DependencyInjection\Reference))
#3
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(1145):
Symfony\Component\DependencyInjection\ContainerBuilder->resolveServices(Array)
#4
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(918):
Symfony\Component\DependencyInjection\ContainerBuilder->callMethod(Object(Drupal\Core\Config\TypedConfigManager),
Array)
#5
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(451):
Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition),
'config.typed')
#6
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(957):
Symfony\Component\DependencyInjection\ContainerBuilder->get('config.typed',
1)
#7
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(954):
Symfony\Component\DependencyInjection\ContainerBuilder->resolveServices(Object(Symfony\Component\DependencyInjection\Reference))
#8
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(879):
Symfony\Component\DependencyInjection\ContainerBuilder->resolveServices(Array)
#9
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(451):
Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition),
'config.factory')
#10
/srv/bindings/***/code/modules/libraries/src/LibrariesServiceProvider.php(29):
Symfony\Component\DependencyInjection\ContainerBuilder->get('config.factory')
#11
/srv/bindings/***/code/core/lib/Drupal/Core/DependencyInjection/Compiler/ModifyServiceDefinitionsPass.php(30):
Drupal\libraries\LibrariesServiceProvider->alter(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#12
/srv/bindings/***/code/vendor/symfony/dependency-injection/Compiler/Compiler.php(120):
Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass->process(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#13
/srv/bindings/***/code/vendor/symfony/dependency-injection/ContainerBuilder.php(573):
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#14
/srv/bindings/***/code/core/lib/Drupal/Core/DrupalKernel.php(1307):
Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#15
/srv/bindings/***/code/core/lib/Drupal/Core/DrupalKernel.php(884):
Drupal\Core\DrupalKernel->compileContainer()
#16
/srv/bindings/***/code/core/lib/Drupal/Core/DrupalKernel.php(466):
Drupal\Core\DrupalKernel->initializeContainer()
#17
/srv/bindings/***/code/core/lib/Drupal/Core/DrupalKernel.php(709):
Drupal\Core\DrupalKernel->boot()
#18
/srv/bindings/***/code/core/includes/utility.inc(43):
Drupal\Core\DrupalKernel->prepareLegacyRequest(Object(Symfony\Component\HttpFoundation\Request))
#19 /opt/pantheon/drush8/commands/core/cache.drush.inc(302):
drupal_rebuild(Object(Composer\Autoload\ClassLoader),
Object(Symfony\Component\HttpFoundation\Request))
#20 /opt/pantheon/drush8/includes/command.inc(422):
drush_cache_rebuild()
#21 /opt/pantheon/drush8/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#22 /opt/pantheon/drush8/includes/command.inc(199): drush_command()
#23 /opt/pantheon/drush8/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#24 /opt/pantheon/drush8/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#25 /opt/pantheon/drush8/drush.php(12): drush_main()
#26 {main} [0.38 sec, 15.68 MB]

When I downloaded the Drupal 8.4.0 zip from the Drupal Github mirror repo, unzipped, then grepped through the code, I found this:

$ grep -rF 'validation.constrain'
drupal-8.4.0/core/core.services.yml:      - [setValidationConstraintManager, ['@validation.constraint']]
drupal-8.4.0/core/core.services.yml:      - [setValidationConstraintManager, ['@validation.constraint']]
drupal-8.4.0/core/core.services.yml:  validation.constraint:
drupal-8.4.0/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ComplexDataConstraint.php:    $constraint_manager = \Drupal::service('validation.constraint');

Is it possible that Symfony deprecated this "validation.constraint" configuration key, and yet Drupal forgot to make the necessary change in their 8.4.0 code?

Tags : updating


Related Questions


Check when core was updated

Updated February 16, 2016 16:03 PM