thingsboard / tbmq

Open-source, scalable, and fault-tolerant MQTT broker able to handle 4M+ concurrent client connections, supporting at least 3M messages per second throughput per single cluster node with low latency delivery. The cluster mode supports more than 100M concurrently connected clients.
https://thingsboard.io/products/mqtt-broker/
Apache License 2.0
572 stars 46 forks source link

[Bug] #71

Closed jot4p closed 11 months ago

jot4p commented 12 months ago

/Hello,

I update for the last version and after use update .sh I get: " ERROR: relation "admin_settings" does not exist "

tbmq logs:

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

at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)

... 62 common frames omitted

Caused by: org.postgresql.util.PSQLException: ERROR: relation "admin_settings" does not exist

Position: 152

at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)

at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)

at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)

at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)

at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)

at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:134)

at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)

at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)

... 99 common frames omitted

Starting TBMQ ...

===================================================

:: ThingsBoard MQTT Broker :: (v1.1.0)

===================================================`

postgres log:

`dminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:17:08.180 UTC [597] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:17:08.180 UTC [597] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:17:20.437 UTC [613] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:17:20.437 UTC [613] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:17:30.001 UTC [630] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:17:30.001 UTC [630] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:17:40.763 UTC [646] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:17:40.763 UTC [646] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:17:51.088 UTC [663] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:17:51.088 UTC [663] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:18:01.341 UTC [680] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:18:01.341 UTC [680] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:18:11.347 UTC [696] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:18:11.347 UTC [696] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1

2023-09-18 17:18:22.131 UTC [713] ERROR: relation "admin_settings" does not exist at character 152

2023-09-18 17:18:22.131 UTC [713] STATEMENT: select adminsetti0_.id as id10, adminsetti0_.created_time as created_20, adminsetti0_.json_value as json_val30, adminsetti0_.key as key40 from adminsettings adminsetti0 where adminsetti0_.key=$1`

jot4p commented 12 months ago

It works after remove manually all content from :

sudo rm -R ~/.tb-mqtt-broker-data

dmytro-landiak commented 12 months ago

Hi @jot4p,

Could you please let me know the following:

So, have I understood correctly that after you launched ./tbmq-upgrade.sh script, it updated the DB and started the TBMQ v1.1.0 and you got the next error: ERROR: relation "admin_settings" does not exist ? If the steps you did are different - pls let me know the steps so that I can reproduce the issue.

jot4p commented 12 months ago

What OS are you using? - ubuntu 20.04 Do you use Docker Engine or Docker Desktop? docker engine - portainer logs Was the version of TBMQ from which you upgraded v1.0.1? 1.0.1 to 1.1.0 Was the result of ./tbmq-upgrade.sh script successful? yes, but never work anymore if I don't remove the "old" folder

dmytro-landiak commented 12 months ago

@jot4p,

On an Ubuntu 20.04 machine, I have done the following:

Downloaded the docker-compose.yml file with the following tbmq version: image: "thingsboard/tbmq:1.0.1"

Then installed this version using:

wget https://raw.githubusercontent.com/thingsboard/tbmq/main/msa/tbmq/configs/tbmq-install-and-run.sh && sudo chmod +x tbmq-install-and-run.sh && ./tbmq-install-and-run.sh

And finally upgraded it to 1.1.0 using:

wget https://raw.githubusercontent.com/thingsboard/tbmq/main/msa/tbmq/configs/tbmq-upgrade.sh && sudo chmod +x tbmq-upgrade.sh && ./tbmq-upgrade.sh

image

All went successfully, so it is not possible for me to reproduce the issue for now. Please correct me or the steps I have done if they differ in your case.

dmytro-landiak commented 11 months ago

@jot4p are you able to provide any feedback regarding the above info?

dmytro-landiak commented 11 months ago

Closing due to inactivity. Please, reopen with additional comments otherwise.