magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Magento admin does not work when a port number is included in the URL. Gets stuck in redirect loop.

Open Jammmmm opened this issue 7 years ago • 5 comments

Issue Summary

Using a custom port during Magento installation causes the admin page to be inaccessible. Browser gets stuck in a redirect loop.

Preconditions

  • Magento 2.3.0
  • Ubuntu 18.10 Server
  • Apache 2.4.37
  • MySQL Community Server 8.0.13
  • PHP-FPM 7.2.13

Steps to reproduce

  • Set web server to listen on a custom port, such as 8899
  • Download and unpack Magento 2.3.0 from Github releases page: https://github.com/magento/magento2/releases
  • Create the database and user, and assign that user to the database with the required permissions.
  • Visit the URL to the unpacked directory, such as http://example.com:8899/magento2-2.3.0/
  • Proceed through installation until Step 3: Web Configuration. "Your Store Address" is incorrectly set since it does not have the port number included in the URL. Change it to include the port number. http://example.com/magento2-2.3.0/ becomes http://example.com:8899/magento2-2.3.0/
  • Complete installation
  • Visit the admin URL, such as http://example.com:8899/magento2-2.3.0/admin_8x487z

Expected result

Magento admin login page should be displayed

Actual result

Browser is stuck in a "ERR_TOO_MANY_REDIRECTS" loop. Message given (in Chrome) is:

This page isn't working

example.com redirected you too many times. Try clearing your cookies.

ERR_TOO_MANY_REDIRECTS

Additional Notes

  • Accessing the frontend of the site at http://example.com:8899/magento2-2.3.0/ works fine.
  • Installing without a port number included (eg. http://example.com/magento2-2.3.0/) works fine. That said, I don't have that option and need to include a port number in the URL.
  • I have tried multiple browsers (with cookies cleared), changing options in the database (base_url, use_in_frontend, use_in_adminhtml, cookie_domain, etc) and have cleared the Magento cache. Nothing works unless the port number is removed from the URL.
  • Definitely seems like a bug that needs to be fixed.

Jammmmm avatar Jan 07 '19 18:01 Jammmmm

Hi @Jammmmm. 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 $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop). For more details, please, review the Magento Contributor Assistant documentation.

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

  • [ ] yes
  • [ ] no

magento-engcom-team avatar Jan 07 '19 18:01 magento-engcom-team

Hi @Jammmmm. Thank you for your report. To help us process this issue please make sure that you provided the following information:

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

All of the above has been provided.

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

  • [x] yes
  • [ ] no

Yes.

Jammmmm avatar Jan 07 '19 18:01 Jammmmm

Hi @milindsingh. 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: :point_down:

  • [x] 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.

  • [x] 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.

  • [x] 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.

magento-engcom-team avatar Jan 07 '19 19:01 magento-engcom-team

@Jammmmm I am not able to reproduce in 2.3.

milindsingh avatar Jan 08 '19 06:01 milindsingh

Hi,

As @Jammmmm reported, I have been experiencing problem accessing a similar problem. I am however using Magento 2.4.2 and loaded with bin/magento sampledata:deploy.

The browser (Firefox or Chrome) goes into an "endless" redirect loop (~20) before the browser notices the pattern and stops making the same request. The issue started after I added non-standard port 8443 to the base URLs of my HTTPS requests. As long as the standard port is used and therefore not included on the URL, the admin pages are render fine. With port 8443, the redirect error appears. Unfortunately for my use case, the port needs to be defined something other than the standard 443.

Portions of core_config_data table:

config_id scope scope_id path value updated_at
32 default 0 admin/url/custom https://ddev-magento2.ddev.site:8443/ 2021-04-20 18:10:24
31 default 0 admin/url/use_custom 1 2021-04-20 17:11:12
23 default 0 admin/usage/enabled 1 2021-04-19 13:45:15
30 default 0 web/secure/base_url https://ddev-magento2.ddev.site:8443/ 2021-04-20 18:10:49
33 stores 0 web/secure/base_url https://ddev-magento2.ddev.site:8443/ 2021-04-20 18:10:59
4 default 0 web/unsecure/base_url https://ddev-magento2.ddev.site:8443/ 2021-04-20 18:11:09
34 stores 0 web/unsecure/base_url https://ddev-magento2.ddev.site:8443/ 2021-04-20 18:11:25

AdvThanksance!!!

kwiechmann avatar Apr 20 '21 18:04 kwiechmann