Project

General

Profile

tickets #119101

https://news.opensuse.org/tag/adaptablelinuxplatform gives 500 (internal server error)

Added by GeraldPfeifer 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Core services and infra
Target version:
-
Start date:
2022-10-20
Due date:
% Done:

0%

Estimated time:

Description

Hi folks,

following an old link to
https://news.opensuse.org/tag/adaptablelinuxplatform
I was surprised for news.opensuse.org to respond with error 500
(internal server error).

That page might not exist, or not exist any more, but wouldn't that
be a 404?

That made me curious, and indeed https://news.opensuse.org/asdfa or
any other page does not exist results in 500? Some server config issue?

Thanks,
Gerald

History

#1 Updated by hellcp 5 months ago

That config is out there, so you can take a look at it: https://code.opensuse.org/heroes/salt/blob/production/f/pillar/role/web_jekyll.sls it is quite complex, so I presume we are doing something wrong here

#2 Updated by pjessen 5 months ago

  • Category set to Core services and infra
  • Private changed from Yes to No

Other requests also produce a 500, for instance:

/favicon.ico
/robots.txt
/rss
/category/
/category/distribution/derivatives/medical/
/category/distribution/edu-life/
/category/distribution/leap/
/category/distribution/tumbleweed/
/category/project/events/
/category/project/events/osc/
/category/project/mentoring/gsoc/
/category/project/page/3/
/category/wiki-2/page/2/
/wp-content/uploads (miscellaneous)

At a quick glance, they all appear to be 'not found', so like Gerald suggests, they really ought to produce a 404.

Some are just due to faulty content:

/2010/09/wp-content/uploads/2010/09/Lpi-lpi-logo2.png is referred to by "https://news.opensuse.org/2010/09/28/osc2010-sneak-peaks-take-an-lpi-exam-at-opensuse-conference-2010" due to a poor uri.

Looking at the error log:

2022/10/28 08:52:59 [error] 8102#8102: *2477262 rewrite or internal redirection cycle while internally redirecting to "/favicon.ico.html.html.html.html.html.html.html.html.html.html.html", client: 47.157.94.226, server: news.opensuse.org, request: "GET /favicon.ico HTTP/1.1", host: "news.opensuse.org"

#3 Updated by pjessen 5 months ago

I am mostly an nginx newbie, but after doing some research, I made the following change:

# diff -u news.opensuse.org.conf.bkup news.opensuse.org.conf
--- news.opensuse.org.conf.bkup 2022-03-01 12:43:04.503567724 +0000
+++ news.opensuse.org.conf      2022-10-28 08:58:36.865969060 +0000
@@ -28,7 +28,7 @@

     location / {
         index index.html index.htm;
-        try_files $uri $uri/index.html $uri.html;
+        try_files $uri $uri/ $uri.html =404;

     }

     if ($args ~* "feed=rss2") {

Please, could someone, who knows news.o.o and nginx, review the above.

#4 Updated by hellcp 5 months ago

That change looks good to me, indeed it should end with =404

#5 Updated by pjessen 5 months ago

hellcp wrote:

That change looks good to me, indeed it should end with =404

Thanks for reviewing it! Looking at the other sites:

101.opensuse.org
debuginfod.opensuse.org
get.opensuse.org
monitor.opensuse.org
planet.opensuse.org
search.opensuse.org
www.opensuse.org
yast.opensuse.org

they all have the same issue - a url that cannot be found causes a loop, and then a 500.
It would seem to be a Good Idea (R) to apply the same change to all of them? It would mean wasting less resources, and probably also reduced traffic (because e.g. search engines usually give up when they receive a 404).

#6 Updated by cboltz 5 months ago

pjessen wrote:

-        try_files $uri $uri/index.html $uri.html;
+        try_files $uri $uri/ $uri.html =404;

Extending try_files with =404 makes sense, but I'd keep the other values and just append the =404 (unless you have a good reason for removing some values).

BTW: Changing this isn't too much work - if you update the web_static and web_jekyll roles, that will fix lots of our (sub)domains.

#7 Updated by pjessen 5 months ago

cboltz wrote:

pjessen wrote:

-        try_files $uri $uri/index.html $uri.html;
+        try_files $uri $uri/ $uri.html =404;

Extending try_files with =404 makes sense, but I'd keep the other values and just append the =404 (unless you have a good reason for removing some values).

Thanks for reviewing, Christian.
I thought it made sense to change $uri/index.html to $uri/ to use the default index definition?

BTW: Changing this isn't too much work - if you update the web_static and web_jekyll roles, that will fix lots of our (sub)domains.

Hmm, I'll have a look, I guess I have to get used to this salt stuff.

Also available in: Atom PDF