thingsboard / thingsboard

Open-source IoT Platform - Device management, data collection, processing and visualization.
https://thingsboard.io
Apache License 2.0
17.4k stars 5.14k forks source link

[Question] ThingsBoard Microservices Installation Update Problem #9706

Closed berofa closed 5 months ago

berofa commented 10 months ago

Hello everyone

I have a ThingsBoard CE Microservices installation as described here:

https://github.com/thingsboard/thingsboard/tree/master/docker

Until recently I was still using TB v3.2.1, now I've set about updating the installation to the latest version. I proceeded as described at https://github.com/thingsboard/thingsboard/tree/master/docker:

$ ./docker-stop-services.sh
.evn file adapted (the desired version)
$ ./docker-upgrade-tb.sh --fromVersion=[FROM_VERSION]
$ ./docker-start-services.sh

I imported all versions individually (e.g. from 3.2.1 to 3.2.2, then to 3.3.0, then to 3.3.1, etc. as described here: https://thingsboard.io/docs/user-guide/install/upgrade-instructions/#upgrading-to-344).

Up to and including version 3.4.4 everything works without any problems. I can't make the jump from 3.4.4 to 3.5.0. Although the update is carried out successfully, I receive the following error message when I log in to ThingsBoard and go to the devices page and open a device there:

java.lang.RuntimeException: unknown object tag -126

The devices (as well as all other data including time series data) are there, but I can no longer connect devices via MQTT and upload new data to ThingsBoard. The error message itself doesn't tell me anything and I couldn't really find anything about it on Google.

Unfortunately, even a complete server reboot does not solve the problem. I have already tried to continue with the update to the latest version despite the error message (i.e. installing 3.5.1 and then 3.6.0) but the error message also appears with version 3.6.0.

Have any of you already had this problem and a solution? Or an approach I could try/where I could look for more details?

The operating system is Linux (Ubuntu).

berofa commented 10 months ago

Maybee the output from the update script helpts?

./docker-upgrade-tb.sh --fromVersion=3.4.4
Pulling tb-core1 ... done
Starting docker_postgres_1_ee503cd0213e  ... done
Starting docker_redis_1_dfb640ea0238     ... done
Starting docker_cassandra_1_ab1349a718af ... done
Starting ThingsBoard upgrade ...
[0.001s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/var/log/thingsboard/tb-core1/gc.log instead.
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[0.002s][warning][gc] -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
18:21:34,050 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
18:21:34,051 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/config/logback.xml]
18:21:34,057 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
18:21:34,057 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/usr/share/thingsboard/conf/logback.xml]
18:21:34,057 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/config/logback.xml]
18:21:34,629 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
18:21:34,664 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan for changes in [file:/config/logback.xml] 
18:21:34,665 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeTask scanning period to 10 seconds
18:21:34,674 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
18:21:34,695 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [fileLogAppender]
18:21:34,754 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1887813102 - setting totalSizeCap to 3 GB
18:21:34,768 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1887813102 - Archive files will be limited to [100 MB] each.
18:21:35,006 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1887813102 - No compression will be used
18:21:35,024 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1887813102 - Will use the pattern /var/log/thingsboard/tb-core1/thingsboard.%d{yyyy-MM-dd}.%i.log for the active file
18:21:35,034 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@1ce92674 - The date pattern is 'yyyy-MM-dd' from file name pattern '/var/log/thingsboard/tb-core1/thingsboard.%d{yyyy-MM-dd}.%i.log'.
18:21:35,034 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@1ce92674 - Roll-over at midnight.
18:21:35,059 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@1ce92674 - Setting initial period to Mon Nov 27 18:20:15 UTC 2023
18:21:35,081 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
18:21:35,175 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[fileLogAppender] - Active log file name: /var/log/thingsboard/tb-core1/thingsboard.log
18:21:35,175 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[fileLogAppender] - File property is set to [/var/log/thingsboard/tb-core1/thingsboard.log]
18:21:35,177 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
18:21:35,192 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
18:21:35,193 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
18:21:35,197 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.thingsboard.server] to INFO
18:21:35,197 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.google.common.util.concurrent.AggregateFuture] to OFF
18:21:35,197 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
18:21:35,197 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [fileLogAppender] to Logger[ROOT]
18:21:35,199 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
18:21:35,199 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
18:21:35,201 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5700d6b1 - Registering current configuration as safe fallback point

  ______    __      _                              ____                               __
 /_  __/   / /_    (_)   ____    ____ _   _____   / __ )  ____   ____ _   _____  ____/ /
  / /     / __ \  / /   / __ \  / __ `/  / ___/  / __  | / __ \ / __ `/  / ___/ / __  /
 / /     / / / / / /   / / / / / /_/ /  (__  )  / /_/ / / /_/ // /_/ /  / /    / /_/ /
/_/     /_/ /_/ /_/   /_/ /_/  \__, /  /____/  /_____/  \____/ \__,_/  /_/     \__,_/
                              /____/

 ===================================================
 :: ThingsBoard ::       (v3.5.0)
 ===================================================

Starting ThingsBoard Upgrade from version 3.4.4 ...
Clearing cache to upgrade from version 3.4.4 to 3.5.0
Clearing cache [deviceProfiles]
Upgrading ThingsBoard from version 3.4.4 to 3.5.0 ...
Updating schema ...
column "status" of relation "alarm" already exists, skipping
index "idx_alarm_originator_alarm_type_active" does not exist, skipping
index "idx_alarm_tenant_alarm_type_active" does not exist, skipping
index "idx_entity_alarm_entity_id_alarm_type_created_time_alarm_id" does not exist, skipping
procedure drop_partitions_by_max_ttl(pg_catalog.varchar,pg_catalog.int8,pg_catalog.int8) does not exist, skipping
function get_partition_by_max_ttl_date() does not exist, skipping
Schema updated.
Installing SQL DataBase schema views and functions: schema-views-and-functions.sql
Successfully executed query: DROP VIEW IF EXISTS device_info_view CASCADE;
Successfully executed query: CREATE OR REPLACE VIEW device_info_view AS SELECT * FROM device_info_active_attribute_view;
Updating system data...
Creating default notification configs for system admin
Creating default notification configs for all tenants
Upgrade finished successfully!
berofa commented 10 months ago

Addition: I have now updated to version 3.6.1, unfortunately without solving the problem.

The error also occurs when I try to create a new device or asset (when saving). I can however create new entity views without problems. Also I can update my account info without getting the error. Updating rule chains or dashboards also works.

trikimiki commented 5 months ago

Hi! sorry for coming late to this issue java.lang.RuntimeException: unknown object tag -126 That error is linked to cache. Most likely, you are using Redis, and need to flush it: docker exec -it <redis_id> bash redis-cli flushall