Dashboard error

Hi
I have removed the previous version of teh dashboard add-on and added the latest version. However, the database Entity is not created and throwing the following excepton:

com.haulmont.cuba.core.global.RemoteException:
---
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.2-cuba): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "dashboard_persistent_dashboard" does not exist
  Position: 357
Error Code: 0
Call: SELECT t1.ID AS a1, t1.REFERENCE_NAME AS a2, t1.CREATE_TS AS a3, t1.CREATED_BY AS a4, t1.DELETE_TS AS a5, t1.DELETED_BY AS a6, t1.IS_AVAILABLE_FOR_ALL_USERS AS a7, t1.NAME AS a8, t1.UPDATE_TS AS a9, t1.UPDATED_BY AS a10, t1.VERSION AS a11, t1.GROUP_ID AS a12, t0.ID AS a13, t0.DELETE_TS AS a14, t0.DELETED_BY AS a15, t0.NAME AS a16, t0.VERSION AS a17 FROM DASHBOARD_PERSISTENT_DASHBOARD t1 LEFT OUTER JOIN DASHBOARD_DASHBOARD_GROUP t0 ON (t0.ID = t1.GROUP_ID) WHERE (((t1.IS_AVAILABLE_FOR_ALL_USERS = ?) OR (t1.CREATED_BY = ?)) AND (t1.DELETE_TS IS NULL)) ORDER BY t1.NAME LIMIT ? OFFSET ?
	bind => [true, admin-assurance, 50, 0]
Query: ReadAllQuery(referenceClass=PersistentDashboard sql="SELECT t1.ID AS a1, t1.REFERENCE_NAME AS a2, t1.CREATE_TS AS a3, t1.CREATED_BY AS a4, t1.DELETE_TS AS a5, t1.DELETED_BY AS a6, t1.IS_AVAILABLE_FOR_ALL_USERS AS a7, t1.NAME AS a8, t1.UPDATE_TS AS a9, t1.UPDATED_BY AS a10, t1.VERSION AS a11, t1.GROUP_ID AS a12, t0.ID AS a13, t0.DELETE_TS AS a14, t0.DELETED_BY AS a15, t0.NAME AS a16, t0.VERSION AS a17 FROM DASHBOARD_PERSISTENT_DASHBOARD t1 LEFT OUTER JOIN DASHBOARD_DASHBOARD_GROUP t0 ON (t0.ID = t1.GROUP_ID) WHERE (((t1.IS_AVAILABLE_FOR_ALL_USERS = ?) OR (t1.CREATED_BY = ?)) AND (t1.DELETE_TS IS NULL)) ORDER BY t1.NAME LIMIT ? OFFSET ?")
FetchGroup(){deleteTs, code, updatedBy, createdBy, name, createTs, id, isAvailableForAllUsers, updateTs, version, deletedBy, group => {class java.lang.Object=FetchGroup(group){deleteTs, name, id, version, deletedBy}}}
---
org.eclipse.persistence.exceptions.DatabaseException: 
Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "dashboard_persistent_dashboard" does not exist
  Position: 357
Error Code: 0
Call: SELECT t1.ID AS a1, t1.REFERENCE_NAME AS a2, t1.CREATE_TS AS a3, t1.CREATED_BY AS a4, t1.DELETE_TS AS a5, t1.DELETED_BY AS a6, t1.IS_AVAILABLE_FOR_ALL_USERS AS a7, t1.NAME AS a8, t1.UPDATE_TS AS a9, t1.UPDATED_BY AS a10, t1.VERSION AS a11, t1.GROUP_ID AS a12, t0.ID AS a13, t0.DELETE_TS AS a14, t0.DELETED_BY AS a15, t0.NAME AS a16, t0.VERSION AS a17 FROM DASHBOARD_PERSISTENT_DASHBOARD t1 LEFT OUTER JOIN DASHBOARD_DASHBOARD_GROUP t0 ON (t0.ID = t1.GROUP_ID) WHERE (((t1.IS_AVAILABLE_FOR_ALL_USERS = ?) OR (t1.CREATED_BY = ?)) AND (t1.DELETE_TS IS NULL)) ORDER BY t1.NAME LIMIT ? OFFSET ?
	bind => [true, admin-assurance, 50, 0]
