Siyao Meng created HDDS-17571:
---------------------------------
Summary: S3 Gateway returns 500 instead of 400 when Host matches
no ozone.s3g.domain.name
Key: HDDS-17571
URL: https://issues.apache.org/jira/browse/HDDS-17571
Project: Apache Ozone
Issue Type: Bug
Components: S3
Reporter: Siyao Meng
Assignee: Siyao Meng
When {{ozone.s3g.domain.name}} is set and a request's Host header (port
stripped) matches none of the configured domains, {{VirtualHostStyleFilter}}
throws {{org.apache.hadoop.fs.InvalidRequestException}}. That is not an
{{OS3Exception}}, so the client gets HTTP 500 with no S3 error body. The same
happens for a virtual host style Host with no dot before the domain ("invalid
format").
AWS SDKs and S3A treat 500 as retryable, so a configuration mistake turns into
a slow failure that looks like a hang. A common case is a gateway whose own
FQDN is missing from the domain list: every path style request to it (including
health probes such as {{HEAD /}}) fails with 500.
Fix: keep rejecting the request, but return an S3 {{400 InvalidRequest}} (via
{{S3ErrorTable}} / {{wrapOS3Exception}}, like {{AuthorizationFilter}}) carrying
the existing message, so clients fail fast with a clear error.
Treating an unmatched Host as path style instead was considered and rejected: a
virtual host style request sent to an unlisted host name would then be read as
a different operation (for example {{DELETE bucket.host/key}} would become
DeleteBucket {{key}}).
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]