Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psycopg2.OperationalError: server closed the connection unexpectedly #565

Open
rmallol opened this issue Jun 11, 2024 · 2 comments
Open
Labels

Comments

@rmallol
Copy link

rmallol commented Jun 11, 2024

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):

  • OS & Version: [macOS Big Sur 11.7.8]
  • Docker Version: [3.6.0]
  • Nominatim Version: [4.4]

Additional context

  • RAM: 8 GB 1600 MHz DDR3
@rmallol rmallol added the bug label Jun 11, 2024
@mtmail
Copy link
Contributor

mtmail commented Jun 11, 2024

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
Copy link

shadowbeat070 commented Jun 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants