apache / apache/gravitino

[Improvement] Lance Rest Server: precheck the invalid location

Open
#9,448 1 comment 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### What would you like to be improved?

URL: http://192.168.194.170:9101/lance/v1/table/lance_s3_catalog%24lance_s3_schema_t8%24lance_s3_table_8/create?mode=create

Status code: 200

Content Type: null

Request Headers
Accept=application/json, application/javascript, text/javascript, text/json
Authorization=Basic YW5vbnltb3VzOnRlc3Q=
x-lance-table-location=invalid-s3-path/lance_s3_table_8
x-lance-table-properties={"lance.storage.aws_access_key_id":"xxx","lance.storage.aws_secret_access_key":"xxxx","lance.storage.aws_region":"ap-northeast-1"}
Content-Type=application/vnd.apache.arrow.stream; charset=UTF-8
Content Body
[-1, -1, -1, -1, -56, 0, 0, 0, 16, 0, 0, 0, 0, 0, 10, 0, 14, 0, 6, 0, 13, 0, 8, 0, 10, 0, 0, 0, 0, 0, 4, 0, 16, 0, 0, 0, 0, 1, 10, 0, 12, 0, 0, 0, 8, 0, 4, 0, 10, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 76, 0, 0, 0, 4, 0, 0, 0, -50, -1, -1, -1, 20, 0, 0, 0, 20, 0, 0, 0, 24, 0, 0, 0, 0, 0, 5, 1, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 4, 0, 0, 0, 5, 0, 0, 0, 118, 97, 108, 117, 101, 0, 18, 0, 24, 0, 20, 0, 19, 0, 18, 0, 12, 0, 0, 0, 8, 0, 4, 0, 18, 0, 0, 0, 20, 0, 0, 0, 20, 0, 0, 0, 28, 0, 0, 0, 0, 0, 2, 1, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 12, 0, 8, 0, 7, 0, 8, 0, 0, 0, 0, 0, 0, 1, 32, 0, 0, 0, 2, 0, 0, 0, 105, 100, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -80, 0, 0, 0, 16, 0, 0, 0, 0, 0, 10, 0, 14, 0, 6, 0, 13, 0, 8, 0, 10, 0, 0, 0, 0, 0, 4, 0, 16, 0, 0, 0, 0, 3, 10, 0, 12, 0, 0, 0, 8, 0, 4, 0, 10, 0, 0, 0, 8, 0, 0, 0, 92, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0]
Response Headers
Date: Wed, 10 Dec 2025 11:34:41 GMT
Content-Type: application/json
Content-Length: 533
Server: Jetty(9.4.51.v20230217)
Response Body
{
"location": "invalid-s3-path/lance_s3_table_8/",
"version": null,
"properties": {
"lance.storage.aws_secret_access_key": "xxxx",
"external": "true",
"lance.storage.aws_region": "ap-northeast-1",
"lance.storage.aws_access_key_id": "xxxxx",
"format": "lance",
"location": "invalid-s3-path/lance_s3_table_8/",
"lance.creation-mode": "CREATE"
},
"storage_options": {
"aws_region": "ap-northeast-1",
"aws_access_key_id": "xxxxx",
"aws_secret_access_key": "xxxxx"
}
}

### How should we improve?

precheck the invalid location path like "location": "invalid-s3-path/lance_s3_table_8/"

Contributor guide

Open the contributing guide

Research direction

Start with the Lance Rest Server create endpoint shown in the request and trace how the x-lance-table-location value is handled. Add coverage for the invalid-s3-path case and verify that the endpoint rejects the location before returning the successful 200 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.