产品管理中设备配置发布上线报500

Blade 已结 2 92
18235477054
18235477054 2024-11-20 11:54

image.png

这里是哪里配置问题吗?

2条回答
  •  18235477054
    18235477054 (楼主)
    2024-11-20 15:29


    使用的是iot 和bladex 合并以后的,具体那个版本在哪看(项目bladex-server 运行端口是8800)


    报错消息里有172.17.0.1:8800

    Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at java.base/java.lang.Thread.run(Thread.java:833) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: Caused by: java.sql.SQLException: TDengine ERROR (0x264b): sql: ALTER STABLE `device_property_b12fldwxuwhs` MODIFY COLUMN `humidity` FLOAT;, desc: Only varbinary/binary/nchar/geometry column length could be modified, and the length can only be increased, not decreased Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:95) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at com.taosdata.jdbc.rs.RestfulStatement.execute(RestfulStatement.java:97) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at com.taosdata.jdbc.rs.RestfulStatement.execute(RestfulStatement.java:78) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:635) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:435) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393) Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: #011... 119 more Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: ', 'org.springframework.jdbc.UncategorizedSQLException', 'StatementCallback; uncategorized SQLException for SQL [ALTER STABLE `device_property_b12fldwxuwhs` MODIFY COLUMN `humidity` FLOAT;]; SQL state []; error code [9803]; TDengine ERROR (0x264b): sql: ALTER STABLE `device_property_b12fldwxuwhs` MODIFY COLUMN `humidity` FLOAT;, desc: Only varbinary/binary/nchar/geometry column length could be modified, and the length can only be increased, not decreased', 'JdbcTemplate.java' , 1549, '000000', 'blade-iot', '172.17.0.1:8800', 'iZhp32rl3y2b0cqsxdja60Z' , 'prod', '36.106.227.91', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36 Core/1.116.460.400 QQBrowser/13.3.6167.400', '/blade-iot/product/function/publish-online', 'POST' , 'org.springframework.jdbc.core.JdbcTemplate', 'translateException', 'productId=1857338859122749442&versionDesc=v2', 'admin', TIMESTAMP '2024-11-20 15:23:49.142') Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: Execute Time: 5.352ms Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: ============== Sql End ==============

    回答: 2024-11-20 15:29

    image.png




    Nov 20 15:23:49 iZhp32rl3y2b0cqsxdja60Z spring_blade-server[760]: Execute SQL : insert into blade_log_error (id, stack_trace, exception_name, message, file_name , line_number, tenant_id, service_id, server_ip, server_host , env, remote_ip, user_agent, request_uri, method , method_class, method_name, params, create_by, create_time) values (1859135542861217794, 'org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [ALTER STABLE `device_property_b12fldwxuwhs` MODIFY COLUMN `humidity` FLOAT;]; SQL state []; error code [9803]; TDengine ERROR (0x264b): sql: ALTER STABLE `device_property_b12fldwxuwhs` MODIFY COLUMN `humidity` FLOAT;, desc: Only varbinary/binary/nchar/geometry column length could be modified, and the length can only be increased, not decreased

    作者追问:2024-11-20 15:29

    看报错,是超级表类型冲突了。

    这个错误的主要内容提示说,在尝试使用 ALTER STABLE 语句修改超级表 device_property_b12fldwxuwhs 中的 humidity 列的数据类型时遇到问题。错误详细说明了只有 varbinary、binary、nchar、geometry 这类类型的列长度可以被修改,并且只能增加长度,不能减少。


    使用tdengine的时候,每次发布物模型,都会发布一次超级表,对超级表进行变更。但是如果字段变化属性变化的时候,tdengine本身不支持,也就无法修改成功了。正常情况下物模型定下后一般也不会再改类型,所以设计的时候要注意下。


    解决方案就是手动删掉老的超级表(如果有重要数据,则先备份或者导出),删掉后再点击发布就能创建超级表成功了。

提交回复