阿里云的oss要怎么配置, 七牛的配置没有问题, 配上阿里云的就报错

Blade 未结 1 138
橙柒
橙柒 剑圣 2022-09-05 18:06

一、该问题的重现步骤是什么?

1. 

image.png2. 

3.


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。


Execute SQL : select id, category, oss_code, endpoint, access_key , secret_key, bucket_name, app_id, region, remark , tenant_id, create_user, create_dept, create_time, update_user , update_time, status, is_deleted from blade_oss where is_deleted = 0 and tenant_id = '476105' and oss_code = 'aliyun' and blade_oss.tenant_id = '476105'

Execute Time: 13.315ms

==============  Sql  End   ==============


2022-09-05 18:03:46.759  WARN 40047 --- [  XNIO-1 task-5] com.aliyun.oss                           : [Server]Unable to execute HTTP request: The request signature we calculated does not match the signature you provided. Check your key and signing method.

[ErrorCode]: SignatureDoesNotMatch

[RequestId]: 6315C982998B3E34340518A1

[HostId]: alioss.quanxinfu.com

[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>6315C982998B3E34340518A1</RequestId>

  <HostId>alioss.quanxinfu.com</HostId>

  <OSSAccessKeyId>LTAI5tB572cxorTe1ui2p2Xa</OSSAccessKeyId>

  <SignatureProvided>6gj/DNSaHOtkQBwC2sidnvbeo6c=</SignatureProvided>

  <StringToSign>GET



Mon, 05 Sep 2022 10:03:45 GMT

/?acl</StringToSign>

  <StringToSignBytes>47 45 54 0A 0A 0A 4D 6F 6E 2C 20 30 35 20 53 65 70 20 32 30 32 32 20 31 30 3A 30 33 3A 34 35 20 47 4D 54 0A 2F 3F 61 63 6C </StringToSignBytes>

</Error>


2022-09-05 18:03:46.919  WARN 40047 --- [  XNIO-1 task-5] com.aliyun.oss                           : [Server]Unable to execute HTTP request: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

[ErrorCode]: AccessDenied

[RequestId]: 6315C983998B3E3434D519A1

[HostId]: alioss.quanxinfu.com

[ResponseError]:

<?xml version="1.0" encoding="UTF-8"?>

<Error>

  <Code>AccessDenied</Code>

  <Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message>

  <RequestId>6315C983998B3E3434D519A1</RequestId>

  <HostId>alioss.quanxinfu.com</HostId>

  <Bucket>upload</Bucket>

  <Endpoint>oss-cn-hangzhou.aliyuncs.com</Endpoint>

</Error>


2022-09-05 18:03:46.920  INFO 40047 --- [  XNIO-1 task-5] o.s.core.log.aspect.RequestLogAspect     : 


===============  Response Start  ================

<=== POST: /blade-resource/oss/endpoint/put-file (1536 ms)

===============   Response End   ================


2022-09-05 18:03:46.959 ERROR 40047 --- [  XNIO-1 task-5] o.s.c.l.e.BladeRestExceptionTranslator   : 服务器异常


com.aliyun.oss.OSSException: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

[ErrorCode]: AccessDenied

[RequestId]: 6315C983998B3E3434D519A1

[HostId]: alioss.quanxinfu.com

[ResponseError]:

<?xml version="1.0" encoding="UTF-8"?>

<Error>

  <Code>AccessDenied</Code>

  <Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message>

  <RequestId>6315C983998B3E3434D519A1</RequestId>

  <HostId>alioss.quanxinfu.com</HostId>

  <Bucket>upload</Bucket>

  <Endpoint>oss-cn-hangzhou.aliyuncs.com</Endpoint>

</Error>


at com.aliyun.oss.common.utils.ExceptionFactory.createOSSException(ExceptionFactory.java:103)

at com.aliyun.oss.internal.OSSErrorResponseHandler.handle(OSSErrorResponseHandler.java:72)

at com.aliyun.oss.common.comm.ServiceClient.handleResponse(ServiceClient.java:259)

at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:142)

at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:71)

at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:98)

at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:160)

at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:117)

at com.aliyun.oss.internal.OSSObjectOperation.writeObjectInternal(OSSObjectOperation.java:1195)

at com.aliyun.oss.internal.OSSObjectOperation.putObject(OSSObjectOperation.java:130)

at com.aliyun.oss.OSSClient.putObject(OSSClient.java:527)

at com.aliyun.oss.OSSClient.putObject(OSSClient.java:511)

at com.aliyun.oss.OSSClient.putObject(OSSClient.java:505)

at org.springblade.core.oss.AliossTemplate.put(AliossTemplate.java:180)

at org.springblade.core.oss.AliossTemplate.putFile(AliossTemplate.java:168)

at org.springblade.core.oss.AliossTemplate.putFile(AliossTemplate.java:162)

at org.springblade.modules.resource.endpoint.OssEndpoint.putFile(OssEndpoint.java:148)

at org.springblade.modules.resource.endpoint.OssEndpoint$$FastClassBySpringCGLIB$$1e875e77.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)

at org.springblade.core.log.aspect.RequestLogAspect.aroundApi(RequestLogAspect.java:112)

at sun.reflect.GeneratedMethodAccessor252.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)

at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)

at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)

at org.springblade.modules.resource.endpoint.OssEndpoint$$EnhancerBySpringCGLIB$$f48c3079.putFile(<generated>)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:517)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:584)

at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

at org.springblade.core.log.filter.LogTraceFilter.doFilter(LogTraceFilter.java:39)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springblade.core.boot.request.BladeRequestFilter.doFilter(BladeRequestFilter.java:58)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:111)

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)

at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)

at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:390)

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:836)

at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019)

at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558)

at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449)

at java.lang.Thread.run(Thread.java:750)

五、若有更多详细信息,请在下面提供。

1条回答
  • 2022-09-05 18:40

    资源地址 endpoint配置的不正确,具体要看你们自定义是怎么配的。

    如果不自定义配置,用默认的配置,资源地址 应该是这样的格式:

    https://oss-cn-hangzhou.aliyuncs.com

    然后再搭配bucket,比如我们设置成blade-oss,那最终他自动生成的地址就是:

    https://blade-oss.oss-cn-hangzhou.aliyuncs.com


    0 讨论(0)
提交回复