-
Notifications
You must be signed in to change notification settings - Fork 447
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 #500
Comments
Here are the Postgresql logs. Part 1
Part 2
|
Could be related. |
These sorts of errors happen when your container doesn't have enough disk or memory, for example #484 I would check how much is assigned to your docker VM. |
Hello, For this issue, I'm running Docker in Windows 11 and not in a VM with the workstation configuration listed below. Should I increase any of the Postgresql settings? POSTGRES_SHARED_BUFFERS (default: 2GB) Desktop / Server (please complete the following information): Additional context Thank you, -E |
One other note, I don't receive any errors about running out of disk space. #484 |
Docker requires Linux and on windows always runs in a VM even though it's hidden from you. |
Hi all, I am getting this same error. It looks like setting pool_pre_ping to true may work: Is there any way to change the value for this variable? Thanks. |
Nominatim doesn't use pooling, or rather it does it's own implementation to reuse connections. If you want to experiement the relevant connection logic is in https://github.com/osm-search/Nominatim/blob/master/nominatim/db/async_connection.py |
Thank you so much for your quick reply. I don't really know how to avoid this error. Any clue? |
This github issue got closed 7 months ago. If you have specific questions about your specific hardwares setup please open a new issue. |
Sorry, but I see this issue as Open. In any case, I have openned a new issue. |
Describe the bug
Initial container creation from docker image returns error after running for a while. Something might be timing out. The north america pbf is a larger file at 12gb.
2023-11-08 01:07:43 psycopg2.OperationalError: server closed the connection unexpectedly
To Reproduce
Steps to reproduce the behavior:
docker run -it --shm-size=60g -e PBF_URL=https://download.geofabrik.de/north-america-latest.osm.pbf -e IMPORT_WIKIPEDIA=true -e IMPORT_US_POSTCODES=true -e IMPORT_TIGER_ADDRESSES=false -p 8080:8080 --name nominatimNorthAmerica mediagis/nominatim:4.3
2023-11-08 01:07:30 2023-11-08 09:07:30: Done 27322100 in 3651 @ 7481.536 per second - rank 30 ETA (seconds): 2204.75
2023-11-08 01:07:31 2023-11-08 09:07:31: Done 27329580 in 3652 @ 7481.704 per second - rank 30 ETA (seconds): 2203.70
2023-11-08 01:07:32 2023-11-08 09:07:32: Done 27337060 in 3653 @ 7481.461 per second - rank 30 ETA (seconds): 2202.78
2023-11-08 01:07:33 2023-11-08 09:07:33: Done 27344540 in 3655 @ 7481.357 per second - rank 30 ETA (seconds): 2201.81
2023-11-08 01:07:35 2023-11-08 09:07:35: Done 27352020 in 3656 @ 7481.101 per second - rank 30 ETA (seconds): 2200.88
2023-11-08 01:07:35 2023-11-08 09:07:35: Done 27359500 in 3656 @ 7482.438 per second - rank 30 ETA (seconds): 2199.49
2023-11-08 01:07:35 2023-11-08 09:07:35: Done 27366980 in 3656 @ 7483.752 per second - rank 30 ETA (seconds): 2198.10
2023-11-08 01:07:36 2023-11-08 09:07:36: Done 27374460 in 3657 @ 7484.661 per second - rank 30 ETA (seconds): 2196.84
2023-11-08 01:07:36 2023-11-08 09:07:36: Done 27381960 in 3658 @ 7485.282 per second - rank 30 ETA (seconds): 2195.65
2023-11-08 01:07:38 2023-11-08 09:07:38: Done 27389440 in 3659 @ 7485.196 per second - rank 30 ETA (seconds): 2194.68
2023-11-08 01:07:39 2023-11-08 09:07:39: Done 27396920 in 3660 @ 7484.945 per second - rank 30 ETA (seconds): 2193.75
2023-11-08 01:07:40 2023-11-08 09:07:40: Done 27404400 in 3661 @ 7484.936 per second - rank 30 ETA (seconds): 2192.76
2023-11-08 01:07:41 2023-11-08 09:07:41: Done 27411880 in 3662 @ 7484.948 per second - rank 30 ETA (seconds): 2191.75
2023-11-08 01:07:42 2023-11-08 09:07:42: Done 27419380 in 3663 @ 7484.888 per second - rank 30 ETA (seconds): 2190.77
2023-11-08 01:07:43 2023-11-08 09:07:43: Done 27426860 in 3664 @ 7485.145 per second - rank 30 ETA (seconds): 2189.69
2023-11-08 01:07:43 2023-11-08 09:07:43: Done 27434340 in 3664 @ 7486.064 per second - rank 30 ETA (seconds): 2188.43
2023-11-08 01:07:43 Traceback (most recent call last):
2023-11-08 01:07:43 File "/usr/local/lib/nominatim/lib-python/nominatim/indexer/indexer.py", line 234, in _index
2023-11-08 01:07:43 runner.index_places(pool.next_free_worker(), part)
2023-11-08 01:07:43 File "/usr/local/lib/nominatim/lib-python/nominatim/db/async_connection.py", line 201, in next_free_worker
2023-11-08 01:07:43 return next(self.free_workers)
2023-11-08 01:07:43 File "/usr/local/lib/nominatim/lib-python/nominatim/db/async_connection.py", line 209, in _yield_free_worker
2023-11-08 01:07:43 if thread.is_done():
2023-11-08 01:07:43 File "/usr/local/lib/nominatim/lib-python/nominatim/db/async_connection.py", line 159, in is_done
2023-11-08 01:07:43 if self.conn.poll() == psycopg2.extensions.POLL_OK:
2023-11-08 01:07:43 psycopg2.OperationalError: server closed the connection unexpectedly
2023-11-08 01:07:43 This probably means the server terminated abnormally
2023-11-08 01:07:43 before or while processing the request.
Expected behavior
I expected the Nominatim server to complete this command step.
Screenshots & Logs
If applicable, add screenshots & logs to help explain your problem.
Desktop / Server (please complete the following information):
OS & Version: [Windows 11 Pro 23H2]
Docker Version: [Server: Docker Desktop 4.25.0 (126437)]
Nominatim Version: [4.3.1]
Additional context
Here are the workstation specs:
i9 14900k
192GB of memory
4 TB M.2 SSD
I found this info about the postgresql timing out.
I can't find these connection parameters in any of the basic Nominatim server settings.
https://www.tomatolist.com/show_blog_page.html?no=9b5e7549-e3d3-484e-9259-7b53432f9f26
conn = psycopg2.connect(database="DBname",
host="Your_IP_address",
user="username",
password="Your_password",
port=5432,
keepalives=1,
keepalives_idle=130,
keepalives_interval=10,
keepalives_count=15)
Thank you,
-E
The text was updated successfully, but these errors were encountered: