phpsymfonypimcore

ParameterNotFoundException after Pimcore update 6.9 to 10


I followed this guide to upgrade: https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/Updating_Pimcore/V6_to_V10.html

This is the complete error message I currently get when I try to execute e.g. ./bin/console cache:clear. But also for all other commands.

Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException^ {#1391
  -key: "secret"
  -sourceId: null
  -sourceKey: null
  -alternatives: []
  -nonNestedAlternative: null
  #message: "You have requested a non-existent parameter "secret"."
  #code: 0
  #file: "./vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php"
  #line: 93
  trace: {
    ./vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php:93 { …}
    ./vendor/symfony/dependency-injection/ParameterBag/EnvPlaceholderParameterBag.php:61 { …}
    ./vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php:203 { …}
    ./vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php:175 { …}
    ./vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php:165 { …}
    ./vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php:165 { …}
    ./vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php:62 { …}
    ./vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php:39 { …}
    ./vendor/symfony/dependency-injection/Compiler/Compiler.php:91 { …}
    ./vendor/symfony/dependency-injection/ContainerBuilder.php:744 { …}
    ./vendor/symfony/http-kernel/Kernel.php:545 { …}
    ./vendor/pimcore/pimcore/lib/Kernel.php:237 { …}
    ./vendor/symfony/http-kernel/Kernel.php:786 { …}
    ./vendor/symfony/http-kernel/Kernel.php:125 { …}
    ./vendor/pimcore/pimcore/lib/Kernel.php:216 { …}
    ./vendor/pimcore/pimcore/lib/Bootstrap.php:255 { …}
    ./vendor/pimcore/pimcore/lib/Bootstrap.php:60 { …}
    ./bin/console:24 {
      › /** @var \Pimcore\Kernel $kernel */
      › $kernel = \Pimcore\Bootstrap::startupCli();
      › $application = new \Pimcore\Console\Application($kernel);
    }
  }
}

Content of the file config/config.yml:

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }
    - { resource: 'local/' }
...

And in config/local/parameters.yml:

parameters:
    secret: mysecret
...

I also tried to put the secret into config/services.yml as in the skeleton example.

Where do I have to put the secret parameter for it to be found from the system?


Solution

  • I was able to solve the issue on my side by renaming the config files from .yml to .yaml.

    So my /config folder now looks like this:

    config folder files

    I also had to change the imports in the environment specific configs under config/packages/$ENV/*.yaml to this (note the ../../):

    imports:
        - { resource: ../../config.yaml }
    

    I also have put the parameters config into the services.yaml

    Like in the pimcore demo: https://github.com/pimcore/demo/blob/5f0577f4b801e2ca594efc94364600a7a0aee505/config/services.yaml#L1