Error in Installing (Error Status 404)

I try to install DHIS2 for one week and always failed :frowning:
I use Java 8 (jdk and jre 8), Postgres 13, Postgis 3.1.2, Tomcat 9 and Latest DHIS account.
I also already set the environment. but no result :frowning:
This is the error messages:

HTTP Status 404 ā€“ Not Found

Type Status Report

Message The requested resource [/dhis] is not available

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Thank you so much! Really appreciate if anyone wants to help!

Hello @retalily ,

can you explain how you installed dhis 2 ? with dhis2-tools ? manually ?

Is your Apache tomcat starting without error ?

Are you on Linux or Windows ?

did you follow the official documentation ?

Hello. I really appreciate the reply!
I installed it with Windows 10. I follow http://dhis-2.blogspot.com/ exactly like the procedure. This is what is written in my tomcat installation:
25-Aug-2021 13:08:17.920 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars 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 2021-08-25T13:08:18,826 System property dhis2.home not set (LogOnceLogger.java [main])
  • INFO 2021-08-25T13:08:18,841 Environment variable DHIS2_HOME points to C:\DHIS2 (LogOnceLogger.java [main])
  • INFO 2021-08-25T13:08:18,857 File C:\DHIS2\dhis-google-auth.json does not exist (LogOnceLogger.java [main])
  • INFO 2021-08-25T13:08:18,857 Could not find dhis-google-auth.json (LogOnceLogger.java [main])
  • INFO 2021-08-25T13:08:22,216 Monitoring metric for key monitoring.jvm.enabled is disabled (MetricsEnabler.java [main])
  • INFO 2021-08-25T13:08:22,216 Monitoring metric for key monitoring.cpu.enabled is disabled (MetricsEnabler.java [main])
  • INFO 2021-08-25T13:08:22,216 Monitoring metric for key monitoring.uptime.enabled is disabled (MetricsEnabler.java [main])
  • INFO 2021-08-25T13:08:22,216 Monitoring metric for key monitoring.dbpool.enabled is disabled (MetricsEnabler.java [main])
  • INFO 2021-08-25T13:08:22,231 Monitoring metric for key monitoring.hibernate.enabled is disabled (MetricsEnabler.java [main])
  • INFO 2021-08-25T13:08:22,231 Monitoring metric for key monitoring.api.enabled is disabled (MetricsEnabler.java [main])
  • INFO 2021-08-25T13:08:26,527 Hibernate configuration loaded: dialect: ā€˜org.hisp.dhis.hibernate.dialect.DhisPostgresDialectā€™, region factory: ā€˜org.hibernate.cache.ehcache.EhCacheRegionFactoryā€™, connection pool max size: null (DefaultHibernateConfigurationProvider.java [main])

This is inside the Path of my environment:


@didate Thank you so much for your help!
I found my own mistake and fixed it now.
Turns out it needs 24 password code for encryption.password=.
Thank you very much for your help! Much appreciated!

3 Likes

Hi there,
I am just a beginner to DHIS2. I have encountered the same problem during my installation of the software. I have revised the blog you have shared but still canā€™t find the problem of why I get 404 error
My environment variables are set properly and set path to jdk/bin location as well.
What is really the problem Iam encountering?

Welcome to the community @kafonogo!

Please try to use the URL: localhost:8080 directly without /dhis/ ?

Thank you @Gassim
I managed to launch dhis2 on windows 10, the thing is I was installing dhis2 using lastest versions of tomcat v10 and PostgreSQL v14 and getting log errors on Catalina FILE as list of JARs that were scanned but no TLDs were found
So i decided to download dhis v2.31, tomcat v8 and PostgreSQL v9, DHIS launched without any errors.
But why shouldnā€™t DHIS work with the lastet versions?

Kafonogo

1 Like

Iā€™m getting the same deal when trying to install this on Ubuntu on an AWS EC2 instance

Iā€™m using what looks to be on official guide but a lot of the commands donā€™t seem to work, or depend on a custom configuration. I havenā€™t figured out how to get the dhis-tools package working either, but honestly I think Iā€™m actually just stuck on Tomcatā€¦ Right now Iā€™m getting the 404 even with just a general index.html in the webapps folder and not the DHIS2 ROOT.war file even downloaded.

Hereā€™s a link to the guide Iā€™m trying to follow along with a few of the commands for installing postgres and postgis that no longer seem to work in this guide (assuming the sources arenā€™t setup the same in the AWS EC2 instance)

Using these commands to install postgres from a digital ocean tutorial

sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql.service

and using these commands found on stackexchange to install the gis extension
sudo apt update
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt install postgis

1 Like

Wound up troubleshooting my issues by watching the ā€œcatalina.outā€ file.
Part of my problem was I was trying to use the free version of AWS which only comes with 1 gigs of ram. This is enough to get you close, but crashes upon loading. Once I tried spinning up an AWS with 2 gigs of ram, I was able to get it to load, but found that it wasnā€™t fully stable. We are currently at 4g of ram, but might even upgrade to the 8g server because we saw a recent crash. Still want to chase down if that was a different issue because it seems to re-load just fun after a reboot.

To monitor the behavior of Tomcat, the log is the primary source of information. The log can be viewed with the following command:

sudo tail -f /home/dhis/tomcat-dhis/logs/catalina.out

To just output everything in the log to the terminal do:

sudo cat /home/dhis/tomcat-dhis/logs/catalina.out