rich remer
rich remer

Reputation: 3577

Symfony: The service ... has a dependency on a non-existent parameter kernel.secret

I'm trying to setup a new Symfony project. When I do a "php console.php config:dump-reference", I get an error saying 'The service "uri_signer" has a dependency on a non-existent parameter "kernel.secret". Did you mean this: "kernel.charset"?'

I have verified the secret is set in config/parameters.yml:

parameters:
    secret: s3kr3t

I have verified the parameters is imported in the config/config.yml:

imports:
    - { resource: parameters.yml }

If I change parameters.yml to the following it works (but this isn't correct, according to all documentation on the web):

parameters:
    kernel.secret: s3kr3t

Upvotes: 3

Views: 11346

Answers (2)

michalzuber
michalzuber

Reputation: 5215

Had similiar issue had forgot to add it also in the parameters_dev.yml So check in which environment are you working and if it's set for that environment.

Upvotes: 1

Youri Thielen
Youri Thielen

Reputation: 450

That means that kernel.secret hasn't been set, this value is used for generation of CSRF-tokens but could be used for other things as well.

Make sure kernel.secrect is known in parameters.yml and import it in config.yml as follows:

imports:
    - { resource: parameters.yml }

parameters.yml:

parameters:
    kernel.secret: ThisIsVerySecret!

Or how it's done in de standard edition:

config.yml:

framework:
    secret:          "%secret%"

parameters.yml

parameters:
     secret: ThisIsVerySecret!

Upvotes: 2

Related Questions