Unable to start DHIS2 after installation

Thanks Sohel @jomutsani ,

But, I am not sure who marked this as a “Solution” but the issue is far from resolved and the final post can’t possibly constitute a definative solution.

1 Like

Hi @danboy,

Hope you are well. Did you manage to find a workaround this ?

Hi @jomutsani, sadly no!

1 Like

Have you tried using @sohel’s recommendations?

Hi James

You might be aware that Sohel’s recommendations differ wildly to the “recommended” or prescribed method in “Official” Implementation Guide dated May 2019. It is akin to try this or that and suck it and see!

However, if I don’t find a better alternative I may have no choice.

Thanks

Russell

1 Like

I hear you @danboy. Let me try and link you up with @julhas whom I am quite sure can help sort you out.

I hear you @danboy. Let me try and link you up with @julhas whom I am quite sure can help sort you out.

I hear you @danboy. Let me try and link you up with @julhas whom I am quite sure can help sort you out.

@danboy

Which JDK are you using? I see from earlier in the thread that you were using JDK11 initially at least. DHIS2 will not work with JDK11 at this time; you need JDK8.

Kind regards,
Phil

1 Like

Hi @danboy, I can see your issues over skype. My skype id is “julhas08”.

Thanks @jomutsani.

1 Like

Thank you @phil and @julhas :smile:

Thanks @jomutsani

@julhas & @phil I will contact Julhas by Skype at 1400 BST tomorrow.

I have two no three environments none of which work, however I’ll focus on the one and take it from there:

Ubuntu 18.04 Bionic running as a VM on Citrix with 4GB RAM
Postgres 10

Tomcat 8; Open Java 8
Using CATALINA_BASE: /home/dhis/tomcat-dhis
Using CATALINA_HOME: /usr/share/tomcat8
Using CATALINA_TMPDIR: /home/dhis/tomcat-dhis/temp
Using JRE_HOME: /usr/lib/jvm/java-8-openjdk-amd64
Using CLASSPATH: /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
Tomcat started.
Tomcat started

As you can see from the sample below, Tomcat runs, however the deployment of the war file fails. Attempts to reach localhost:8080 and localhost:8080/management both fail returning 404

This is a Sample Web Application - Snoop Servlet

Host Name & IP Address: dhistest01 with IP=192.168.30.111

JVM Name: null

Date & Time: Mon Oct 14 19:34:20 BST 2019

HTTP Request URL : http://192.168.30.111:8080/SampleWebApp/welcome.jsp

HTTP Request Method : GET

HTTP Request Headers Received

host 192.168.30.111:8080
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
accept-language en-GB,en;q=0.5
accept-encoding gzip, deflate
referer http://192.168.30.111:8080/SampleWebApp/
connection keep-alive
cookie JSESSIONID=EADA88005CF99538CFD5A423062F1FCF
upgrade-insecure-requests 1
cache-control max-age=0

HTTP Cookies Received

Thanks

1 Like

Unable to start DHIS2 after installation what could be the problem?

Catalina.out log

