alluxio icon indicating copy to clipboard operation
alluxio copied to clipboard

Signature authentication failed when there are special characters in the request path for S3 proxy

Open Haoning-Sun opened this issue 1 year ago • 3 comments

Alluxio Version: Alluxio-2.x

Describe the bug We have enabled signature authentication, and when there are special characters in the path of a file in alluxio, the following exception is thrown when an S3 client requests the s3 proxy to access that file.

An error occurred (403) when calling the HeadObject operation: Forbidden

To Reproduce

  • Enable signature authentication.
  • Create files with special characters in alluxio and access them via s3 proxy.
aws s3api head-object --bucket test_bucket --key number=123/LICENSE --endpoint=http://localhost:39999

Are you planning to fix it Yes.

Haoning-Sun avatar Nov 24 '23 13:11 Haoning-Sun

@yyongycy @Jackson-Wang-7 Please help review the issue and solution.

Haoning-Sun avatar Dec 05 '23 01:12 Haoning-Sun

@Haoning-Sun Thanks for your fix. Is there any error log in proxy.log? Can you attach the error stack here?

Jackson-Wang-7 avatar Dec 05 '23 01:12 Jackson-Wang-7

@Haoning-Sun Thanks for your fix. Is there any error log in proxy.log? Can you attach the error stack here?

Error log

ERROR S3Handler - Exception during create s3handler:alluxio.proxy.s3.S3Exception: Invalid S3 identifier
       at alluxio.proxy.s3.S3RestUtils.getUserFromSignature(S3RestUtils.java:633)
       at alluxio.proxy.s3.S3RestUtils.getUser(S3RestUtils.java:615)
       at alluxio.proxy.s3.S3Handler.doAuthentication(S3Handler.java:484)
       at alluxio.proxy.s3.S3Handler.init(S3Handler.java:245)
       at alluxio.proxy.s3.S3Handler.createHandler(S3Handler.java:162)
       at alluxio.proxy.s3.S3RequestServlet.service(S3RequestServlet.java:68)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

Haoning-Sun avatar Dec 05 '23 03:12 Haoning-Sun