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

Development Errors Result in Too Many Redirects #1310

Closed
astorm opened this issue May 27, 2015 · 4 comments
Closed

Development Errors Result in Too Many Redirects #1310

astorm opened this issue May 27, 2015 · 4 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update

Comments

@astorm
Copy link

astorm commented May 27, 2015

When an error/uncaught-exception occurs Magento 2, with developer mode on, the current system behavior is to redirect the user to the home page, and then the home page will display the error/exception message.

This often creates a "too many redirects" problem

The "too many redirects" problem happens if

  • There's an error during Magento's homepage loading
  • There's an error with/in an observer for an event that fires on every page

There are myriad ways this can and will crop up during regular development, but the easiest way to reproduce the problem is

  1. Configure your system so developer mode is on
  2. Open the app/code/Magento/PageCache/etc/events.xml file
  3. Find the Magento\PageCache\Model\Observer\RegisterFormKeyFromCookie text
  4. Temporarily simulate a mis-configuration by changing this to Magento\PageCache\Model\Observer\RegisterFormKeyFromCookiee
  5. Clear your configuration cache
  6. Reload any page in the system

Expected Behavior: The browser displays the text, along with a Stack Trace

Class Magento\PageCache\Model\Observer\RegisterFormKeyFromCookiee does not exist [] []

Actual Behavior: Browser gets caught in a redirect loop, resulting in a "This webpage has a redirect loop" error

screen shot 2015-05-26 at 6 38 19 pm

While error handling is a complex problem, at minimum it's reasonable for a developer/programmer to expect their PHP error be displayed on the screen when developer mode is enabled. With error handling being such a multifaceted thing that touches many different aspects of the system, this sort of change is probably best handled by the core and/or development leadership team. If not coded by them directly "the right" solution ultimately needs to come from a central authority.

While this is also undesired behavior for non developer mode, the issue has not been researched there, and if present may require a different solution in that context.

@mazhalai
Copy link
Contributor

@astorm thank you for reporting this issue. We have created ticket MAGETWO-37969 to investigate this issue.

@mazhalai mazhalai added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development PS labels May 27, 2015
@antonkril
Copy link
Contributor

I saw this behavior confuse all developers new to M2 on hackathon. So I think it should be high priority.

@piotrekkaminski
Copy link
Contributor

Fully agree - needs to be fixed

@vpelipenko
Copy link
Contributor

@astorm, fix is already available on here on public GitHub. Are you OK with provided changes?

cpartica pushed a commit that referenced this issue Jul 14, 2017
Fixed issue:
- MAGETWO-69606 Conflict between BaseUrl Change and Re-Sign Up functionality in the Analytics module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update
Projects
None yet
Development

No branches or pull requests

5 participants