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

Removing websites or stores together with their configuration from config.php fails #24061

Closed
schmengler opened this issue Aug 8, 2019 · 5 comments
Labels
Component: Config Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@schmengler
Copy link
Contributor

Preconditions (*)

  • Magento 2.3.2 (and probably all earlier versions)
  • websites and stores created via scopes section in app/etc/config.php
  • any configuration on website level (e.g. base urls) in the system section in app/etc/config.php

Steps to reproduce (*)

  1. remove a website together with its scope specific configuration from app/etc/config.php
  2. run bin/magento app:config:import

Expected result (*)

  1. The website is removed
  2. Other configuration updates are applied
  3. The shop continues to work

Actual result (*)

  1. The website is removed
  2. The command aborts with error message: "The website with code xxx that was requested wasn't found. Verify the website and try again."
  3. The shop throws an error: "Config files have changed. Run app:config:import or setup:upgrade command to synchronize configuration."

Stack trace from exception log:

         "trace" : [
            "/var/www/html/src/vendor/magento/module-deploy/Console/Command/App/ConfigImport/Processor.php:146",
            "/var/www/html/src/vendor/magento/module-deploy/Console/Command/App/ConfigImportCommand.php:63",
            "/var/www/html/src/vendor/symfony/console/Command/Command.php:255",
            "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:58",
            "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:138",
            "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:153",
            "/var/www/html/src/generated/code/Magento/Deploy/Console/Command/App/ConfigImportCommand/Interceptor.php:104",
            "/var/www/html/src/vendor/symfony/console/Application.php:893",
            "/var/www/html/src/vendor/symfony/console/Application.php:262",
            "/var/www/html/src/vendor/magento/framework/Console/Cli.php:105",
            "/var/www/html/src/vendor/symfony/console/Application.php:145",
            "/var/www/html/src/bin/magento:23"
         ],
         "class" : "Magento\\Framework\\Exception\\State\\InvalidTransitionException",
         "previous" : {
            "class" : "Magento\\Framework\\Exception\\RuntimeException",
            "code" : 0,
            "previous" : {
               "class" : "Magento\\Framework\\Exception\\NoSuchEntityException",
               "code" : 0,
               "file" : "/var/www/html/src/vendor/magento/module-store/Model/WebsiteRepository.php:81",
               "message" : "The website with code eu that was requested wasn't found. Verify the website and try again.",
               "trace" : [
                  "/var/www/html/src/generated/code/Magento/Store/Model/WebsiteRepository/Interceptor.php:24",
                  "/var/www/html/src/vendor/magento/module-store/Model/StoreManager.php:209",
                  "/var/www/html/src/generated/code/Magento/Store/Model/StoreManager/Interceptor.php:102",
                  "/var/www/html/src/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:135",
                  "/var/www/html/src/vendor/magento/module-store/Model/Resolver/Website.php:31",
                  "/var/www/html/src/vendor/magento/module-config/Model/PreparedValueFactory.php:125",
                  "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer/SaveProcessor.php:101",
                  "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer/SaveProcessor.php:67",
                  "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer.php:131",
                  "{\"function\":\"Magento\\\\Config\\\\Model\\\\Config\\\\{closure}\",\"class\":\"Magento\\\\Config\\\\Model\\\\Config\\\\Importer\",\"type\":\"->\",\"args\":[]}",
                  "/var/www/html/src/vendor/magento/framework/App/State.php:187",
                  "/var/www/html/src/generated/code/Magento/Framework/App/State/Interceptor.php:89",
                  "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer.php:132",
                  "/var/www/html/src/vendor/magento/module-deploy/Console/Command/App/ConfigImport/Processor.php:146",
                  "/var/www/html/src/vendor/magento/module-deploy/Console/Command/App/ConfigImportCommand.php:63",
                  "/var/www/html/src/vendor/symfony/console/Command/Command.php:255",
                  "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:58",
                  "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:138",
                  "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:153",
                  "/var/www/html/src/generated/code/Magento/Deploy/Console/Command/App/ConfigImportCommand/Interceptor.php:104",
                  "/var/www/html/src/vendor/symfony/console/Application.php:893",
                  "/var/www/html/src/vendor/symfony/console/Application.php:262",
                  "/var/www/html/src/vendor/magento/framework/Console/Cli.php:105",
                  "/var/www/html/src/vendor/symfony/console/Application.php:145",
                  "/var/www/html/src/bin/magento:23"
               ]
            },
            "file" : "/var/www/html/src/vendor/magento/module-config/Model/PreparedValueFactory.php:146",
            "trace" : [
               "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer/SaveProcessor.php:101",
               "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer/SaveProcessor.php:67",
               "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer.php:131",
               "{\"function\":\"Magento\\\\Config\\\\Model\\\\Config\\\\{closure}\",\"class\":\"Magento\\\\Config\\\\Model\\\\Config\\\\Importer\",\"type\":\"->\",\"args\":[]}",
               "/var/www/html/src/vendor/magento/framework/App/State.php:187",
               "/var/www/html/src/generated/code/Magento/Framework/App/State/Interceptor.php:89",
               "/var/www/html/src/vendor/magento/module-config/Model/Config/Importer.php:132",
               "/var/www/html/src/vendor/magento/module-deploy/Console/Command/App/ConfigImport/Processor.php:146",
               "/var/www/html/src/vendor/magento/module-deploy/Console/Command/App/ConfigImportCommand.php:63",
               "/var/www/html/src/vendor/symfony/console/Command/Command.php:255",
               "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:58",
               "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:138",
               "/var/www/html/src/vendor/magento/framework/Interception/Interceptor.php:153",
               "/var/www/html/src/generated/code/Magento/Deploy/Console/Command/App/ConfigImportCommand/Interceptor.php:104",
               "/var/www/html/src/vendor/symfony/console/Application.php:893",
               "/var/www/html/src/vendor/symfony/console/Application.php:262",
               "/var/www/html/src/vendor/magento/framework/Console/Cli.php:105",
               "/var/www/html/src/vendor/symfony/console/Application.php:145",
               "/var/www/html/src/bin/magento:23"
            ],
            "message" : "The website with code eu that was requested wasn't found. Verify the website and try again."
         },
         "code" : 0

The issue seems to be that Magento wants to remove configuration entries for websites after the websites have been removed and fails at that.

To work around it, I currently have to make two separate deployments, one where I remove the website specific configuration and a second where I remove the website.

@m2-assistant
Copy link

m2-assistant bot commented Aug 8, 2019

Hi @schmengler. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@schmengler do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 8, 2019
@engcom-Charlie engcom-Charlie self-assigned this Aug 8, 2019
@m2-assistant
Copy link

m2-assistant bot commented Aug 8, 2019

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Charlie engcom-Charlie added Component: Config Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Aug 8, 2019
@ghost ghost unassigned engcom-Charlie Aug 8, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Charlie
Thank you for verifying the issue. Based on the provided information internal tickets MC-19037 were created

Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 8, 2019
@magento-engcom-team
Copy link
Contributor

Hi @schmengler.

Thank you for your report and collaboration!

The issue was fixed by Magento team. The fix was delivered into magento/magento2:2.4-develop branch(es).
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Feb 4, 2020
@pushpendra07
Copy link

@magento-engcom-team Same error showing while we run index management, how can we solve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Config Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

4 participants