You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
报403的提示如下:
code: 91, reason: Failed to retrieve the resource because the HTTP response status code is: 403
ResponseException(requestId=null, code=91, reason=Failed to retrieve the resource because the HTTP response status code is: 403, cause=null)
at im.turms.client.exception.ResponseException$Companion.from(ResponseException.kt:70)
at im.turms.client.exception.ResponseException$Companion.from$default(ResponseException.kt:68)
at im.turms.client.service.StorageService$upload$2$1.onResponse(StorageService.kt:880)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
The text was updated successfully, but these errors were encountered:
I just updated turms-plugin-minio days ago. You can download and use the latest turms-plugin-minio to have a try first.
And the clients should always pass the non-null mediaType value when calling uplodateXXX methods in storageService so that it can pass the Content-Type header, or you will get the 403 error.
If you have followed the steps mentioned above and still encounter 403, it is suggested you can set a break point on the HTTP response so that you can view the HTTP response body as a string, and the body will tell you the exact reason why the request fails.
我能获取到具体的参数
uri:http://localhost:9000/user-profile-picture
x-amz-date:20240412T060645Z
x-amz-signature:545fcd84eac9447574832351c5b0266ad403d18135aa2412eed1dca83c27630a
x-amz-algorithm:AWS4-HMAC-SHA256
x-amz-credential:minioadmin/20240412/us-east-1/s3/aws4_request
policy:eyJleHBpcmF0aW9uIjoiMjAyNC0wNC0xMlQwNjoxMTo0NS4yMTNaIiwiY29uZGl0aW9ucyI6W1siZXEiLCIkYnVja2V0IiwidXNlci1wcm9maWxlLXBpY3R1cmUiXSxbImVxIiwiJGtleSIsIjEiXSxbInN0YXJ0cy13aXRoIiwiJENvbnRlbnQtVHlwZSIsImltYWdlLyJdLFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3Nl0sWyJlcSIsIiR4LWFtei1hbGdvcml0aG0iLCJBV1M0LUhNQUMtU0hBMjU2Il0sWyJlcSIsIiR4LWFtei1jcmVkZW50aWFsIiwibWluaW9hZG1pbi8yMDI0MDQxMi91cy1lYXN0LTEvczMvYXdzNF9yZXF1ZXN0Il0sWyJlcSIsIiR4LWFtei1kYXRlIiwiMjAyNDA0MTJUMDYwNjQ1WiJdXX0=
key:1
但是使用StorageService里面的upload会提示403。
然而上面的参数,我用下面的代码,是可以上传成功的额,不会报403
public static void main(String[] args) throws IOException, InvalidKeyException, NoSuchAlgorithmException, ErrorResponseException, InternalException, InsufficientDataException {
String endpoint = "http://localhost:9000"; // MinIO服务的URL
String accessKey = "minioadmin"; // MinIO访问密钥
String secretKey = "minioadmin"; // MinIO访问密钥的密钥
报403的提示如下:
code: 91, reason: Failed to retrieve the resource because the HTTP response status code is: 403
ResponseException(requestId=null, code=91, reason=Failed to retrieve the resource because the HTTP response status code is: 403, cause=null)
at im.turms.client.exception.ResponseException$Companion.from(ResponseException.kt:70)
at im.turms.client.exception.ResponseException$Companion.from$default(ResponseException.kt:68)
at im.turms.client.service.StorageService$upload$2$1.onResponse(StorageService.kt:880)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
The text was updated successfully, but these errors were encountered: