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
Occasionally getting JSON strings on category pages #28237
Comments
I've exact the same issue at some specific category pages. Has anyone find a solution? |
I'm experiencing the same issue here, I thought it was the Amasty Extension Layered Navigation, but is still happening without the extension, definitely is something related with Varnish and Magento Core, and clearly this happens on a random way, and there is not a pattern or clue about how to reproduce it. Does someone have any clue about it? thank you very much in advance. Apache version: Apache/2.4.6 (CentOS) Update: If you are having the same issue, please could you let us know your current request flow?, I'm pretty sure this is a forwarding/redirect request issue with Magento of course. Apache Proxy SSL Termination + Varnish = Same Server The current setup is, Client -> CloudFlare (free) -> Apache (Proxy SSL termination) -> Varnish -> Magento Thanks, |
I have found the cause and the solution. The cause is that when Varnish is cleared and a user comes to a filtered page first, the JSON is cached. I have excluded this for Varnish and this solved the problem. |
@jbclaudio |
Wow, great job! Would you please share with us your VCL rules? |
@jbclaudio That sounds great, but I'm curious because I've tried disabling Varnish and this still happening, are you completely sure is fixed? Did you were able to reproduce the issue to verify if the fix is real? I would like to think that you are our savior in this very rare issue :P, and as our bug-mates said, please could you show us that portion of the VCL file?, thanks |
On second thought, I could not figure out the relationship between the filtered page and the unfiltered page. And I tried to follow your findings, but still could not find a way to 100% reproduce the issue as well. |
I've added this to the .vcl file:
This project uses the Amasty Shopby module. This added the parameter to the filter pages, which I could use. You may be able to use another parameter that Magento itself adds. After this has been added to the .vcl file, the problem no longer occurs. |
I just encountered this and was able to quickly resolve it, so I thought I would share my solution here: I just reran the |
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! |
This happened, today, on our site and don't have Amasty. |
Same here... I do found out that it is a combination of google pagespeed and varnish in my case.. and it is only on specific category pages... Really strange behaviour not using amasty shopby |
Encountered this issue today on a category with many products. Clearing block_html cache resolved the issue. Magento 2.4.0 Open Source We are NOT using Varnish and instead just Magento built-in FPC, so the issue is not specific to Varnish, nor the Amasty ShopBy module as other comments have cited. What might of interest is that we are using Smile's ElasticSuite which results in all categories being treated as Layered Navigation categories. Perhaps layered navigation, Elasticsearch and Magento's FPC are the culprit here? Prior to one of our team members informing me of this error, I received a number of 503 Exception emails due to a session_start failure: One of the URL's cited in the 503 Exception emails was indeed the category that suffered the "JSON Output" titular bug. Unfortunately I did not test the other URLs for which I received an email prior to cleaning the block_html cache. Very scary issue to encounter "randomly" with no means of testing / troubleshooting / workaround besides from regularly cleaning of block cache.... obviously not desirable for performance.... but the lesser of two evils for sure!!! |
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! |
I've he same issue at some specific category pages. Has anyone find a solution? |
The JSON response can be triggered by requesting the category-page with the header |
This is the key! I've the same issue after enabling multiple currencies in my site (2.3.5 + varnish + apache), randomly this error appears in random categories. Adding:
to vcl_hash solve the problem for me. |
We have encountered this issue on a few different Magento projects. We understand we may not have sufficient information or very clear procedures for reproducing the issue, but as this turned out to be quite annoying and we have no clue about the root cause at all, we still decided to raise this here. And we have seen similar issues on StackOverflow.
Preconditions (*)
Case 1:
Case 2:
Steps to reproduce (*)
Expected result (*)
Actual result (*)
It happened (seemingly) randomly, and after restarting the varnish service, the issue would be gone.
The text was updated successfully, but these errors were encountered: