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

Magento2 don't work with redis in cluster mode #35140

Closed
1 of 5 tasks
ByJacob opened this issue Feb 25, 2022 · 16 comments
Closed
1 of 5 tasks

Magento2 don't work with redis in cluster mode #35140

ByJacob opened this issue Feb 25, 2022 · 16 comments
Labels
Area: Framework Component: Bundled Extension Issue is caused by one of the bundled extensions Component: Cache Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: needs update Additional information is require, waiting for response Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@ByJacob
Copy link

ByJacob commented Feb 25, 2022

Preconditions (*)

  1. Magento 2.4.3
  2. Redis 6 configured in cluster mode (or use AWS ElastiCache in cluster mode with 3 masters)

Steps to reproduce (*)

  1. Run magento
  2. Configure redis config and cache (redis is configured in cluster mode)

Expected result (*)

  1. All ./bin/magento comands works correct and return status code 0
  2. Cache in redis works

Actual result (*)

  1. magento command returns status code 1 with error text, example MOVED 2482 122[IP:PORT]
  2. Cache don't work

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Feb 25, 2022

Hi @ByJacob. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

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

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-assistant
Copy link

m2-assistant bot commented Feb 25, 2022

Hi @engcom-Delta. 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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-Delta engcom-Delta added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Feb 25, 2022
@engcom-Delta engcom-Delta removed their assignment Feb 25, 2022
@magenx
Copy link

magenx commented Feb 27, 2022

@engcom-Hotel engcom-Hotel self-assigned this Feb 28, 2022
@m2-assistant
Copy link

m2-assistant bot commented Feb 28, 2022

Hi @engcom-Hotel. 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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-Hotel
Copy link
Contributor

Hello @ByJacob,

I hope your problem has been solved by going through the documentation link in this comment.

Thanks

@engcom-Hotel engcom-Hotel added the Issue: needs update Additional information is require, waiting for response label Mar 4, 2022
@ByJacob
Copy link
Author

ByJacob commented Mar 4, 2022

Unfortunately, that does not solve the problem. The documentation only shows the different methods for configuring ElastiCache and how to connect to it when Cluster Mode is turned off and on.
My probleme is that I cannot configure redis backend when redis is running with cluster mode enabled.

Without special cluster handling, the master switches during writing, which the current php code interprets as an error. For example, in the redis-cli command, use the special -c flag so that it can properly communicate with the redis cluster.

@engcom-Hotel
Copy link
Contributor

Hello @ByJacob,

Thanks for the confirmation!

We have tried to reproduce the issue by following the Redis cluster documentation here. And after setting up the Redis cache by following the Magento docs, we are able to reproduce the issue in the latest Magento 2.4-develop branch.

Please have a look at the below screenshot for reference:

image

Hence confirming this issue.

Thanks

@engcom-Hotel engcom-Hotel added Area: Framework Component: Cache Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Mar 7, 2022
@m2-community-project m2-community-project bot removed the Issue: needs update Additional information is require, waiting for response label Mar 7, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-2565 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Mar 7, 2022

✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Hotel engcom-Hotel added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Mar 8, 2022
@engcom-Hotel
Copy link
Contributor

Hello @ByJacob,

We have further investigated this issue and we have integrated the Redis cluster in app/etc/env.php. (Attached is the screenshot for the same):

image

Below are the points that come up in the investigation:

  • The function which is used for redis cluster setup in credis_client is in the ColinMollenHour module, is not using it anymore which is also mentioned in the code in file vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php line no 436.
  • Credis client method 'isMulti' which needs to be 'TRUE' in order to work with redis cluster and the default value is set as 'False' in file vendor/colinmollenhour/credis/Client.php. The exception is thrown when __call function is called from Credis_Client class for 'hGet' before 'multi' hence not converting isMulti = 'True'.

image

image

image

Hence the issue is not related to the Magento core library.

Thanks

@engcom-Hotel engcom-Hotel added Component: Bundled Extension Issue is caused by one of the bundled extensions Issue: needs update Additional information is require, waiting for response labels Apr 26, 2022
@ByJacob
Copy link
Author

ByJacob commented Apr 26, 2022

Hello,
So one question, why was colinmollenhour/Cm_Cache_Backend_Redis used instead of the more elaboratepredis/predis, since predis supports almost all redis functionality?
And another question, what does Component: Bundled Extension mean. Waiting as the library to have this functionality? If so, why not use predis which has php 8.1 support already (predis/predis@acb2460)?

@engcom-Hotel
Copy link
Contributor

Hello @ByJacob,

Hence this issue is not related to Magento core code, so I suggest you refer to the Community Forums or Magento Stack Exchange for technical questions, feature requests, etc.

Thanks

@robsoned
Copy link

robsoned commented May 20, 2022

As on the way it's implemented right now, it causes an issue to integrate with redis, a system requirement to run the application on production with good performance. With that said, why this issue would not be related to Magento core code?

@github-jira-sync-bot github-jira-sync-bot added Progress: PR Created Indicates that Pull Request has been created to fix issue and removed Progress: ready for grooming labels Nov 23, 2022
@engcom-Hotel
Copy link
Contributor

Hello,

The related issue has been fixed now and is unable to reproduce on the latest development branch i.e. 2.4-develop. Hence closing this ticket.

Thanks

@m2-community-project m2-community-project bot added Progress: done and removed Progress: PR Created Indicates that Pull Request has been created to fix issue Progress: PR in progress labels Dec 9, 2022
@vishwanathkharabe
Copy link

Hi @engcom-Hotel ,
Earlier you were able to reproduce this issue,
#35140 (comment)
but in your latest comment #35140 (comment)
you said it is fixed. Can we know what changes you made to fix this, is there any PR ?
Thanks!

@devops-digitalsilk
Copy link

I still have the same issue, version 2.4.3-p3. Configuration the cluster always returning MOVED in the first line of magento bin composer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Bundled Extension Issue is caused by one of the bundled extensions Component: Cache Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: needs update Additional information is require, waiting for response Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Archived in project
Development

No branches or pull requests

8 participants