Skip to content

Conversation

Nazar65
Copy link
Member

@Nazar65 Nazar65 commented Apr 12, 2019

Description (*)

The root of the issue has to do with the fix for GitHub-15828 and how pub/health_check.php works. In the release notes for 2.3.1 it says

Magento now sets the id_prefix option on prefix cache keys for the cache frontend during installation. If this option is not set, Magento uses the first 12 bits of the md5 hash of the absolute path to the Magento app/etc directory. But if this value is not exactly the same on all web servers, cache invalidation will not work.

Fixed Issues (if relevant)

  1. Varnish health check failing due to presence of id_prefix in env.php #22143: Issue title

Manual testing scenarios (*)

  1. Install a fresh copy of Magento 2.3.1
  2. Configure the frontend cache to use Redis
  3. Export varnish.vcl from admin panel and configure Varnish to sit in front of Apache per instructions at https://devdocs.magento.com/guides/v2.3/config-guide/varnish/config-varnish-configure.html
  4. Try to load the site

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 12, 2019

Hi @Nazar65. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

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

@ghost ghost assigned orlangur Apr 12, 2019
@Nazar65
Copy link
Member Author

Nazar65 commented Apr 12, 2019

@orlangur i'm changed the solution, and add comment for better understanding. can you review changes ?

Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

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

Follow-up on Slack conversation with Nazar: we need a kind of health-check for cache type even when there is only one key in array.

@Nazar65 Nazar65 changed the title Varnish health check failing due to presence of id_prefix in env.php [WIP]Varnish health check failing due to presence of id_prefix in env.php May 4, 2019
@Nazar65
Copy link
Member Author

Nazar65 commented May 4, 2019

I'm will provide solution soon.

@gody01
Copy link

gody01 commented May 14, 2019

Hello,
this PR just jumps over Redis cache check. It doesn't actually check, if redis actually works.

@Nazar65
Copy link
Member Author

Nazar65 commented May 14, 2019

Hi @gody01 can you explain ?

@gody01
Copy link

gody01 commented May 14, 2019

Hi @gody01 can you explain ?

Sorry, my bad.
To fast on the keyboard. It seems OK.

@Nazar65 Nazar65 changed the title [WIP]Varnish health check failing due to presence of id_prefix in env.php Varnish health check failing due to presence of id_prefix in env.php May 15, 2019
@Nazar65
Copy link
Member Author

Nazar65 commented May 15, 2019

Hi @orlangur, this is my observation, issue comes from redis config check at this point ->

  if (!isset($cacheConfig[ConfigOptionsListConstants::CONFIG_PATH_BACKEND]) ||
            !isset($cacheConfig[ConfigOptionsListConstants::CONFIG_PATH_BACKEND_OPTIONS])) {
            http_response_code(500);
            $logger->error("Cache configuration is invalid");
            exit(1);
        }

So before there was not any configuration due to missing id_prefix, but after some PR we have this option as default, so this "if" statement was fails because hes not found config options for redis, but this is true because i'm have no redis configuration just varnish, but i have 500 error, so basically we need to run in to this statement when redis is configured, but how we could do that ? we just need to check if we have backed options then do the test_cache, and if we have only id_prefix that's means we have no any redis configured and dont need to check this configuration, and simply i check in iteration that current config have only 1 key and this key is id_prefix that means that this is default configuration, and have no redis, so we don't need to check backed options. And if not, we check the backed options and do the test config, and this is how it before. Hope that this will help to progress on this PR.

@Nazar65 Nazar65 requested a review from sivaschenko May 17, 2019 06:47
Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

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

Thank for your investigation @Nazar65!

@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-5143 has been created to process this Pull Request

@VasylShvorak
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented May 24, 2019

Hi @Nazar65, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

magento-engcom-team pushed a commit to okorshenko/magento2 that referenced this pull request May 24, 2019
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.3 milestone May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants