Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

无法上传文件 #8

Open
ox1234 opened this issue Dec 18, 2022 · 2 comments
Open

无法上传文件 #8

ox1234 opened this issue Dec 18, 2022 · 2 comments

Comments

@ox1234
Copy link

ox1234 commented Dec 18, 2022

上传阿里云的时候报签名错误:

com.aliyun.oss.OSSException: Failed to parse the response result.
[ErrorCode]: InvalidResponse
[RequestId]: 639F3700E80D0139382AB438
[HostId]: null
[ResponseError]:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>SignatureDoesNotMatch</Code>
  <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
  <RequestId>639F3700E80D0139382AB438</RequestId>
  <HostId>d4y1ight-blog.oss-cn-beijing.aliyuncs.com</HostId>
  <OSSAccessKeyId>LTAI5tP5pMCMRtuXuRDsZGNu</OSSAccessKeyId>
  <SignatureProvided>W6BNI7Ea6x5624r6yhOjZH/fKp8=</SignatureProvided>
  <StringToSign>PUT

image/png
Sun, 18 Dec 2022 15:51:27 GMT
x-oss-object-acl:public-read
x-oss-storage-class:Standard
/d4y1ight-blog/test.png</StringToSign>
  <StringToSignBytes>50 55 54 0A 0A 69 6D 61 67 65 2F 70 6E 67 0A 53 75 6E 2C 20 31 38 20 44 65 63 20 32 30 32 32 20 31 35 3A 35 31 3A 32 37 20 47 4D 54 0A 78 2D 6F 73 73 2D 6F 62 6A 65 63 74 2D 61 63 6C 3A 70 75 62 6C 69 63 2D 72 65 61 64 0A 78 2D 6F 73 73 2D 73 74 6F 72 61 67 65 2D 63 6C 61 73 73 3A 53 74 61 6E 64 61 72 64 0A 2F 64 34 79 31 69 67 68 74 2D 62 6C 6F 67 2F 74 65 73 74 2E 70 6E 67 </StringToSignBytes>
</Error>

        at com.aliyun.oss.common.utils.ExceptionFactory.createOSSException(ExceptionFactory.java:113) ~[na:na]
        Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
        *__checkpoint ⇢ org.springframework.web.filter.reactive.ServerHttpObservationFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ AuthorizationWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ ExceptionTranslationWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ LogoutWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ ServerRequestCacheWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ LogoutPageGeneratingWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ LoginPageGeneratingWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ AnonymousAuthenticationWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ AuthenticationWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ AuthenticationWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ ReactorContextWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ CsrfWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ CorsWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ HttpHeaderWriterWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
        *__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
        *__checkpoint ⇢ HTTP POST "/apis/api.console.halo.run/v1alpha1/attachments/upload" [ExceptionHandlingWebHandler]
Original Stack Trace:
                at com.aliyun.oss.common.utils.ExceptionFactory.createOSSException(ExceptionFactory.java:113) ~[na:na]
                at com.aliyun.oss.common.utils.ExceptionFactory.createInvalidResponseException(ExceptionFactory.java:95) ~[na:na]
                at com.aliyun.oss.common.utils.ExceptionFactory.createInvalidResponseException(ExceptionFactory.java:84) ~[na:na]
                at com.aliyun.oss.internal.OSSErrorResponseHandler.handle(OSSErrorResponseHandler.java:74) ~[na:na]
                at com.aliyun.oss.common.comm.ServiceClient.handleResponse(ServiceClient.java:259) ~[na:na]
                at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:142) ~[na:na]
                at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:71) ~[na:na]
                at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:124) ~[na:na]
                at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:182) ~[na:na]
                at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:143) ~[na:na]
                at com.aliyun.oss.internal.OSSObjectOperation.writeObjectInternal(OSSObjectOperation.java:1195) ~[na:na]
                at com.aliyun.oss.internal.OSSObjectOperation.putObject(OSSObjectOperation.java:130) ~[na:na]
                at com.aliyun.oss.OSSClient.putObject(OSSClient.java:568) ~[na:na]
                at run.halo.alioss.AliOssAttachmentHandler.lambda$upload$7(AliOssAttachmentHandler.java:165) ~[na:na]
                at run.halo.alioss.AliOssAttachmentHandler.ossExecute(AliOssAttachmentHandler.java:80) ~[na:na]
                at run.halo.alioss.AliOssAttachmentHandler.lambda$upload$8(AliOssAttachmentHandler.java:164) ~[na:na]
                at reactor.core.publisher.MonoCallable.call(MonoCallable.java:72) ~[reactor-core-3.5.0.jar:3.5.0]
                at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:227) ~[reactor-core-3.5.0.jar:3.5.0]
                at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.5.0.jar:3.5.0]
                at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.5.0.jar:3.5.0]
                at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
                at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[na:na]
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
                at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
@guqing
Copy link
Member

guqing commented Dec 19, 2022

请确认你的 access secret 是否正确

@JohnNiang
Copy link
Contributor

建议先参考阿里云官方文档排查一下。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants