While using DHIS2 (version-2.29), sometimes, we are facing following error on the browser.
Unable to get schemas from the DHIS2 API.
While tailing the dhis.log file, we found following message:-
WARN 2018-10-25 09:02:02,525 Failed to invoke @ExceptionHandler method: public void org.hisp.dhis.webapi.controller.CrudControllerAdvice.defaultExceptionHandler(java.lang.Exception,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception (ExceptionHandlerExceptionResolver.java [http-nio-8080-exec-74])
java.lang.NullPointerException
at org.hisp.dhis.webapi.service.WebMessageService.send(WebMessageService.java:96)
at org.hisp.dhis.webapi.controller.CrudControllerAdvice.defaultExceptionHandler(CrudControllerAdvice.java:259)
at org.hisp.dhis.webapi.controller.CrudControllerAdvice$$FastClassBySpringCGLIB$$e80bbad6.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:669)
at org.hisp.dhis.webapi.controller.metadata.sync.MetadataSyncController$$EnhancerBySpringCGLIB$$1c221b30.defaultExceptionHandler(<generated>)
at sun.reflect.GeneratedMethodAccessor1405.invoke(Unknown Source)
From the few months experience, this is usually caused by an expired session token. If you login to your dhis2 and remain in-active for some few minutes (30 in my case), your session expires while you remain logged in and if you try to do anything else, you get blocked and this error. Login out and back in has been our way round this. There should be a place where you configure maximum allowed inactivity time but I cant remember where just now, am sure the more experienced users will advise.
Thank you very much for your prompt reply. But interestingly, the account was not in-active even for one minute. While I log into dhis2 and then try to got any other app (system settings, maintenance etc.) or even I reload the dashboard page, 5 out of 10 times it provides this error.
Also in the chrome browser console I received following error.
Thanks & Regards,
Rakib
···
On Thu, Oct 25, 2018 at 11:11 AM Walusiku Muyunda jomuwalu@gmail.com wrote:
From the few months experience, this is usually caused by an expired session token. If you login to your dhis2 and remain in-active for some few minutes (30 in my case), your session expires while you remain logged in and if you try to do anything else, you get blocked and this error. Login out and back in has been our way round this. There should be a place where you configure maximum allowed inactivity time but I cant remember where just now, am sure the more experienced users will advise.
I have a user with a similar error, in Version: 2.30, Build revision: ac877b4, Build date: 2018-10-29 15:54. I don’t know how many minutes pass between the login and the error, but I do know that data is being entered into the /dhis-web-dataentry/ form, and the data is not being saved into the browser cache as expected. This is happening in a low bandwidth environment (<4 MBPS) and also a medium bandwidth environment (25MBps).
I don’t have access to the Chrome browser console, but I did ask the user to send to me the version of Chrome (70.0.3538.110) and the list of extensions that are installed. They are:
adobe acrobat
cisco webex extension
grammarly for chrome
lastpass
nueva pestaña y busqueda de yahoo
project gutenberg
todoist
send to kindlee for google chrome
save to pocket
obtenezemail
mendeley
inbox
documentos de google sin coneccion
boton de google academico
Can anyone provide more information about the offline data storage functionality and how many minutes the session should remain active if internet connectivity is lost?
There was an issue in the user id, deleted that user id and recreated the id with same credentials. After login, I got the same issue, not able to see anything other than " Unable to get schemas from the DHIS2 API".