psycopg2.OperationalError

Hello, I have installed Nominatim on Ubuntu 18 following the documentation on the Nominatim site (v3.5.1 / Postgres 10). In my test environment it completed an import of Europe successfully but when doing the planet on a fresh build (following the same instructions) it got almost to the end but then failed with:

INFO: Done 6180925 in 4729 @ 1306.877 per second - rank 30 ETA (seconds): 108109.04
Traceback (most recent call last):
File "/srv/nominatim/Nominatim-3.5.1/nominatim/nominatim.py", line 178, in is_done
if self.conn.poll() == psycopg2.extensions.POLL_OK:
psycopg2.OperationalError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/nominatim/Nominatim-3.5.1/nominatim/nominatim.py", line 370, in <module>
Indexer(options).run()
File "/srv/nominatim/Nominatim-3.5.1/nominatim/nominatim.py", line 215, in run
self.index(RankRunner(self.maxrank))
File "/srv/nominatim/Nominatim-3.5.1/nominatim/nominatim.py", line 259, in index
thread = next(next_thread)
File "/srv/nominatim/Nominatim-3.5.1/nominatim/nominatim.py", line 300, in find_free_thread
if thread.is_done():
File "/srv/nominatim/Nominatim-3.5.1/nominatim/nominatim.py", line 187, in is_done
except psycopg2.errors.DeadlockDetected:
AttributeError: module 'psycopg2' has no attribute 'errors'
ERROR: error status 1 running nominatim!
string(33) "error status 1 running nominatim!"

Running on 16 vCPU / 64GB RAM, 8GB + 1200GB SSD volumes in AWS.

df -h

Filesystem      Size  Used Avail Use% Mounted on
udev             32G     0   32G   0% /dev
tmpfs           6.3G  1.5M  6.3G   1% /run
/dev/nvme1n1p1  7.7G  2.6G  5.2G  34% /
tmpfs            32G  8.0K   32G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            32G     0   32G   0% /sys/fs/cgroup
/dev/loop0       29M   29M     0 100% /snap/amazon-ssm-agent/2012
/dev/loop1       97M   97M     0 100% /snap/core/9665
/dev/nvme0n1    1.2T  1.1T   94G  92% /postgres
tmpfs           6.3G     0  6.3G   0% /run/user/111
/dev/loop2       97M   97M     0 100% /snap/core/9804

I am very new to this so don’t really understand what has failed or how to fix it. Is there a way to pick up from where it was or do I need to do the entire import again? Any assistance would be gratefully received :slight_smile:

Thank you.

Is there a way to restart from a particular stage or do I need to re-run this from the start? Thank you.

This looked to be apt update running and rebooting the OS to complete the update :rage: