[MDBF-250] ci.mariadb.org to use Content-type: text/plain (rfc5147) for log files Created: 2021-07-08  Updated: 2022-02-01  Resolved: 2021-11-10

Status: Closed
Project: MariaDB Foundation Development
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Trivial
Reporter: Daniel Black Assignee: Faustin Lammler
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

currently application/octet-stream

$ wget -S https://ci.mariadb.org/16646/logs/s390x-ubuntu-2004/mysqld.2.err.15
--2021-07-08 11:25:58--  https://ci.mariadb.org/16646/logs/s390x-ubuntu-2004/mysqld.2.err.15
Resolving ci.mariadb.org (ci.mariadb.org)... 95.216.219.179
Connecting to ci.mariadb.org (ci.mariadb.org)|95.216.219.179|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Server: nginx
  Date: Thu, 08 Jul 2021 01:26:00 GMT
  Content-Type: application/octet-stream
  Content-Length: 411783
  Last-Modified: Wed, 07 Jul 2021 19:30:51 GMT
  Connection: keep-alive
  ETag: "60e600eb-64887"
  Strict-Transport-Security: max-age=31536000; includeSubdomains;
  X-Frame-Options: SAMEORIGIN
  X-XSS-Protection: 1;mode=block
  Accept-Ranges: bytes
Length: 411783 (402K) [application/octet-stream]
Saving to: ‘mysqld.2.err.15’

This will make it easier to read error logs in a web browser.



 Comments   
Comment by Faustin Lammler [ 2021-07-08 ]

Agree, will handle that ASAP

Comment by Faustin Lammler [ 2021-07-08 ]

Should be ok now.

vladbogo please confirm that my regexp will catch any potential logs format in the ci.mariadb.org logs dir.

See:

diff --git a/nginx/sites-available/buildbot b/nginx/sites-available/buildbot
index 9b5aa63..45dc95c 100644
--- a/nginx/sites-available/buildbot
+++ b/nginx/sites-available/buildbot
@@ -112,6 +112,13 @@ server {
                alias /srv/buildbot/galera_packages;
        }
 
+       # show mysql error logs directly in browser
+       # example https://ci.mariadb.org/16646/logs/aarch64-ubuntu-2010/mysqld.2.err.4
+       # see https://jira.mariadb.org/browse/MDBF-250
+       location ~ .err.?.?.$ {
+               add_header Content-Type text/plain;
+       }
+
        autoindex on;
 
        access_log /var/log/nginx/ci.access.log anonymized;
@@ -147,4 +154,3 @@ server {
 
        error_page 404 /older_builds$request_uri;
 }

Comment by Daniel Black [ 2021-07-08 ]

. needs to be escaped:

location ~ \.err\.\d+$ 

pcre based on https://www.nginx.com/blog/regular-expression-tester-nginx/

location - https://nginx.org/en/docs/http/ngx_http_core_module.html#location

Comment by Vlad Bogolin [ 2021-07-08 ]

As danblack said, it needs to be escaped. I think Daniel's version should have a * at the beginning.

This should match the exact log names:

mysqld\.[0-9]+\.err\.[0-9]+

Comment by Faustin Lammler [ 2021-07-08 ]

Ok, I have implemented vladbogo suggestion:

        location ~ mysqld\.[0-9]+\.err\.[0-9]+$ {
                add_header Content-Type text/plain;
        }

About the compression , as discussed with vlad and vicentju, when the new builbdot master machine is available we will store way more builds and activate compression for old logs. I'll then ask you what's an "old" log.

Comment by Daniel Black [ 2021-07-08 ]

Thank you both.

Generated at Thu Feb 08 03:36:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.