Skip to content
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

Switch Doctrine cache to Symfony cache #8305

Merged
merged 1 commit into from Jan 7, 2020

Conversation

Enc3phale
Copy link
Contributor

@Enc3phale Enc3phale commented Jan 6, 2020

closes #8289

Please be sure you are submitting this against the staging branch.

Q A
Bug fix? Y
New feature? N
Automated tests included? N
Related user documentation PR URL N
Related developer documentation PR URL N
Issues addressed (#s or URLs) #8289
BC breaks? N
Deprecations? N

Description:

Use Symfony's cache bundle instead Doctrine's cache bundle

@hluchas
Copy link
Contributor

hluchas commented Jan 6, 2020

I'm getting error (cache dir is empty)

~/dev/community-fork(m3-switch-doctrine-cache) $ bin/console cache:warmup -e dev -v

In ArrayNode.php line 303:
                                                                                   
  [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]    
  Unrecognized option "type" under "framework.cache.pools.api_rate_limiter_cache"  
                                                                                   

Exception trace:
  at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/ArrayNode.php:303
 Symfony\Component\Config\Definition\ArrayNode->normalizeValue() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/BaseNode.php:296
 Symfony\Component\Config\Definition\BaseNode->normalize() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/PrototypedArrayNode.php:271
 Symfony\Component\Config\Definition\PrototypedArrayNode->normalizeValue() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/BaseNode.php:296
 Symfony\Component\Config\Definition\BaseNode->normalize() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/ArrayNode.php:292
 Symfony\Component\Config\Definition\ArrayNode->normalizeValue() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/BaseNode.php:296
 Symfony\Component\Config\Definition\BaseNode->normalize() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/ArrayNode.php:292
 Symfony\Component\Config\Definition\ArrayNode->normalizeValue() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/BaseNode.php:296
 Symfony\Component\Config\Definition\BaseNode->normalize() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/Processor.php:33
 Symfony\Component\Config\Definition\Processor->process() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/config/Definition/Processor.php:50
 Symfony\Component\Config\Definition\Processor->processConfiguration() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/dependency-injection/Extension/Extension.php:97
 Symfony\Component\DependencyInjection\Extension\Extension->processConfiguration() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/framework-bundle/DependencyInjection/FrameworkExtension.php:176
 Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension->load() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php:71
 Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
 Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/dependency-injection/Compiler/Compiler.php:140
 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/dependency-injection/ContainerBuilder.php:790
 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/http-kernel/Kernel.php:643
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /Users/lukas.drahy/dev/community-fork/app/AppKernel.php:518
 AppKernel->initializeContainer() at /Users/lukas.drahy/dev/community-fork/app/AppKernel.php:278
 AppKernel->boot() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/framework-bundle/Console/Application.php:64
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /Users/lukas.drahy/dev/community-fork/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /Users/lukas.drahy/dev/community-fork/bin/console:41

~/dev/community-fork(m3-switch-doctrine-cache) $ 

Here is probably the problem
https://github.com/Webmecanik/mautic/blob/16264c3a3a74322cf6ed1b228b39c50628f8bbec/app/config/config.php#L363

@hluchas hluchas added the pending-feedback PR's and issues that are awaiting feedback from the author label Jan 6, 2020
Copy link
Contributor

@hluchas hluchas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache warmup produces error

@Enc3phale
Copy link
Contributor Author

You need to edit your local.php to correspond to config.php modifications.

'api_rate_limiter_cache'            => [
     'adapter' => 'cache.adapter.filesystem',
],

@hluchas
Copy link
Contributor

hluchas commented Jan 7, 2020

You need to edit your local.php to correspond to config.php modifications.

'api_rate_limiter_cache'            => [
     'adapter' => 'cache.adapter.filesystem',
],

I'm sorry but the problem persist

@Enc3phale
Copy link
Contributor Author

After clear cache ? I have no problem on my instance.
Can you send me errors ?

@hluchas
Copy link
Contributor

hluchas commented Jan 7, 2020

After clear cache ? I have no problem on my instance.
Can you send me errors ?

Yes. It is the same error when I use bin/console cache:clear -e dev -v or delete cache folder content manually. Error is described above with stack trace

@hluchas
Copy link
Contributor

hluchas commented Jan 7, 2020

I'm sorry. I had

'api_rate_limiter_cache'            => [
     'type' => 'cache.adapter.filesystem',
],

in my local.php

@hluchas
Copy link
Contributor

hluchas commented Jan 7, 2020

There could be problem with this when upgrading app. I needed to change

'api_rate_limiter_cache'            => [
     'type' => 'cache.adapter.filesystem',
],

in local.php to

'api_rate_limiter_cache'            => [
     'adapter' => 'cache.adapter.filesystem',
],

somehow. There only one way to do that for now. Edit local.php manually. If I'm correct, we need to leave note somewhere. @escopecz What do you think?

@escopecz
Copy link
Sponsor Member

escopecz commented Jan 7, 2020

Yep, a note about a BC break in the Gdoc

@hluchas
Copy link
Contributor

hluchas commented Jan 7, 2020

Yep, a note about a BC break in the Gdoc

Done on page 2

@hluchas hluchas self-requested a review January 7, 2020 13:04
Copy link
Contributor

@hluchas hluchas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hluchas hluchas added this to the 3.0.0 milestone Jan 7, 2020
@hluchas hluchas removed pending-feedback PR's and issues that are awaiting feedback from the author ready-to-test PR's that are ready to test labels Jan 7, 2020
@escopecz escopecz merged commit b53f5a9 into mautic:3.x Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants