I have been trying to set up a MBTiles Export using PostgreSQL 9.2 and the Latest version of Tilemill. According to the postgreSQL Logs, I am receiving an error, and I cannot figure out why. I have them both setup on the same machine (localhost:5432).

Here is the error below (Connection Refused, and Client lost connection). Sometimes it loads into TileMill, but very intermittent and slowly. It doesn't allow me to zoom or pick the BBox I want to export, It never refreshes.

    2015-07-28 16:17:47 EDT STATEMENT:  SELECT ST_AsBinary("way") AS geom,"way_pixels" FROM (SELECT
        way_area/NULLIF(1222.99::real*1222.99::real,0) AS way_pixels
      FROM planet_osm_polygon
      WHERE (boundary = 'national_park' OR leisure = 'nature_reserve')
        AND building IS NULL
    ) AS national_park_boundaries WHERE "way" && ST_SetSRID('BOX3D(-9549125.069610503 4226661.916057105,-8609866.866042253 5165920.119625353)'::box3d, 900913)
2015-07-28 16:18:14 EDT LOG:  could not send data to client: No connection could be made because the target machine actively refused it.

2015-07-28 16:18:14 EDT STATEMENT:  SELECT ST_AsBinary("way") AS geom,"landuse","natural","waterway","way_pixels" FROM (SELECT
        way, "natural", waterway, landuse, name, way_area/NULLIF(2445.98::real*2445.98::real,0) AS way_pixels
      FROM planet_osm_polygon
        (waterway IN ('dock', 'riverbank', 'canal')
          OR landuse IN ('reservoir', 'basin')
          OR "natural" IN ('water', 'glacier', 'mud'))
        AND building IS NULL
        AND way_area/NULLIF(2445.98::real*2445.98::real,0) > 0.01
      ORDER BY z_order, way_area DESC
    ) AS water_areas WHERE "way" && ST_SetSRID('BOX3D(-9079495.967826378 3443946.746416901,-7200979.560689883 5322463.153553395)'::box3d, 900913)
2015-07-28 16:18:14 EDT FATAL:  connection to client lost

1 Answer 1


I found an odd solution to this issue. If I were to Stop and restart the postgresql service and/or log out of my windows account/log back in. Then right away load the OSM Layers into Tilemill and extract, It would work perfectly. I unfortunately I have not figured out the core issue but this worked. It could possibly be not enough resources on the machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.