mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.08k stars 442 forks source link

StopSignal SIGTERM failed to stop container nominatim in 10 seconds, resorting to SIGKILL #374

Closed makhomed closed 1 year ago

makhomed commented 2 years ago

Describe the bug

Container ignores SIGTERM signal and killed via SIGKILL signal.

To Reproduce Steps to reproduce the behavior:

  1. Use command # podman stop nominatim
  2. See error WARN[0010] StopSignal SIGTERM failed to stop container nominatim in 10 seconds, resorting to SIGKILL

Expected behavior

Expected clear shutdown on SIGTERM signal in 10 seconds.

Screenshots & Logs

Container start after shutdown via SIGKILL: database system was not properly shut down; automatic recovery in progress:

+ trap stopServices SIGTERM TERM INT
+ /app/config.sh
+ id nominatim
+ useradd -m -p qaIACxO6wMR3 nominatim
+ IMPORT_FINISHED=/var/lib/postgresql/14/main/import-finished
+ '[' '!' -f /var/lib/postgresql/14/main/import-finished ']'
+ chown -R nominatim:nominatim /nominatim
+ service postgresql start
 * Starting PostgreSQL 14 database server
   ...done.
+ cd /nominatim
+ sudo -E -u nominatim nominatim refresh --website --functions
sudo: unable to send audit message: Operation not permitted
2022-09-15 06:58:41: Using project directory: /nominatim
2022-09-15 06:58:41: Create functions
2022-09-15 06:58:43: Setting up website directory at /nominatim/website
+ service apache2 start
 * Starting Apache httpd web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.88.0.5. Set the 'ServerName' directive globally to suppress this message
 *
+ wait
+ tail -f /var/log/postgresql/postgresql-14-main.log
2022-09-15 06:58:39.403 UTC [36] LOG:  starting PostgreSQL 14.5 (Ubuntu 14.5-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, 64-bit
2022-09-15 06:58:39.403 UTC [36] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-09-15 06:58:39.403 UTC [36] LOG:  listening on IPv6 address "::", port 5432
2022-09-15 06:58:39.403 UTC [36] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-09-15 06:58:39.405 UTC [37] LOG:  database system was interrupted; last known up at 2022-09-15 06:56:56 UTC
2022-09-15 06:58:39.406 UTC [37] LOG:  database system was not properly shut down; automatic recovery in progress
2022-09-15 06:58:39.407 UTC [37] LOG:  redo starts at 4/EB9F6FA8
2022-09-15 06:58:39.408 UTC [37] LOG:  invalid record length at 4/EBA252F0: wanted 24, got 0
2022-09-15 06:58:39.408 UTC [37] LOG:  redo done at 4/EBA252B8 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2022-09-15 06:58:39.419 UTC [36] LOG:  database system is ready to accept connections

Desktop / Server (please complete the following information):

Additional context

#!/bin/bash

podman run -i --shm-size=1g \
    -v /srv/nominatim-var-lib-postgresql-14-main:/var/lib/postgresql/14/main \
    -e PBF_URL=https://download.geofabrik.de/europe/ukraine-latest.osm.pbf \
    -e REPLICATION_URL=https://download.geofabrik.de/europe/ukraine-updates/ \
    -p 8080:8080 \
    --name nominatim \
    docker.io/mediagis/nominatim:4.1
philipkozeny commented 2 years ago

This should be fixed after we merge https://github.com/mediagis/nominatim-docker/pull/373

philipkozeny commented 1 year ago

Fixed with the merge of https://github.com/mediagis/nominatim-docker/pull/373