请求 POST: /oss/endpoint/put-file 未获取到对应的对象存储配置

Blade 未结 1 422
1481211525
1481211525 2024-05-08 14:57

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

1.  上传文件 请求 POST: /oss/endpoint/put-file Parameters: {"file":"1.png"}



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

期待 上传文件成功

看到结果

{

    "code": 400,

    "success": false,

    "data": {},

    "msg": "未获取到对应的对象存储配置"

}


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

BladeX 企业版   

4.0.1.RELEASE

Win11


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

2024-05-08 14:43:37.111  INFO 25220 --- [  XNIO-1 task-3] com.yomahub.liteflow.core.FlowExecutor   : [5b3c4a16d2464f45ab4b81320317f678]:requestId has generated

2024-05-08 14:43:37.111  INFO 25220 --- [  XNIO-1 task-3] com.yomahub.liteflow.core.FlowExecutor   : [5b3c4a16d2464f45ab4b81320317f678]:slot[1] offered

2024-05-08 14:43:37.111 ERROR 25220 --- [  XNIO-1 task-3] com.yomahub.liteflow.core.FlowExecutor   : [5b3c4a16d2464f45ab4b81320317f678]:couldn't find chain with the id[ossChain]


com.yomahub.liteflow.exception.ChainNotFoundException: couldn't find chain with the id[ossChain]

at com.yomahub.liteflow.core.FlowExecutor.doExecute(FlowExecutor.java:400)

at com.yomahub.liteflow.core.FlowExecutor.execute2Resp(FlowExecutor.java:323)

at com.yomahub.liteflow.core.FlowExecutor.execute2Resp(FlowExecutor.java:273)

at com.gdd.resource.builder.OssBuilder.template(OssBuilder.java:78)

at com.gdd.resource.builder.OssBuilder.template(OssBuilder.java:59)

at com.gdd.resource.endpoint.OssEndpoint.putFile(OssEndpoint.java:132)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:351)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)

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

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

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

at com.gdd.core.log.aspect.RequestLogAspect.aroundApi(RequestLogAspect.java:104)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

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

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

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

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

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

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

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

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

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

at com.gdd.resource.endpoint.OssEndpoint$$SpringCGLIB$$0.putFile()

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

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

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

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

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

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

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

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

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

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

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

at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547)

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

at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)

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

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

at com.gdd.core.log.filter.LogTraceFilter.doFilter(LogTraceFilter.java:24)

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

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

at com.gdd.core.boot.request.MRORequestFilter.doFilter(MRORequestFilter.java:43)

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

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:116)

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

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:116)

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

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

at org.springframework.web.filter.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:109)

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

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

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:116)

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

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:117)

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.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)

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

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

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

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

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:256)

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

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

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

at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)

at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)

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

at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)

at java.base/java.lang.Thread.run(Thread.java:842)


2024-05-08 14:43:37.112  INFO 25220 --- [  XNIO-1 task-3] com.yomahub.liteflow.slot.Slot           : [5b3c4a16d2464f45ab4b81320317f678]:ROLLBACK_CHAIN_NAME[null]


2024-05-08 14:43:37.112  INFO 25220 --- [  XNIO-1 task-3] com.yomahub.liteflow.slot.Slot           : [5b3c4a16d2464f45ab4b81320317f678]:CHAIN_NAME[null]


2024-05-08 14:43:37.112  INFO 25220 --- [  XNIO-1 task-3] com.yomahub.liteflow.slot.DataBus        : [5b3c4a16d2464f45ab4b81320317f678]:slot[1] released

2024-05-08 14:43:37.112  INFO 25220 --- [  XNIO-1 task-3] c.gdd.core.log.aspect.RequestLogAspect   : 


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

<=== POST: /oss/endpoint/put-file (6 ms)

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


2024-05-08 14:43:37.112 ERROR 25220 --- [  XNIO-1 task-3] c.g.c.l.e.MRORestExceptionTranslator     : 业务异常


com.gdd.core.log.exception.ServiceException: 未获取到对应的对象存储配置


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

  1.  image.png

没有读取到当前文件


