apache / apache/doris

[Bug] `HTTP` func fails with `Failed to get file size for URI`

Open
#66,527 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
15.9k
Forks
3.9k
Avg merge
2d 23h
Merged PRs (30d)
520

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.

### Version

4.1.2, master

### What's Wrong?

When querying a **GET pre-signed** object-storage URL via the `HTTP()`, the query fails with 403 Forbidden while getting the file size:

> (1105, 'errCode = 2, detailMessage = Can not build http(): errCode = 2, detailMessage = Failed check http storage props, Failed to get file size for URI: http://.../xxx.txt?Expires=...&Signature=.... java.io.IOException: HTTP request failed with response code: 403, message: Forbidden')

### What You Expected?

Query OK.

### How to Reproduce?

```sql
SELECT * FROM HTTP(
uri='http://storage.xx.local/20260128170024.txt?Expires=xx&AccessKey=xx&Signature=xx',
format="csv")
limit 10;
```

The exact same URL works fine with a GET request:

```sh
wget http://storage.xx.local/20260128170024.txt?Expires=xx&AccessKey=xx&Signature=xx # returns 200
```

### Anything Else?

_No response_

### Are you willing to submit PR?

- [x] Yes I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the SQL HTTP() query with the pre-signed URL and compare it with the successful wget GET request. Trace the HTTP() file-size check that returns 403, then verify that the same query succeeds while preserving access to the CSV data.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.