Skip to content

Release 1.18.0#163

Merged
Ramon-Jimenez merged 26 commits into
masterfrom
development
Jun 25, 2026
Merged

Release 1.18.0#163
Ramon-Jimenez merged 26 commits into
masterfrom
development

Conversation

@Ramon-Jimenez

Copy link
Copy Markdown
Contributor

No description provided.

cgbautista and others added 26 commits July 29, 2025 17:39
… to choose between the different tomcat/java versions and tried to use `docker build` with 3 different Dockerfile in 3 subfolders

Moved the sleep in wait_for_server to let docker start nginx before trying to connect to it (raising an exception). Even in the best case scenario in which nginx would start before reaching this code, tomcat would likely take a little extra to be ready, so the sleep will take place at least once (usually several times, since a migration would include some SQL to be run before tomcat would be in a ready state and until then a 502 error would be generated each time it is tested)
- The first `d2-docker start ... -k` changes the LOAD_FROM_DATA env
  variable, destroying the core and data containers in the process, but
  keeping the volumes. That means that the INIT_DONE_FILE in the core
  container is no longer present and will always try to copy apps,
  documents, datavalues and will try to run sql files and pre-scripts.
  As the data container is run first and sees the LOAD_FROM_DATA=no, it
  will remove ALL contents under /data, so no apps, documents,
  datavalues or SQL files should be present for the core container but
  the mapped volume /data/db/post is still there, but not reachable
  (there is no /data/db, so `find /data/db/post` fails). Two safelines
  here: data container will create /data/db after deleting /data/*; the
  core container will check if there is a directory or not for
  base_db_path
- Second: core container launches catalina.sh run in background, then
  waits for it to be ready and runs post-scripts. After that hangs in a
  wait until the container is stopped. When stopping the container, the
  term signal is not reaching tomcat and after 10 seconds the container
  is killed, thus generating a RC=137. As the docker-compose.yml has a
  restart:no, this prevents the core image from loading up automatically
  after a reboot (a manual d2-docker start will work as it does not
  depend on the RC of the previous stop). So the TERM signal is captured
  and it launches a catalina.sh stop and waits a little for it to
  finish. In any case, the RC from both the wait and the cleanup is
  forced to 0 to avoid errors.
…for the core container to not be restarted upon exit, to avoid mandatory SQL to be bypassed and exposing data that should have been altered/deleted.

This had the side effect of not starting the core container upon server restart.
As the core container is needed for the service, the logic has been changed so upon mandatory-SQL execution error, instead of just stopping, it removes the application and creates a flag in a named volume to persist this behavior upon core restart: it will delete the application and show a generic error, but will keep the container up and running.
This achieves a better result in both scenarios:
- In case of SQL error, the application won't work until the error is
  addressed. The db container would be working and the SQL could be run
  to fix the issue and adjust the SQL script accordingly.
- In case all works as intended, even after server restart, the
  container will behave just like the other two db/gateway containers.
compose file to avoid having to edit two files if this setting were to
be modified.
Fixed typo
Change runner type from self-hosted to general-runner
…on_improve

extract error logic and improve error code workflow
Created a new function to unify tomcat startup in all scenarios.
Removed old cert from Dockerfile (hardcoded and no longer needed)
Removed flag checks from `entrypoints` to use the `start.sh` from the
PR.
TO-DO:
 - check whether the `docker-entrypoint.sh` from the `images/dhis2-core`
   is needed as it is not used in `Dockerfile`, nor defined as
   `ENTRYPOINT, nor used in `docker-compose.yml`
 - check if `$INIT_DONE_FILE` should be placed on a named volume to be
   persisted between flag changes or not
it has it, but prepends a leading "/" afterwards
(to ensure that DEPLOY_PATH has always a single
leading "/").
But in dhis2-core-start.sh it creates 2 urls with
"localhost:8080/$DEPLOY_PATH", so the final url
has a "localhost:8080//path" format
This leads the internal checkup script with curl
to cause an error as, at least for DHIS2.42, does
not recognize that "//path"
As the function "wait_for_tomcat" may not finish
at all, the function "run_post_scripts" may not
even run, leading to some unfinished setups.
Fix upgrade command that would stop during docker build
…eboot

Addresses several issues during the re-start of the core container
Feature: Add external database volume and external database connection
@Ramon-Jimenez Ramon-Jimenez merged commit 63f2f97 into master Jun 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants