You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Imposm Stuck on Replication Due to Persistent “driver: bad connection” Errors #1086
I’ve encountered a recurring issue with Imposm while it’s trying to apply minute replication updates. This time, the problem persists and prevents further tile updates.
In the past (when running in Kubernetes), this issue occurred occasionally and the pod restart mechanism usually fixed it. However, now that we’re running in Docker, the process is getting stuck indefinitely, unable to recover, and no tiles are being updated.
Here’s a snippet of the repeated error:
delete element osm.Diff{Create:false, Modify:true, Delete:false, Node:(*osm.Node)(0xc002701380), Way:(*osm.Way)(nil), Rel:(*osm.Relation)(nil)}: deleting -2687310 from "admin_areas": SQL Error: driver: bad connection in query DELETE FROM "public"."osm_admin_areas" WHERE "osm_id" = $1 (-2687310)
[2025-06-25T06:34:16Z] 15:47:37 [info] Retrying in 5m0s
[2025-06-25T06:34:16Z] 15:47:37 [error] Importing #1779658: delete element osm.Diff{Create:false, Modify:true, Delete:false, Node:(*osm.Node)(0xc002701a70), Way:(*osm.Way)(nil), Rel:(*osm.Relation)(nil)}: deleting -2687310 from "admin_areas": SQL Error: driver: bad connection in query DELETE FROM "public"."osm_admin_areas" WHERE "osm_id" = $1 (-2687310)
[2025-06-25T06:34:16Z] 15:47:37 [info] Retrying in 5m0s
[2025-06-25T06:34:16Z] 15:47:37 [error] Importing #1779658: delete element osm.Diff{Create:false, Modify:true, Delete:false, Node:(*osm.Node)(0xc007492180), Way:(*osm.Way)(nil), Rel:(*osm.Relation)(nil)}: deleting -2687310 from "place_areas": SQL Error: driver: bad connection in query DELETE FROM "public"."osm_place_areas" WHERE "osm_id" = $1 (-2687310)
[2025-06-25T06:34:16Z] 15:47:37 [info] Retrying in 5m0s
I worked on this issue to ensure that the container restarts automatically once the problem is detected. I still don’t know exactly why this issue is happening, but what I do know is that it gets resolved once the container is restarted. It might be a resource issue specific to the container, which Kubernetes handles by restarting it automatically—but that doesn’t happen in Docker environments.
The script monitors the Imposm log, and if it detects an import error, it terminates both the expiration file upload and the Imposm update process. This causes the container to restart:
Activity
Rub21 commentedon Jun 26, 2025
I worked on this issue to ensure that the container restarts automatically once the problem is detected. I still don’t know exactly why this issue is happening, but what I do know is that it gets resolved once the container is restarted. It might be a resource issue specific to the container, which Kubernetes handles by restarting it automatically—but that doesn’t happen in Docker environments.
The script monitors the Imposm log, and if it detects an import error, it terminates both the expiration file upload and the Imposm update process. This causes the container to restart:
https://github.com/OpenHistoricalMap/ohm-deploy/blob/fef5b2114cd6e6daf233bad75ea92256e50e5dc8/images/tiler-imposm/start.sh#L164-L200
Rub21 commentedon Jun 26, 2025
Done, and currently working in production