Serving zip from object storage will 404 if storage endpoint is not accessible instead of 5xx
Summary
When Pages is serving via artifacts Zip (from object storage), it can respond with a 404
when it should have a 500
.
Details
Environment:
- Full Helm chart deployment including Pages configuration for Rails (http)
- Omnibus VM running only Pages
Result:
- Pages receives a direction to pull from
http://gitlab-minio-svc:9000/...
(endpoint
in object storageconnection
lookup_paths[].source.path
=>http://gitlab-minio-svc:9000/gitlab-artifacts/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35/2020_10_23/13/18/artifacts.zip?...
- Pages returns a 404
{
"content_type":"text/html; charset=utf-8",
"correlation_id":"",
"duration_ms":1,
"host":"root.pages.192.168.122.29.nip.io",
"level":"info",
"method":"GET",
"msg":"access",
"pages_host":"root.pages.192.168.122.29.nip.io",
"pages_https":false,
"pages_project_id":2,
"pages_project_prefix":"/plain-pages/",
"pages_project_serving_type":"zip",
"proto":"HTTP/1.1",
"referrer":"",
"remote_addr":"192.168.122.1:59464",
"remote_ip":"192.168.122.1",
"status":404,
"system":"http",
"time":"2020-10-23T20:09:31Z",
"ttfb_ms":1,
"uri":"/plain-pages/index.html",
"user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36",
"written_bytes":3067
}
This was addressed by overriding the endpoint
with the external URL, as Pages was "outside" the Kubernetes environment.
lookup_paths[].source.path
=> http://minio.192.168.122.111.nip.io/gitlab-artifacts/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35/2020_10_23/13/18/artifacts.zip?...
{
"content_type":"text/html; charset=utf-8",
"correlation_id":"",
"duration_ms":105,
"host":"root.pages.192.168.122.29.nip.io",
"level":"info",
"method":"GET",
"msg":"access",
"pages_host":"root.pages.192.168.122.29.nip.io",
"pages_https":false,
"pages_project_id":2,
"pages_project_prefix":"/plain-pages/",
"pages_project_serving_type":"zip",
"proto":"HTTP/1.1",
"referrer":"",
"remote_addr":"192.168.122.1:59844",
"remote_ip":"192.168.122.1",
"status":200,
"system":"http",
"time":"2020-10-23T20:49:24Z",
"ttfb_ms":105,
"uri":"/plain-pages/index.html",
"user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36",
"written_bytes":632
}