PSQLException: ERROR: relation “analytics_enrollment_ ” does not exist

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select count(pi) as value,‘202408’ as Monthly from analytics_enrollment_z5pwm6icfvs as ax where (enrollmentdate >= cast( ‘2024-08-01’ as date ) and enrollmentdate < cast( ‘2024-09-01’ as date )) and (ax.“uidlevel4” = ‘wVrE6nHlLe8’ ) and ((coalesce(“KP50mnl6kcE”::text,‘’) = ‘F’)) limit 100001]; nested exception is org.postgresql.util.PSQLException: ERROR: relation “analytics_enrollment_z5pwm6icfvs” does not exist

Hello @Shamsdine_Ndaw

This error means that you did not run the analytics. You have to run the analytics in the data administration module.

Regards;

1 Like

I emptied the analytics tables and restarted them but once in app visualizer it still shows me this error in my logs

@Shamsdine_Ndaw what do you mean by you restared them ?

is the analytics running successfully ?

Yes @didate i start the analytics in the data administration and is running successfully but I have the same error

Hi @Shamsdine_Ndaw

What version of DHIS2 are you using? Please share the complete Catalina.out log (without sensitive / authentication info) .

Thanks!

[2025-02-03 23:22:55] [info] #011at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
[2025-02-03 23:22:55] [info] #011at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
[2025-02-03 23:22:55] [info] #011at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)
[2025-02-03 23:22:55] [info] #011at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
[2025-02-03 23:22:55] [info] #011at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:351)
[2025-02-03 23:22:55] [info] #011at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:375)
[2025-02-03 23:22:55] [info] #011at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
[2025-02-03 23:22:55] [info] #011at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
[2025-02-03 23:22:55] [info] #011at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594)
[2025-02-03 23:22:55] [info] #011at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
[2025-02-03 23:22:55] [info] #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[2025-02-03 23:22:55] [info] #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[2025-02-03 23:22:55] [info] #011at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
[2025-02-03 23:22:55] [info] #011at java.base/java.lang.Thread.run(Thread.java:829)
[2025-02-03 23:22:55] [info] Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
[2025-02-03 23:22:55] [info] #011at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
[2025-02-03 23:22:55] [info] #011at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
[2025-02-03 23:22:55] [info] #011at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
[2025-02-03 23:22:55] [info] #011at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
[2025-02-03 23:22:55] [info] #011at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
[2025-02-03 23:22:55] [info] #011at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:333)
[2025-02-03 23:22:55] [info] #011at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:319)
[2025-02-03 23:22:55] [info] #011at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:295)
[2025-02-03 23:22:55] [info] #011at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:244)
[2025-02-03 23:22:55] [info] #011at com.mchange.v2.c3p0.impl.NewProxyStatement.executeQuery(NewProxyStatement.java:327)
[2025-02-03 23:22:55] [info] #011at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:452)
[2025-02-03 23:22:55] [info] #011at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381)
[2025-02-03 23:22:55] [info] #011… 203 more
[2025-02-03 23:22:55] [info] Caused by: org.postgresql.util.PSQLException: ERROR: relation “analytics_event_p5jdkhd86j9” does not exist
[2025-02-03 23:22:55] [info] Position: 114
[2025-02-03 23:22:55] [info] #011… 215 more