1条回答
  •  zhx1994
    zhx1994 (楼主)
    2024-05-08 15:56

    在这个方法打断点调试下:org.springblade.resource.builder.OssBuilder#getOss,是否能获取到启用的oss配置。

    作者追问:2024-05-08 15:56

    image.png

    有获取到OSS内容

    作者追问:2024-05-08 15:56

    image.png

    报错代码区域 com.gdd.resource.builder.OssBuilder# template


    作者追问:2024-05-08 15:56

    image.png

    增加这一行代码后就可以找到 ossChian

    2024-05-08 16:44:56.310  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.core.FlowExecutor   : [52ada9a1cd0d40949153ea8e7033e686]:requestId has generated

    2024-05-08 16:44:56.310  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.core.FlowExecutor   : [52ada9a1cd0d40949153ea8e7033e686]:slot[0] offered

    2024-05-08 16:44:56.310  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.flow.element.Node   : [52ada9a1cd0d40949153ea8e7033e686]:[O]start component[preOssRule(OSS构建前置处理)] execution

    2024-05-08 16:44:56.318  INFO 21032 --- [  XNIO-1 task-2] com.gdd.resource.rule.oss.PreOssRule     : [52ada9a1cd0d40949153ea8e7033e686]:component[preOssRule(OSS构建前置处理)] finished in 2 milliseconds

    2024-05-08 16:44:56.318  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.flow.element.Node   : [52ada9a1cd0d40949153ea8e7033e686]:[O]start component[ossCacheRule(OSS缓存判断)] execution

    2024-05-08 16:44:56.318  INFO 21032 --- [  XNIO-1 task-2] com.gdd.resource.rule.oss.OssCacheRule   : [52ada9a1cd0d40949153ea8e7033e686]:component[ossCacheRule(OSS缓存判断)] finished in 0 milliseconds

    2024-05-08 16:44:56.318  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.flow.element.Node   : [52ada9a1cd0d40949153ea8e7033e686]:[O]start component[ossDataRule(OSS数据创建)] execution

    2024-05-08 16:44:56.318  INFO 21032 --- [  XNIO-1 task-2] com.gdd.resource.rule.oss.OssDataRule    : [52ada9a1cd0d40949153ea8e7033e686]:component[ossDataRule(OSS数据创建)] finished in 0 milliseconds

    2024-05-08 16:44:56.318  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.flow.element.Node   : [52ada9a1cd0d40949153ea8e7033e686]:[O]start component[ossBuildRule(OSS构建条件判断)] execution

    2024-05-08 16:44:56.319  INFO 21032 --- [  XNIO-1 task-2] com.gdd.resource.rule.oss.OssBuildRule   : [52ada9a1cd0d40949153ea8e7033e686]:component[ossBuildRule(OSS构建条件判断)] finished in 0 milliseconds

    2024-05-08 16:44:56.319  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.flow.element.Node   : [52ada9a1cd0d40949153ea8e7033e686]:[O]start component[minioRule(minioOSS构建)] execution

    2024-05-08 16:44:56.406  INFO 21032 --- [  XNIO-1 task-2] com.gdd.resource.rule.oss.MinioRule      : [52ada9a1cd0d40949153ea8e7033e686]:component[minioRule(minioOSS构建)] finished in 86 milliseconds

    2024-05-08 16:44:56.406  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.flow.element.Node   : [52ada9a1cd0d40949153ea8e7033e686]:[O]start component[ossTemplateRule(OSS接口读取校验)] execution

    2024-05-08 16:44:56.406  INFO 21032 --- [  XNIO-1 task-2] c.gdd.resource.rule.oss.OssTemplateRule  : [52ada9a1cd0d40949153ea8e7033e686]:component[ossTemplateRule(OSS接口读取校验)] finished in 0 milliseconds

    2024-05-08 16:44:56.406  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.flow.element.Node   : [52ada9a1cd0d40949153ea8e7033e686]:[O]start component[finallyOssRule(OSS构建后置处理)] execution

    2024-05-08 16:44:56.406  INFO 21032 --- [  XNIO-1 task-2] c.gdd.resource.rule.oss.FinallyOssRule   : [52ada9a1cd0d40949153ea8e7033e686]:component[finallyOssRule(OSS构建后置处理)] finished in 0 milliseconds

    2024-05-08 16:44:56.406  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.slot.Slot           : [52ada9a1cd0d40949153ea8e7033e686]:CHAIN_NAME[ossChain]

    preOssRule[OSS构建前置处理]<2>==>ossCacheRule[OSS缓存判断]<0>==>ossDataRule[OSS数据创建]<0>==>ossBuildRule[OSS构建条件判断]<0>==>minioRule[minioOSS构建]<86>==>ossTemplateRule[OSS接口读取校验]<0>==>finallyOssRule[OSS构建后置处理]<0>

    2024-05-08 16:44:56.406  INFO 21032 --- [  XNIO-1 task-2] com.yomahub.liteflow.slot.DataBus        : [52ada9a1cd0d40949153ea8e7033e686]:slot[0] released


    0 讨论(0)
提交回复