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

404 error while submitting request #191

Open
volodymyrss opened this issue Jan 27, 2023 · 15 comments
Open

404 error while submitting request #191

volodymyrss opened this issue Jan 27, 2023 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@volodymyrss
Copy link
Member

volodymyrss commented Jan 27, 2023

experienced by @rokroskar , was not seen/report recently by anyone else, hard to track, bad experiene

image

edit: we'll wait for extra details

@volodymyrss volodymyrss added the bug Something isn't working label Jan 27, 2023
@volodymyrss
Copy link
Member Author

it happens while using https://www.astro.unige.ch/mmoda and not https://www.astro.unige.ch/mmoda/. It's kind of critical @burnout87 @motame

@motame
Copy link
Contributor

motame commented Jan 27, 2023

It's not clear !
Where is this link used ? (https://www.astro.unige.ch/mmoda)

@volodymyrss
Copy link
Member Author

volodymyrss commented Jan 27, 2023

It's not clear ! Where is this link used ? (https://www.astro.unige.ch/mmoda)

it could be typed or used randomly by anyone. It actually opens the frontend. But the request to dispatcher is not correct.

edit: I meant, if this link is used to access frontend, no requests to dispatcher from the apparently normal frontend session can work

@motame
Copy link
Contributor

motame commented Jan 27, 2023

Typing https://www.astro.unige.ch/mmoda in a browser returns the right content.
Would you describe a scenario ?

@volodymyrss
Copy link
Member Author

Typing https://www.astro.unige.ch/mmoda in a browser returns the right content. Would you describe a scenario ?

that's why it's deceptive. In this "right" content, it is not possible to submit an request. Try "submit"

@motame
Copy link
Contributor

motame commented Jan 27, 2023

Ah Ok, I see !

@motame
Copy link
Contributor

motame commented Jan 27, 2023

I'm on it ...

@motame
Copy link
Contributor

motame commented Jan 27, 2023

In fact, I've never seen it because my apache config is adding the trailing slash once the user press enter :-)
https://cdcidev.mtmco.net/mmoda
I'm trying to desactivate this on my dev instance ;)

@motame
Copy link
Contributor

motame commented Jan 31, 2023

The issue is more complex than expected as discussed in the last meeting (30/01/2023).
On my dev instance, the module mod_dir of apache is enabled (as recommended).
By default it does redirect URLs of directories without a trailing slash to the ones with a slash !
Example:
It does redirect https://cdcidev.mtmco.net/mmoda to https://cdcidev.mtmco.net/mmoda/
The first request with https://cdcidev.mtmco.net/mmoda returns a redirect (status code 301) to https://cdcidev.mtmco.net/mmoda/ which is then requested by the browser.
This behavior is controlled by a directive called DirectorySlash.

  • Description: Toggle trailing slash redirects on or off
  • Syntax: DirectorySlash On|Off|NotFound
  • Default: DirectorySlash On
<Location "/some/path">
  DirectorySlash Off
  SetHandler some-handler
</Location>

In mod_dir documentation it's not recommended to set this parameter to Off. They pointout to security warning.

Even it's recommended to have a trailing slash for URLs pointing to directories, it does not matter to have it or not. Search engines do handle properly both URLs. However it's highly recommended to not return the content for both but choose one as canonical and redirect the second to the first one.
There are situations were the returned content may be different and then both URLs may be indexed and visit statistics will be spread between the two.
More details in the article "To slash or not to slash" written by a former Developer Programs Tech Lead, Maile Ohye.

In the light of the above, I recommend to use the URL with a trailing slash (https://cdcidev.mtmco.net/mmoda/) as the canonical one and redirect the one without (https://cdcidev.mtmco.net/mmoda) to it. This can be easily achieved by enabling the Apache module mod_dir (in the case of Apache web server).

@dsavchenko
Copy link
Member

My (somewhat old) installation of frontend in k8s in France https://sbgvm-151-156.in2p3.fr/mmoda redirects properly

@motame
Copy link
Contributor

motame commented Jan 31, 2023

Perfect ! Your instance behaves exactly as described above.

@volodymyrss
Copy link
Member Author

My (somewhat old) installation of frontend in k8s in France https://sbgvm-151-156.in2p3.fr/mmoda redirects properly

could you @dsavchenko please make the necessary adaptation to https://github.com/oda-hub/frontend-chart ?

@dsavchenko
Copy link
Member

could you @dsavchenko please make the necessary adaptation to https://github.com/oda-hub/frontend-chart ?

But I don't see any difference in the apache config that could affect this behavior between my installation and the current version. Current chart therefore should work properly. Are you sure the problem in prod originates there?

I will check it directly, of course.

@volodymyrss
Copy link
Member Author

I can try to adapt it on apache level, but still it appears unfortunate that while the frontend page loads, the request fails. I think it might be possible to add redundancy at the drupal module level to send the request to the right place?

@dsavchenko
Copy link
Member

We have just got the "demonstrator effect" with this issue on unige instance

I verified, that my French staging instance is always redirecting to the address with the trailing slash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants