mediagis / nominatim-docker

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

psycopg2.OperationalError: server closed the connection unexpectedly #565

Open rmallol opened 1 month ago

rmallol commented 1 month ago

Describe the bug Automatic import from docker image returns error after running for a while.

To Reproduce Steps to reproduce the behavior:

  1. Use command 'docker run -it \ -e PBF_URL=https://download.geofabrik.de/europe/spain/cataluna-latest.osm.pbf \ -e POSTGRES_CHECKPOINT_TIMEOUT=20min \ -p 8080:8080 \ --name nominatim \ mediagis/nominatim:4.4'
  2. See error psycopg2.OperationalError: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

Expected behavior Nominatim is installed correctly.

Screenshots & Logs nominatim issue

Desktop / Server (please complete the following information):

Additional context

mtmail commented 1 month ago

Thanks for the hardware info.

The postgresql logfiles inside the container might have a better error message. But effectively Postgresql crashes and usually that's because it hit a hardware limit. On a local machine we can rule out network (network mounted storage).

The https://github.com/mediagis/nominatim-docker/tree/master/4.4#postgresql-tuning default are probably too large for an 8GB machine, they were chosen for a 64GB machine. And on a desktop computer the 8GB might not even be available. Try configuring lower values. (https://postgresqlco.nf/doc/en/param/shared_buffers/14/)

shadowbeat070 commented 3 weeks ago

I've experienced this bug as well, tbh i'm still not quite sure of the cause.

I can reproduce this bug by running the following docker compose

services:
  nominatim:
    image: mediagis/nominatim:4.4
    environment:
      - PBF_URL=https://download.geofabrik.de/europe/netherlands-latest.osm.pbf
      - REPLICATION_URL=https://download.geofabrik.de/europe/netherlands-updates/
    ports:
      - "8080:8080"
    container_name: nominatim

however if ran the following command :

"docker run -it -e PBF_URL=https://download.geofabrik.de/europe/netherlands-latest.osm.pbf -e REPLICATION_URL=https://download.geofabrik.de/europe/netherlands-updates/ -p 8080:8080 --name nominatim mediagis/nominatim:4.4"

it would succeed. Im running both commands/services on the exact same machine. what i assume to be the reason is that whenever use the docker compose file it uses my C drive which is but when runnnig through the docker command it will use my E drive which is larger, faster and has more space than my C drive.

I'm not too sure about the details of the problem but this was what fixed it for me.