hp14
hp14

Reputation: 1

Error when installing Thingsboard CE on Ubuntu OS

I'm installing Thingsboard CE following the installation guides for ubuntu os. When i executed this command: "sudo /usr/share/thingsboard/bin/install/install.sh --loadDemo" and this error appeared: "rg.postgresql.util.PSQLException: ERROR: constraint "fk_device_profile_ota_package" for relation "ota_package" already exists".

Here is my full log report:

Starting ThingsBoard Installation... Installing DataBase schema for entities... Installing SQL DataBase schema part: schema-entities.sql Unexpected error during ThingsBoard installation! org.postgresql.util.PSQLException: ERROR: constraint "fk_device_profile_ota_package" for relation "ota_package" already exists at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:322) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:308) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:284) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:279) at org.thingsboard.server.service.install.SqlAbstractDatabaseSchemaService.executeQueryFromFile(SqlAbstractDatabaseSchemaService.java:82) at org.thingsboard.server.service.install.SqlAbstractDatabaseSchemaService.createDatabaseSchema(SqlAbstractDatabaseSchemaService.java:63) at org.thingsboard.server.service.install.SqlAbstractDatabaseSchemaService.createDatabaseSchema(SqlAbstractDatabaseSchemaService.java:57) at org.thingsboard.server.install.ThingsboardInstallService.performInstall(ThingsboardInstallService.java:239) at org.thingsboard.server.ThingsboardInstallApplication.main(ThingsboardInstallApplication.java:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467) Unexpected error during ThingsBoard installation! ThingsBoard installation failed!

Anybody please help me! Thank you all!

Upvotes: 0

Views: 438

Answers (1)

Karthik Vishwanath
Karthik Vishwanath

Reputation: 21

I had the same issue. Not entirely sure what was wrong, but it seems like the conflict arises if there are multiple installations of PostgreSQL.

So the only option left for me after hours of digging around was to uninstall ThingsBoard and PostgreSQL completely and reinstall all of them back. It worked flawlessly after that. Hope they fix the bug soon.

EDIT: So found out that you can't run the install command multiple times the installation with the same database. Simple drop the database and create a new one and run the install command.

Upvotes: 0

Related Questions