Help with Tracker

Hello.
We are currently using DHIS2.30.

We are having a few issues with tracker programs that we cannot figure out. The interesting thing is that we cannot reproduce them on the demo site.

Firstly, we have programs we created, which we created in I think ver 2.27. They do not contain any data, but we cannot delete them. When you try to delete, you see this:

Secondly, we created a new event program for a survey and commenced data entry this morning. We observed some errors in the entries and tried to edit the entries. When you click on the record and on edit, nothing happens. One would expect the record to open but nothing happens. You get a response when clicking on Edit in grid, audit history, and remove. The only way now to make the edits is to delete the record and enter the data all over again.

I tried to see if I could edit the record using the mobile app but the records are not showing up on the app.

I have checked sharing settings, user roles to see what could be wrong and not arrived at anything.

The fact that this is not reproducible is also a challenge.

Have you encountered anything like this before and what guidance to resolve it can you provide?

1 Like

Hey there!

Deleting programs:
When deleting programs fail, there will usually be a helpful error message in the system log. Can you access the catalina/server log and see what errors occur when you try and delete?

Unable to edit:
It seems the app crashes when trying to open existing events. Can you open the devloper console in your browser and see if there is any errors that is displayed?

Best regards,
Markus

1 Like

This may not be helpful, but in the past, for tracker/event programs, you may be able to SEE all records, but you can only EDIT a record if you first click into the org unit where it was originally created, then load the specific record from within that org unit.

1 Like

Hello Again,
I experienced this error while trying to register a patient in a tracker program

What could be the problem?

1 Like

Dear All,
Please could someone help us take a look at this?

1 Like

Hi @Emma_Kassy - are you able to check this out for @ifeanyiokoye please?

Thanks @jomutsani

1 Like

Hi there @ifeanyiokoye,
the server error message says that there is already an existing active enrollment in the program. I assume you are trying to enroll an existing patient into the tracker program, and not a new one. If this is not the case, let me know.
The reason the tracker client allows you to try and create a new enrollment might be that the user you are logged in with does not have access to see the enrollment already existing for the program.

Can you check the “Search organisation unit” in the users app for the user you are trying to create the enrollment with? The “Search organisation unit” should be set to a high enough level so that the user can see any existing enrollments.

If you try and log in with a superuser and open the patient dashboard, perhaps you are able to see any existing enrollments?

Markus

2 Likes

Hello @Markus,
Thank you for the response.

All searches for existing enrollments using all the IDs have returned nothing. Since we built this program, it has not taken us past the registration page. When I click on save and continue, nothing happens.

I actually have been using a superuser account for all these activities.

I also saw this on the console

Failed to load resource: the server responded with a status of 404 (Not Found)
dhis2.angular.directives.js:20 on outree
angular.js:11655 TypeError: Cannot read property ‘endDate’ of undefined
at services.js:2430
at Object.r [as forEach] (angular.js:323)
at Object.autoGenerateEvents (services.js:2409)
at registration-controller.js:511
at angular.js:13248
at n.$eval (angular.js:14466)
at n.$digest (angular.js:14282)
at n.$apply (angular.js:14571)
at l (angular.js:9698)
at M (angular.js:9888)

Not sure what it means only that it comes up after I click save and continue.

1 Like

Aha - there is a problem with the periodtype assigned to the program stage. Did you plan to use the period types for your program stages? To test wether we are on the right track you can do the following:
Open program in maintenance, navigate to each of the program stages and make sure “period type”(7th item from the top) is blank/no value.

Markus

2 Likes

Hello @Markus, I removed all the period types in the stages and it now works.

However, I need to understand why this was a problem and the utility of that field.

Thank you for your patience and understanding.

When the period type on program stage works, it will mask the event date selection and replace it with a period picker. We are actually in the process of possibly removing the period selection for program stages, at least calling the commmunity for information on how its used:

2 Likes

Thanks @Markus and my apologies for responding to this so late. So sorry.
This is what shows up on the console and I will get the logs and share as well…

