错误:关系“ Entity_alarm”不存在”

发布于 2025-01-21 17:06:30 字数 808 浏览 0 评论 0原文

我正在Ubuntu上运行TB v3.3.4.1p。 我有一个分析汇总流节点,应该计算每小时生产的单位。 每当我尝试编辑它时,我都会收到以下错误 “无法提取结果集; sql [n/a];嵌套的异常是org.hibernate.exception.sqlgrammarexception:无法提取resultset'

在“事物”板日志文件中,我每当我尝试添加或删除任何设备时都会得到以下错误。 “ 2022-04-13 21:24:45,297 [http-nio-0.0.0.0.0.0.0.0.0-8080-exec-3] 2022-04-13 21:24:45,298 [http-nio-0.0.0.0.0.0.0.0.0.0.0-8080-exec-3]错误ohejdbc.spi.sqlexceptionhelper-错误 - 错误:关系“ entity_alarm

” :关系“ entity_alarm”在字符306上不存在 2022-04-15 13:29:09.746 UTC [2114] postgres@things things语句:选择entityalar0_.alarm_id为armard_id1_17_,entityAlar0_.entity_id as entity_i2_i2_i2_i2_17_,entity_i2_17_ ar0_.customer_id as customer5_17_, entityAlar0_.entity_type作为entity_t6_17_,entityAlar0_.tenant_id as tenant_i7_17__来自Entity_alarm entityalar0_ entityAlaral0_.entity_id_id = $ 1 “

知道从未创建实体警报。 感谢您的支持。

i'm running TB v3.3.4.1P on Ubuntu.
i have an analytics aggregate stream node, it should be counting produced units per hour.
whenever i try to edit it i receive the error below
"could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet"

in the Things Board log file i get the below error whenever i try to add or delete any device.
"2022-04-13 21:24:45,297 [http-nio-0.0.0.0-8080-exec-3] WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 42P01
2022-04-13 21:24:45,298 [http-nio-0.0.0.0-8080-exec-3] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - ERROR: relation "entity_alarm" does not exist"

Postgres Log File " postgres@thingsboard ERROR: relation "entity_alarm" does not exist at character 306
2022-04-15 13:29:09.746 UTC [2114] postgres@thingsboard STATEMENT: select entityalar0_.alarm_id as alarm_id1_17_, entityalar0_.entity_id as entity_i2_17_, entityalar0_.alarm_type as alarm_ty3_17_, entityalar0_.created_time as created_4_17_, entityalar0_.customer_id as customer5_17_, entityalar0_.entity_type as entity_t6_17_, entityalar0_.tenant_id as tenant_i7_17_ from entity_alarm entityalar0_ where entityalar0_.entity_id=$1
"

knowing that an entity alarm was never created.
Appreciate your kind support.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮邮递员 2025-01-28 17:06:30

我想这是因为升级失败或至少在升级过程中警告。您是否安装了该版本或已从较旧版本进行了更新?

执行该架构的SQL创建表格,它应该解决问题。

CREATE TABLE IF NOT EXISTS entity_alarm (
    tenant_id uuid NOT NULL,
    entity_type varchar(32),
    entity_id uuid NOT NULL,
    created_time bigint NOT NULL,
    alarm_type varchar(255) NOT NULL,
    customer_id uuid,
    alarm_id uuid,
    CONSTRAINT entity_alarm_pkey PRIMARY KEY (entity_id, alarm_id),
    CONSTRAINT fk_entity_alarm_id FOREIGN KEY (alarm_id) REFERENCES alarm(id) ON DELETE CASCADE
);

I suppose it's because of a failed upgrade or at least some warning during the upgrade. Have you installed that version or has it been updated from an older one?

Executing this piece of the schema.sql creates the table and it should solve the problem.

CREATE TABLE IF NOT EXISTS entity_alarm (
    tenant_id uuid NOT NULL,
    entity_type varchar(32),
    entity_id uuid NOT NULL,
    created_time bigint NOT NULL,
    alarm_type varchar(255) NOT NULL,
    customer_id uuid,
    alarm_id uuid,
    CONSTRAINT entity_alarm_pkey PRIMARY KEY (entity_id, alarm_id),
    CONSTRAINT fk_entity_alarm_id FOREIGN KEY (alarm_id) REFERENCES alarm(id) ON DELETE CASCADE
);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文