0

This is similar to Symfony3 You have requested a non-existent service "validator.builder", while add FOSUserBundle, on vanilla Symfon3.3 instead of microkernel (in case that makes differences).

Problem:

I have a problem trying to set up FOSUser (v.2) on a Symfony 3.3:

[Symfony\Component\DependencyInjection\Exception\AutowiringFailedException]
Cannot autowire service "validator.builder": argument "$node" of method
"Symfony\Component\Config\Definition\Builder\ValidationBuilder::__construct()"
references class Symfony\Component\Config\Definition\Builder\NodeDefinition"
but no such service exists.

Browsing through online API:

Does that mean that their documentation is not up to date with the master 3.3?

Or not maintained anymore?

Context:

Following the official documentation, I first faced these problems:

  1. mailer_user cannot be null ; solved by editing parameters.yml: parameters: mailer_user: "me@example.com"
  2. non-existent-service-validator-builder ; solved by declaring service validator.builder
  3. non existent parameter kernel secret ; solved by duplicating a line in parameters.yml:

    parameters:
        secret: <-generated-upon-install->
        kernel.secret: <-duplicated-line->
    

I suppose there is a nice and clever way to get out of this problem, if anyone faced it yet?

nicolallias
  • 1,055
  • 2
  • 22
  • 51

1 Answers1

1

Solved! In service.yml, do not declare service as

validator.builder:
    class: Symfony\Component\Config\Definition\Builder\ValidationBuilder

But this way:

Symfony\Component\Config\Definition\Builder\ValidationBuilder:
    autowire: true

Once again, the official documentation had the answer!

nicolallias
  • 1,055
  • 2
  • 22
  • 51