Query: ReadAllQuery(referenceClass=PersistentDashboard sql="SELECT t1.ID AS a1, t1.REFERENCE_NAME AS a2, t1.CREATE_TS AS a3, t1.CREATED_BY AS a4, t1.DELETE_TS AS a5, t1.DELETED_BY AS a6, t1.IS_AVAILABLE_FOR_ALL_USERS AS a7, t1.NAME AS a8, t1.UPDATE_TS AS a9, t1.UPDATED_BY AS a10, t1.VERSION AS a11, t1.GROUP_ID AS a12, t0.ID AS a13, t0.DELETE_TS AS a14, t0.DELETED_BY AS a15, t0.NAME AS a16, t0.VERSION AS a17 FROM DASHBOARD_PERSISTENT_DASHBOARD t1 LEFT OUTER JOIN DASHBOARD_DASHBOARD_GROUP t0 ON (t0.ID = t1.GROUP_ID) WHERE (((t1.IS_AVAILABLE_FOR_ALL_USERS = ?) OR (t1.CREATED_BY = ?)) AND (t1.DELETE_TS IS NULL)) ORDER BY t1.NAME LIMIT ? OFFSET ?")
FetchGroup(){deleteTs, code, updatedBy, createdBy, name, createTs, id, isAvailableForAllUsers, updateTs, version, deletedBy, group => {class java.lang.Object=FetchGroup(group){deleteTs, name, id, version, deletedBy}}}
---
org.postgresql.util.PSQLException: ERROR: relation "dashboard_persistent_dashboard" does not exist
  Position: 357
	at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:129)
	at sun.reflect.GeneratedMethodAccessor264.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)

Hi @mortozakhan,

What addon and platform version do you use in your project?

Regards,
Evgeny

Hi @evgeny.zaharchenko
All are the latest versions- Studio, platform and the add-on that you have released very recently.

Please try to run database update from Studio

Tried few times already before reporting to the forum! I mean executed “update database” and also “generate database script” nothing is making necessary update in database to eliminate that error. Is it because the database update script is not working in the new version of add-on?

Please provide a small test project where this issue can be replicated.
Which database do you use in your project?

I am using Postgres database.

It wored when I used to update a Sting field instead of enum used in this case. As the ProcessState is an Enum class, do you think I am missing here anything that related?

Please check that there are no following records in sys_db_changelog table

50-dashboard-addon/init/postgres/10.create-db.sql
50-dashboard-addon/init/postgres/20.create-db.sql
50-dashboard-addon/init/postgres/30.create-db.sql

If there are these records then please try to delete these records.

Hi @evgeny.zaharchenko
Thanks, removed those records and I see tables are recreated in the database.

However, now I see the following remaining error:

ERROR: Database update failed. See details below.
=================================================
Error executing SQL script 190429-0-renameWidgetTemplateGroupTable.sql
ERROR: relation "dashboard_widget_template_group" does not exist
	at com.haulmont.cuba.core.sys.dbupdate.DbUpdaterEngine.executeSqlScript(DbUpdaterEngine.java:354)

But I don’t have any such SQL in my Data Stores update folder

image

where is that SQL that I should remove from?

Hi @mortozakhan,

Please try to remove this script from sys_db_changelog table

Hi Evgeny
Checked, that script doesn’t exist:

image

Hi Evgeny
I found there were more entries in the sys_db_changelog, after deleting the following, I am able to run the application.

delete from sys_db_changelog e where e.script_name LIKE '%Widget%'
delete from sys_db_changelog e where e.script_name LIKE '%dashboard%'

@evgeny.zaharchenko
I haven’t seen the new demo project based on the latest version of Dashboard add-on, when are you going to publish it?

Hi @mortozakhan

we have updated dependencies in demo application to release versions

Regards,
Evgeny

1 Like