kbw5LW8T 500 (Internal Server Error)
(anonymous) @ Api.js:342
value @ Api.js:339
value @ Api.js:200
value @ ModelDefinition.js:414
value @ ModelBase.js:191
onActionTouchTap @ ContextActions.js:70
n.handleTouchTap @ EnhancedButton.js:153
r @ ReactErrorUtils.js:26
a @ EventPluginUtils.js:85
s @ EventPluginUtils.js:108
f @ EventPluginHub.js:43
v @ EventPluginHub.js:54
n @ forEachAccumulated.js:24
processEventQueue @ EventPluginHub.js:257
r @ ReactEventEmitterMixin.js:17
handleTopLevel @ ReactEventEmitterMixin.js:28
i @ ReactEventListener.js:72
perform @ Transaction.js:140
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
i @ ReactUpdates.js:97
dispatchEvent @ ReactEventListener.js:147
Api.js:351 API request failed with status 500 Internal Server Error
Request: DELETE https://url/api/29/programs/scUkbw5LW8T
(anonymous) @ Api.js:351
Promise.then (async)
(anonymous) @ Api.js:349
Promise.then (async)
(anonymous) @ Api.js:342
value @ Api.js:339
value @ Api.js:200
value @ ModelDefinition.js:414
value @ ModelBase.js:191
onActionTouchTap @ ContextActions.js:70
n.handleTouchTap @ EnhancedButton.js:153
r @ ReactErrorUtils.js:26
a @ EventPluginUtils.js:85
s @ EventPluginUtils.js:108
f @ EventPluginHub.js:43
v @ EventPluginHub.js:54
n @ forEachAccumulated.js:24
processEventQueue @ EventPluginHub.js:257
r @ ReactEventEmitterMixin.js:17
handleTopLevel @ ReactEventEmitterMixin.js:28
i @ ReactEventListener.js:72
perform @ Transaction.js:140
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
i @ ReactUpdates.js:97
dispatchEvent @ ReactEventListener.js:147
ContextActions.js:93 {httpStatus: “Internal Server Error”, httpStatusCode: 500, status: “ERROR”, message: “could not execute statement”}
(anonymous) @ ContextActions.js:93
Promise.catch (async)
onActionTouchTap @ ContextActions.js:92
n.handleTouchTap @ EnhancedButton.js:153
r @ ReactErrorUtils.js:26
a @ EventPluginUtils.js:85
s @ EventPluginUtils.js:108
f @ EventPluginHub.js:43
v @ EventPluginHub.js:54
n @ forEachAccumulated.js:24
processEventQueue @ EventPluginHub.js:257
r @ ReactEventEmitterMixin.js:17
handleTopLevel @ ReactEventEmitterMixin.js:28
i @ ReactEventListener.js:72
perform @ Transaction.js:140
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
i @ ReactUpdates.js:97
dispatchEvent @ ReactEventListener.js:147

Thanks for your help

1 Like

Thank you @ifeanyiokoye - the log above seems to be coming from your internet browser. Can you also try to get the log from the server side? The server that is running DHIS would normally log errors and infi to a log file when we see these “status 500 Internal Server Error” messages.

1 Like

Hello @Markus,
here are the catalina logs

  • ERROR 2019-09-13 12:58:36,716 ERROR: update or delete on table “program” violates foreign key constraint “fkgb55kdvtf92qykh2840inyhst” on table “program_userroles”
    Detail: Key (programid)=(634) is still referenced from table “program_userroles”. (SqlExceptionHelper.java [tomcat-http-8])
    javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:149)
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:164)
    at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1443)
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1423)
    at org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:200)
    at sun.reflect.GeneratedMethodAccessor1767.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    at com.sun.proxy.$Proxy214.commit(Unknown Source)
    at org.hisp.dhis.dxf2.metadata.DefaultMetadataImportService.importMetadata(DefaultMetadataImportService.java:136)
    at sun.reflect.GeneratedMethodAccessor1760.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    at com.sun.proxy.$Proxy218.importMetadata(Unknown Source)
    at org.hisp.dhis.webapi.controller.AbstractCrudController.deleteObject(AbstractCrudController.java:811)
    at sun.reflect.GeneratedMethodAccessor2594.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:849)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:760)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    at org.springframework.web.servlet.FrameworkServlet.doDelete(FrameworkServlet.java:894)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:656)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:126)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:69)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.hisp.dhis.servlet.filter.HttpUrlPatternFilter.doFilter(HttpUrlPatternFilter.java:120)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:110)
    at org.hisp.dhis.servlet.filter.ExcludableShallowEtagHeaderFilter.doFilterInternal(ExcludableShallowEtagHeaderFilter.java:112)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:178)
    at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
    at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3339)
    at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3596)
    at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:99)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:600)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:474)
    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
    at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1437)
    … 131 more
    Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table “program” violates foreign key constraint “fkgb55kdvtf92qykh2840inyhst” on table “program_userroles”
    Detail: Key (programid)=(634) is still referenced from table “program_userroles”.
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)
    at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:120)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:384)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)
    … 140 more

Thank you so much for your help

1 Like

Hi again!
This seems to indicate that there is a user role that is connected to the program. Can you see if this is the case, and delete this role?

Markus

2 Likes

Hello @Markus,
So, this is what I have done:

  1. Looked at the sahring settings for each one of the programs and removed everything and set public access to no access. However keep in mind that sharing settings to my knowledge affect users and user groups

  2. I have looked at all the user roles in the system and cannot quite figure how the association with specific programs works. However, I have unchecked all the permissions that have to do with tracker and events.

  3. I had previously deleted all program stages, removed all attributes, and access to org units.

All the programs were created using the admin account. I have deleted the user roles associated with the admin account (added the account to a newly created role).

I still cannot delete the programs. Possibly missed something in doing all this.

What do you think?

1 Like

Hi again @ifeanyiokoye,
Am I right in assuming that this database was originally 2.28 or older, and where later upgraded to 2.30?
From 2.29 onwards, the program_userrole table is no longer used, but in 2.28 and older databases the table would be in use. The upgrade does not remove the table unfortunately, and it would be necessary to run a sql script for manually cleaning the database:
delete * from program_userroles;

Based on your request we are now also looking into making a permanent fix to have the cleanup happen automatically.

Markus

2 Likes

Hello @Markus,
You are right about the database.
We started from 2.16 actually.

We’ll get on it and get back to you.

1 Like

Hello @Markus,
Just to provide an update that we deleted all the records from the table program_userroles and have successfully deleted all the rogue programs we had.

Thank you so much for your help. Most appreciated.

Ifeanyi

2 Likes