Skip to content

Magento installation process disregards cache id_prefix settings defined in env.php (without specify settings via installer options) #22253

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
cmacdonald-au opened this issue Apr 10, 2019 · 7 comments
Labels
Component: Setup Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. stale issue

Comments

@cmacdonald-au
Copy link
Contributor

cmacdonald-au commented Apr 10, 2019

Preconditions (*)

  1. A copy of Magento, (either installed, or not) >= 2.3.1
  2. An app/etc/env.php file that contains cache settings, (example attached, specifically an id_prefix not based on path must be set).
  3. Execute ./bin/magento setup:install or ./bin/magento setup:install --cleanup-database (with no other parameters specified).

This behaviour appears to be a side effect of the changes introduced in #18641

Steps to reproduce (*)

Either:

  1. starting from a fresh (uninstalled) Magento2 installation; Take an app/etc/env.php from a previously installed system and:
  • remove install_date.
  • change the cache id_prefix values to something not based on path.
  1. using a previously installed version of magento, change the cache id_prefix values to something not based on path and flush cache.

Then:

  1. Execute ./bin/magento setup:install (use --cleanup-database to test against a previously installed copy)
  2. compare the updated app/etc/env.php with the original and you will see the cache related id_prefix values have changed.

Expected result (*)

  1. The id_prefix that was provided within env.php prior to installation must be unchanged

Actual result (*)

  1. The id_prefix has been replaced by the output of Magento\Setup\Model\ConfigOptionsList\Cache::generateCachePrefix()

Supporting information

Example "starter" env.php file: preinstall-env.php.txt

Resulting diff;

➜  m2 git:(2.3-develop) diff -ub app/etc/preinstall-env.php.txt app/etc/env.php
--- app/etc/preinstall-env.php.txt	2019-04-10 12:15:51.000000000 +1000
+++ app/etc/env.php	2019-04-10 12:28:39.000000000 +1000
@@ -83,7 +83,7 @@
     'cache' => [
         'frontend' => [
             'default' => [
-                'id_prefix' => 'm2l_',
+                'id_prefix' => '74c_',
                 'backend' => 'Cm_Cache_Backend_Redis',
                 'backend_options' => [
                     'server' => '127.0.0.1',
@@ -95,7 +95,7 @@
                 ]
             ],
             'page_cache' => [
-                'id_prefix' => 'm2l_',
+                'id_prefix' => '74c_',
                 'backend' => 'Cm_Cache_Backend_Redis',
                 'backend_options' => [
                     'server' => '127.0.0.1',
@@ -127,6 +127,6 @@
         'vertex' => 1
     ],
     'install' => [
-        'date' => ''
+        'date' => 'Wed, 10 Apr 2019 02:28:34 +0000'
     ]
 ];

Why this matters..

Our CI/CD processes manage the propagation of settings upwards and outwards. This extends to unattended installations as well as new production deployments.

All of our systems have the opportunity to share cache instances (as either cost or convenience measures) and - as per the database table prefix setting - we rely on being able to control the cache id_prefix settings to ensure they support the purpose they were introduced for.

@m2-assistant
Copy link

m2-assistant bot commented Apr 10, 2019

Hi @cmacdonald-au. 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-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

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

@cmacdonald-au do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@m2-assistant
Copy link

m2-assistant bot commented Apr 10, 2019

Hi @cmacdonald-au. 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-engcom-team 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. Verify that the issue is reproducible on 2.2-develop branch.
    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 10, 2019
@cmacdonald-au cmacdonald-au added the Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release label Apr 10, 2019
@ghost ghost self-assigned this Apr 15, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2019

Hi @engcom-backlog-nazar. 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-engcom-team 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. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

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

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

@ghost ghost added 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 labels Apr 15, 2019
@ghost ghost removed their assignment Apr 15, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-backlog-nazar
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-99209 were created

Issue Available: @engcom-backlog-nazar, 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 Apr 15, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2019

Hi @cmacdonald-au. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

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

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

    Details- Add the comment @magento-engcom-team 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!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ghost ghost unassigned cmacdonald-au May 22, 2019
@ghost ghost removed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 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 labels Oct 20, 2020
@magento-engcom-team magento-engcom-team added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Nov 30, 2020
@stale
Copy link

stale bot commented Feb 15, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@stale stale bot added the stale issue label Feb 15, 2021
@magento-engcom-team
Copy link
Contributor

Hi @cmacdonald-au.

Thank you for your report and collaboration!

The related internal Jira ticket MC-24377 was closed as Fixed.

The fix will be available with the upcoming 2.4.3 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Setup Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. stale issue
Projects
Development

No branches or pull requests

3 participants