0AyanamiRei opened a new pull request, #64562:
URL: https://github.com/apache/doris/pull/64562
## What's changed
`regression-test/suites/load_p2/tvf/test_s3_tvf.groovy` had six
attributes that combine
```
uri = "s3://${bucket}.${endpoint}/..." // virtual-host form
use_path_style = "true" // path-style request
```
The two contradict each other, and Aliyun OSS S3-compatible API
**rejects path-style addressing** with `HTTP 403
SecondLevelDomainForbidden` / `Please use virtual hosted style to
access`. The combination only worked accidentally on the historical
`s3Source=aliyun` (HK) endpoint and broke as soon as Regression P2
switched to `s3Source=aliyun-internal` (BJ): branch-4.0 P2 #189 / TC
build 197127 ([DORIS-26363](http://jira.selectdb-in.cc/browse/DORIS-26363)).
This PR
1. drops the six active `addProperty("use_path_style", "true")` lines
so the SDK uses virtual-host addressing that matches the URI form;
2. surfaces the real exception in the failure path — moving
`logger.info("error: ", ex)` before the `assertTrue` and adding
`i / table / prop / err.message` to the assertion message — since
`assertTrue(false)` throws `AssertionFailedError` immediately and
the previous `logger.info` line never ran, hiding the root cause
behind a bare `line 938` stack frame.
The four URI shapes covered by the touched attributes are all
virtual-host (`s3://${bucket}.${endpoint}/...`); the remaining
attributes in this file (the `basic_data*_trim_double_quotes.csv`
and pure-`*.csv` paths) never set `use_path_style` and continue to
work as before.
## Repro
End-to-end with the same OSS bucket, key, and endpoint, just
swapping the addressing style:
**Path-style — OSS rejects with 403:**
```
$ curl -i
"https://oss-cn-beijing.aliyuncs.com/doris-regression-bj/?prefix=regression/load/data/kd16=abcdefg/&max-keys=2"
HTTP/1.1 403 Forbidden
<Code>SecondLevelDomainForbidden</Code>
<Message>The bucket you are attempting to access must be addressed using OSS
third level domain.</Message>
```
**Virtual-host — OSS accepts:**
```
$ curl -i
"https://doris-regression-bj.oss-cn-beijing.aliyuncs.com/?prefix=regression/load/data/kd16=abcdefg/&max-keys=2"
HTTP/1.1 200 OK
<ListBucketResult>
<Name>doris-regression-bj</Name>
<Contents><Key>regression/load/data/kd16=abcdefg/basic_data.csv</Key>...
```
Same behaviour through Doris S3 TVF (against the public endpoint;
swap the AK/SK to your own):
```sql
-- with use_path_style=true → ERROR 1105 SecondLevelDomainForbidden
SELECT * FROM S3 (
"uri" =
"https://doris-regression-bj.oss-cn-beijing.aliyuncs.com/regression/load/data/kd16=abcdefg/basic_data.csv",
"s3.endpoint" = "oss-cn-beijing.aliyuncs.com",
"s3.region" = "cn-beijing",
"s3.access_key" = "<AK>",
"s3.secret_key" = "<SK>",
"format" = "csv",
"column_separator" = "|",
"use_path_style" = "true"
) LIMIT 1;
-- ERROR 1105 (HY000): ... The bucket you are attempting to access must be
-- addressed using OSS third level domain. [ErrorCode]:
SecondLevelDomainFor[bidden]
-- without use_path_style → returns the row
SELECT * FROM S3 (
"uri" =
"https://doris-regression-bj.oss-cn-beijing.aliyuncs.com/regression/load/data/kd16=abcdefg/basic_data.csv",
"s3.endpoint" = "oss-cn-beijing.aliyuncs.com",
"s3.region" = "cn-beijing",
"s3.access_key" = "<AK>",
"s3.secret_key" = "<SK>",
"format" = "csv",
"column_separator" = "|"
) LIMIT 1;
-- 1 row in set
```
Original FE failure stack on TC 197127 (matches the OSS error code,
just wrapped through the AWS S3 SDK):
```
S3Exception: Please use virtual hosted style to access.
(Service: S3, Status Code: 403, Request ID: 6A274948D9F0FF34335E9D8C)
at S3ObjStorage.globListInternal:707
at BrokerUtil.parseFile:91
at ExternalFileTableValuedFunction.parseFile:165
at S3TableValuedFunction.<init>:60
```
## Backport
Needs cherry-pick to `branch-4.0` (where the failure was observed).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]