Skip to content

3.2.0-RC1: Problem with redis provider service #20563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Guite opened this issue Nov 18, 2016 · 5 comments
Closed

3.2.0-RC1: Problem with redis provider service #20563

Guite opened this issue Nov 18, 2016 · 5 comments

Comments

@Guite
Copy link
Contributor

Guite commented Nov 18, 2016

I am trying to update the Zikula core to Symfony 3.2.0-RC1. When running composer I receive the following error:

[RuntimeException]                                                                                                                                                                 
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                                          
  PHP Fatal error:  Uncaught Matthias\SymfonyServiceDefinitionValidator\Exception\InvalidServiceDefinitionsException: Service definition validation errors (1):                      
  - cache.default_redis_provider: Class "Redis" does not exist in /.../src/vendor/matthiasnoback/symfony-service-definition-validator/Compiler/ValidateServiceDefinitionsPass.php:44

Stack trace:
  #0 /.../src/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php(120): Matthias\SymfonyServiceDefinitionValidator\Compiler\ValidateServiceDefinitionsPass->process(Object(Zikula\Bridge\DependencyInjection\ContainerBuilder))
  #1 /.../src/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php(565): Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Zikula\Bridge\DependencyInjection\ContainerBuilder))
  #2 /.../src/lib/Zikula/Bridge/DependencyInjection/ContainerBuilder.php(110): S in /.../src/vendor/matthiasnoback/symfony-service-definition-validator/Compiler/ValidateServiceDefinitionsPass.php on line 44

The appDevDebugProjectContainer.xml file contains the following service definition:

    <service id="cache.default_redis_provider" class="Redis">
      <argument>redis://localhost</argument>
      <factory class="Symfony\Component\Cache\Adapter\RedisAdapter" method="createConnection"/>
    </service>

Is this a problem which must be fixed in our config file? If yes, how to do that (couldn't find anything about it in the cache component docs)?

@HeahDude
Copy link
Contributor

This is about a dependency which tries to get a not yet defined service in a compiler pass Matthias\SymfonyServiceDefinitionValidator\Compiler\ValidateServiceDefinitionsPass from your trace.

Maybe related to #20533, but what's weird is that it's already part of RC1.

@nicolas-grekas any thought?

@nicolas-grekas
Copy link
Member

@Guite can you try #20537 see if it fixes your issue?

@Guite
Copy link
Contributor Author

Guite commented Nov 21, 2016

@nicolas-grekas doesn't seem to change anything. Not sure though whether I did it correctly: I ran composer update, manually merged your changes and ran composer update again.

@nicolas-grekas
Copy link
Member

This is a false positive in https://github.com/matthiasnoback/symfony-service-definition-validator
Yet, we maybe able to do something about it in #20577

@Guite
Copy link
Contributor Author

Guite commented Nov 21, 2016

@nicolas-grekas I confirm that #20577 fixes this issue 🎉

fabpot added a commit that referenced this issue Nov 21, 2016
…rivate (nicolas-grekas)

This PR was merged into the 3.1 branch.

Discussion
----------

[FrameworkBundle] Mark cache.default_*_provider services private

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20563
| License       | MIT
| Doc PR        | -

I know making a service private has a potential for breaking BC. Yet, these services should not be used directly in controllers/userland code, and I really doubt anyone did. Let's make it private now and fix linked issue (even if it's a false positive from SymfonyServiceDefinitionValidator, it shows we have this service that really isn't meant to be public).

Commits
-------

09adfda [FrameworkBundle] Mark cache.default_*_provider services private
@fabpot fabpot closed this as completed Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants