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

Switching off FPC causes config key collision (beta) #1808

Closed
amenk opened this issue Sep 7, 2015 · 12 comments
Closed

Switching off FPC causes config key collision (beta) #1808

amenk opened this issue Sep 7, 2015 · 12 comments

Comments

@amenk
Copy link
Contributor

amenk commented Sep 7, 2015

Steps to reproduce:

  1. Disable a cache (full page cache in backend)

  2. Now the cache settings are written to env.php

  3. On the next page view, I get the following error:

    exception 'Exception' with message 'Key collision! The following keys occur in multiple config files: cache_types 
    ' in /home/me/workspace/example.com/public/lib/internal/Magento/Framework/App/DeploymentConfig/Reader.php:91 Stack
     trace: #0 /home/me/workspace/example.com/public/lib/internal/Magento/Framework/App/DeploymentConfig.php(130):
     Magento\Framework\App\DeploymentConfig\Reader->load() #1 /home/me/workspace/example.com/public/lib/internal/Magento
    /Framework/App/DeploymentConfig.php(72): Magento\Framework\App\DeploymentConfig->load() #2 /home/me/workspace/example.com
    /public/lib/internal/Magento/Framework/App/ObjectManagerFactory.php(112): Magento\Framework\App\DeploymentConfig->get() #3 
    /home/me/workspace/example.com/public/lib/internal/Magento/Framework/App/Bootstrap.php(384): Magento\Framework\App
    \ObjectManagerFactory->create(Array) #4 /home/me/workspace/example.com/public/lib/internal/Magento/Framework/App/Bootstrap.php(231): 
    Magento\Framework\App\Bootstrap->initObjectManager() #5 /home/me/workspace/example.com/public/index.php(38): 
    Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #6 {main}
    

What I saw is, that the cache_types section is in env.php as well as config.php. I actually was expecting, that config file merging / overwriting of values should work?

@mazhalai
Copy link
Contributor

mazhalai commented Sep 8, 2015

@amenk This error happens if you had an older version of magento 2 when config was saved only in config.php. Now config.php only has module related info. There is no way to accurately determine which is the correct set to overwrite values.

@amenk
Copy link
Contributor Author

amenk commented Sep 8, 2015

I started with the merchant beta ...

@mazhalai
Copy link
Contributor

mazhalai commented Sep 8, 2015

@amenk can you give us detailed steps to reproduce this issue? We are having trouble reproducing it.

@amenk
Copy link
Contributor Author

amenk commented Sep 9, 2015

As far as I remember, I did a composer based installation of Magento and then tried to change the cache settings.

@monkeysee
Copy link
Contributor

@amenk , I tried to reproduce, but could not. The steps I tried were:

  1. composer create-project magento/project-community-edition --stability="beta" magento2Proj
  2. Ran through the setup wizard
  3. Examined config files
  • app/etc/config.php, only contains array of enabled modules
  • app/etc/env.php contains other settings, including 'full_page' => 1 in cache_types array
  1. Went to admin and disabled full page cache
  2. Went to front end, pages loaded OK
  3. Went to other pages in Admin, they are OK also
  4. examined config files:
  • app/etc/config.php, still only contains array of enabled modules
  • app/etc/env.php contains other settings, including 'full_page' => 0 in cache_types array

There was a time when we only had config.php, and all settings were in there. When we split the config it was necessary to reinstall to get everything in the right place. Is it possible you had an old version of config.php? or some files in the var/generation directory from an older install? You shouldn't have anything else in config.php other than the array of modules.

env.php and config.php are not merged, rather they have different entries in them. If you have the same entry in both, then you see the error you are getting.

@amenk
Copy link
Contributor Author

amenk commented Sep 10, 2015

I am having "magento/product-community-edition": "1.0.0-beta" - when I install now it is -beta2
Maybe there was that change?

@amenk
Copy link
Contributor Author

amenk commented Sep 10, 2015

This is all pretty confusing as there are no -beta1 and -beta2 tags in this (magento/magento2/) github repository...

@monkeysee
Copy link
Contributor

I tried with the 1.0.0-beta and still no failure. The split of the config files took place before 1.0.0-beta. Did you ever install before 1.0.0-beta?
If you edit the config files so that config.php only has the 'modules' array, and env.php has everything else, it should work on 1.0.0-beta and beyond.

@amenk
Copy link
Contributor Author

amenk commented Sep 11, 2015

I did a fresh installation at 2015-08-24. I will try to edit the config files and see what happens.

@amenk
Copy link
Contributor Author

amenk commented Sep 11, 2015

I am not sure, but I might have tried to switch caching with n98-magerun2.phar - maybe there is or was an issue.

@amenk
Copy link
Contributor Author

amenk commented Sep 11, 2015

Putting the cache config to env.php solved the problem.
So it's not reproducible. Not worth the effort. I am closing this.
@monkeysee thanks a lot for your help.

@amenk amenk closed this as completed Sep 11, 2015
@monkeysee
Copy link
Contributor

NP, @amenk, glad you got it going. We'll keep an eye out for this in the future.

magento-team pushed a commit that referenced this issue Dec 7, 2017
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-84981: Trying to get data from non existent products #12539
 - MAGETWO-84979: [Backport 2.2-develop] Fix swagger-ui on instances of Magento running on a non-standard port #12541
 - MAGETWO-84903: Added namespace to product videos fotorama events #12469
 - MAGETWO-84862: [Backport 2.2-develop] #11409: Too many password reset requests even when disabled in settings #11435
 - MAGETWO-84856: Issue 12506: Fixup typo getDispretionPath -> getDispersionPath #12507
 - MAGETWO-84808: 12110: Missing cascade into attribute set deletion. #12167
 - MAGETWO-83503: [2.2] - Add command to view mview state and queue #12122
 - MAGETWO-80223: Fix syntax of expectException() calls #11099
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

4 participants