root@resten:/home/dhis/tomcat-dhis# cd logs/
root@resten:/home/dhis/tomcat-dhis/logs# tail -f catalina.out
<6>Loaded Apache Tomcat Native library [1.2.31] using APR version [1.7.0].
<6>APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
<6>APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
<6>OpenSSL successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
<6>Initializing ProtocolHandler [“http-nio-8082”]
<6>Server initialization in [1016] milliseconds
<6>Starting service [Catalina]
<6>Starting Servlet engine: [Apache Tomcat/9.0.58 (Ubuntu)]
<6>Deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]
<6>At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

  • INFO 2022-12-14T09:29:00,095 Context variable dhis2-home not set (LogOnceLogger.java [main])
  • INFO 2022-12-14T09:29:00,105 System property dhis2.home not set (LogOnceLogger.java [main])
  • INFO 2022-12-14T09:29:00,106 Environment variable DHIS2_HOME not set (LogOnceLogger.java [main])
  • INFO 2022-12-14T09:29:00,106 Directory /opt/dhis2 cannot be created (LogOnceLogger.java [main])
  • ERROR 2022-12-14T09:29:00,107 No Home directory set, and /opt/dhis2 is not a directory (LogOnceLogger.java [main])
    <2>Error deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]
    <2>java.lang.IllegalStateException: Error starting child
    <2> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
    <2> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
    <2> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
    <2> at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
    <2> at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
    <2> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    <2> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    <2> at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    <2> at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
    <2> at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
    <2> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
    <2> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
    <2> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
    <2> at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
    <2> at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
    <2> at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
    <2> at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
    <2> at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
    <2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    <2> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
    <2> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
    <2> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    <2> at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    <2> at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
    <2> at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
    <2> at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
    <2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    <2> at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
    <2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    <2> at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
    <2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    <2> at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
    <2> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    <2> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    <2> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    <2> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    <2> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
    <2> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:480)
    <2>Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    <2> at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
    <2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
    <2> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
    <2> … 37 more
    <2>Caused by: java.lang.IllegalStateException: Properties could not be loaded
    <2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:343)
    <2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.init(DefaultDhisConfigurationProvider.java:113)
    <2> at org.hisp.dhis.webapi.servlet.DhisWebApiWebAppInitializer.getConfig(DhisWebApiWebAppInitializer.java:115)
    <2> at org.hisp.dhis.webapi.servlet.DhisWebApiWebAppInitializer.onStartup(DhisWebApiWebAppInitializer.java:61)
    <2> at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
    <2> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
    <2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    <2> … 38 more
    <2>Caused by: org.hisp.dhis.external.location.LocationManagerException: External directory not set
    <2> at org.hisp.dhis.external.location.DefaultLocationManager.buildDirectory(DefaultLocationManager.java:303)
    <2> at org.hisp.dhis.external.location.DefaultLocationManager.getFileForReading(DefaultLocationManager.java:233)
    <2> at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:206)
    <2> at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:199)
    <2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:332)
    <2> … 44 more
    <2>
    <6>Deployment of web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war] has finished in [15,864] ms
    <6>Starting ProtocolHandler [“http-nio-8082”]
    <6>Server startup in [16059] milliseconds
1 Like

I’m getting a similar issue deploying on an AWS EC2 instance of Ubunuty 18.04, and as far as I can figure out it feel like a permissions issue and my env variable isn’t working.

From my log file, I think this is my issue, but haven’t figured out the fix yet.
<6>Starting Servlet engine: [Apache Tomcat/9.0.16 (Ubuntu)]
<6>Deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]

  • INFO 2023-01-08T17:11:26,707 Context variable dhis2-home not set (LogOnceLogger.java [main])
  • INFO 2023-01-08T17:11:26,728 System property dhis2.home not set (LogOnceLogger.java [main])
  • INFO 2023-01-08T17:11:26,735 Environment variable DHIS2_HOME not set (LogOnceLogger.java [main])
  • INFO 2023-01-08T17:11:26,737 Directory /opt/dhis2 is not writeable (LogOnceLogger.java [main])
  • ERROR 2023-01-08T17:11:26,739 No Home directory set, and /opt/dhis2 is not a directory (LogOnceLogger.java [main])
    <2>Error deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]
    <2>java.lang.IllegalStateException: Error starting child

I don’t have a lot of experience with Tomcat so tried 8 as well but also didn’t have any luck. I’m going to see if I can get something else running just to make sure its not my Tomcat instance, because that also seems like it might be my problem.

Catalina.out.doc (33.5 KB)

Hi @Hobbes

Are you able to fix this problem? I can help you if not.

Julhas

1 Like

I had a few issues, but wound up finding the main answer on the forum in that 2.39 without https setup doesn’t display anything when connecting to it via http. Tried using 2.38 and seemed to get through my issues.

See my attached post for a working install process for my application, and let me know if you have any suggestions on what I could do better.

Do you have any more detailed info on how to get HTTPS to actually work? Haven’t starting digging too deep, as I think it’s just a matter of getting the right file in the right place, but my current site-wide https through cloudflare breaks the maintenance app and the capture app, and shows there’s a problem with the encryption.