物联网平台-设备日志能显示收到设备数据,但是属性里看不到为空。

Blade 未结 2 188

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

1. image.png

2. 

3.image.png


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


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

应该能看到属性最新值 centos

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


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

2条回答
  • 设备日志不会进行格式校验,所以会直接入库。

    设备属性会进行格式校验,如果为空,则可能说明是格式不匹配上传失败了。你检查下相关的格式看看呢

    0 讨论(0)
  • bladex框架的错误日志有这一条,是不是这个原因?能不能分析出具体的字段?

    org.springframework.web.context.request.async.AsyncRequestNotUsableException: ServletOutputStream failed to write: java.io.IOException: Unable to wrap data, invalid status [CLOSED]

    at org.springframework.web.context.request.async.StandardServletAsyncWebRequest$LifecycleHttpServletResponse.handleIOException(StandardServletAsyncWebRequest.java:343)

    at org.springframework.web.context.request.async.StandardServletAsyncWebRequest$LifecycleServletOutputStream.write(StandardServletAsyncWebRequest.java:401)

    at com.fasterxml.jackson.core.json.UTF8JsonGenerator._flushBuffer(UTF8JsonGenerator.java:2243)

    at com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeNumber(UTF8JsonGenerator.java:981)

    at com.fasterxml.jackson.databind.ser.std.NumberSerializers$IntegerSerializer.serialize(NumberSerializers.java:157)

    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)

    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)

    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:184)

    at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)

    at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)

    at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)

    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)

    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)

    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:184)

    at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)

    at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)

    at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)

    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)

    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)

    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:184)

    at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:502)

    at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:341)

    at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1583)

    at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1061)

    at org.springblade.core.tool.jackson.AbstractReadWriteJackson2HttpMessageConverter.writeInternal(AbstractReadWriteJackson2HttpMessageConverter.java:141)

    at org.springblade.core.tool.jackson.MappingApiJackson2HttpMessageConverter.writeInternal(MappingApiJackson2HttpMessageConverter.java:98)

    at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:114)

    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:297)

    at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:192)

    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78)

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

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

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

    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.doGet(FrameworkServlet.java:903)

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

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

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

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

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

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

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

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

    at com.alibaba.druid.support.jakarta.WebStatFilter.doFilter(WebStatFilter.java:113)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

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

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

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

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

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

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

    at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:142)

    at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:82)

    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:362)

    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:278)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

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

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

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:598)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)

    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)

    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)

    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905)

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)

    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)

    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)

    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)

    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)

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

    Caused by: org.apache.catalina.connector.ClientAbortException: java.io.IOException: Unable to wrap data, invalid status [CLOSED]

    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:341)

    at org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:776)

    at org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:673)

    at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:376)

    at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:354)

    at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:103)

    at org.springframework.session.web.http.OnCommittedResponseWrapper$SaveContextServletOutputStream.write(OnCommittedResponseWrapper.java:625)

    at org.springframework.web.context.request.async.StandardServletAsyncWebRequest$LifecycleServletOutputStream.write(StandardServletAsyncWebRequest.java:398)

    ... 84 more

    Caused by: java.io.IOException: Unable to wrap data, invalid status [CLOSED]

    at org.apache.tomcat.util.net.SecureNioChannel.write(SecureNioChannel.java:840)

    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite(NioEndpoint.java:1378)

    at org.apache.tomcat.util.net.SocketWrapperBase.doWrite(SocketWrapperBase.java:764)

    at org.apache.tomcat.util.net.SocketWrapperBase.writeBlocking(SocketWrapperBase.java:589)

    at org.apache.tomcat.util.net.SocketWrapperBase.write(SocketWrapperBase.java:533)

    at org.apache.coyote.http11.Http11OutputBuffer$SocketOutputBuffer.doWrite(Http11OutputBuffer.java:548)

    at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:84)

    at org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:193)

    at org.apache.coyote.Response.doWrite(Response.java:633)

    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:329)


    bf7d7f3ab74bb093c94a3d0818d25268.png

    作者追问:2天前

    这是menu/buttons接口的错,好像不相关啊,你现在用的时序库是什么。你新建一个设备(这样会新建表),然后再传数据看看呢

    回答: 2天前

    influxdb,设备上报的id中的横线,有的有,有的没有,是否影响解析json ?  String idf6ad8b74c3ff2399460c4b558c6183c.png

    回答: 2天前

    应该是这个,我们自己的vue界面点button调java,然后java再调物联网平台的接口查询最新状态, 报的是button的错。

    作者追问:2天前

    这个id不影响,全写1都没事的

    作者追问:2天前

    你先看下新建设备后,数据上传有属性的值么?

    回答: 2天前

     把设备日志的内容复制出来,用mqtt box 上传 ,能存入influxdb

    image.png

    image.png

    作者追问:2天前

    好的,那就是数据上报本身没问题。现在要看你们自己写的button调用java接口,java接口再调用的这块逻辑是什么写的。点击后具体报错和传参的完整数据是什么。哪一步报的错等等,都得看一遍

    回答: 2天前

    我们业务只是调了一下查询接口,现在问题是为什么influxdb没有录入进去?界面上为何没有最新数据? 

    作者追问:2天前

    只有打断点跟一下这个接口,看看传的参数是什么,返回是什么,报错是什么,这个需要去打断点才能知道了。光看你之前给我的日志,没有太大的帮助。

    回答: 2天前

    库里没有这条记录,是哪里格式解析不对?业务调的是propertySetSync,设备会回包,并执行一次属性上报,你在设备日志里都看到了,业务再调一次查询接口。

    image.png

    image.png

    回答: 2天前

    设备连接的是线上程序,不好打断点

    回答: 2天前

    已经找到问题了,逐个属性排查了一下,还是influxdb整形定义,上传了浮点数的问题。

    作者追问:2天前

    你现在是手动调用mqtt能存进去,自己通过java点击查询后设备返回上报的时候就失败的话,肯定就是设备端上报格式问题了。

    我们下版本周末应该能发出来,到时候会有自动转格式的逻辑进去,服务端会自动处理,可以关注下。

    回答: 2天前

    influxdb是广泛应用的时序库,数据类型兼容这块确实需要平台处理一下,几次都是这个问题排查半天,然后清空,上线后就不能这么任性了。历史数据或者为int或者float,一旦不一致都麻烦,尤其是0.00  或者 3.9999998这种,实际数据很可能会上报4,就不行了。实在不行再考虑tdeng吧。

    0 讨论(0)
提交回复