mapbox / mapbox-sdk-js

A JavaScript client to Mapbox services, supporting Node, browsers, and React Native
Other
719 stars 186 forks source link

Copy operation timed out at Timeout.<anonymous> (/usr/lib/node_modules/@mapbox/tilelive/lib/tilelive.js:392:22) #457

Open raphael10-collab opened 2 years ago

raphael10-collab commented 2 years ago

Following step-by-step the indications found here: https://www.linuxbabe.com/ubuntu/basemap-tileserver-gl-openmaptiles-ubuntu-22-04 I'm trying to install TileServer GL/OpenMapTilesfor the whole world-map with a Cloud VPS with 10 vCPU Cores + 60 GB RAM + 2 TB SSD

But in the step sudo make generate-tiles-pg I'm getting, for the fifth time, this error: Copy operation timed out at Timeout.<anonymous> (/usr/lib/node_modules/@mapbox/tilelive/lib/tilelive.js:392:22) :

root@vmi1046457:~/openmaptiles# sudo make generate-tiles-pg
docker-compose run --rm --user=0:0 openmaptiles-tools bash -c 'style-tools recompose openmaptiles.yaml build/style/style.json \
        style/style-header.json && \
        spritezero build/style/sprite /style/icons && spritezero --retina build/style/sprite@2x /style/icons'
Creating openmaptiles_openmaptiles-tools_run ... done
Starting postgres docker compose target using default image (no recreate if exists)
Wait for PostgreSQL to start...
docker-compose run --rm --user=0:0 openmaptiles-tools pgwait
Creating openmaptiles_openmaptiles-tools_run ... done
Generating tiles into data/tiles.mbtiles (will delete if already exists) using PostGIS ST_MVT()...
docker-compose run -T --rm --user=0:0 openmaptiles-tools generate-tiles
Creating openmaptiles_openmaptiles-tools_run ... done
2022-11-02 19-21-01 Generating zoom 0..14 inside (-180.0,-90.0,180.0,90.0) from 1 servers, using 10 connections per server, 10 parallel streams...
+ tilelive-copy --scheme=pyramid --bounds=-180.0,-90.0,180.0,90.0 --minzoom=0 --maxzoom=14 --timeout=1800000 --exit --retry=2 --concurrency=10 'pgquery://?database=openstreetmap&host=172.17.0.1&port=5432&username=osm&password=postgrespwd&funcZXY=getmvt&maxpool=10&minzoom=0&maxzoom=14' mbtiles:///export/tiles.mbtiles
tilelive-pgquery v1.2.0
Tilejson Spec:
       tilejson = 2.1.0
           name = PgQuery 1.2.0
         format = pbf
             id = openmaptiles
    attribution = <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>
         bounds = -180,-85.0511,180,85.0511
         center = -12.2168,28.6135,4
        minzoom = 0
        maxzoom = 14
    pixel_scale = 256
      maskLevel = 8
        version = 3.9

Server information for 172.17.0.1:5432:
                         version() = PostgreSQL 15.0 (Ubuntu 15.0-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, 64-bit
            postgis_full_version() = POSTGIS="3.3.1 3786b21" [EXTENSION] PGSQL="150" GEOS="3.10.2-CAPI-1.16.0" PROJ="8.2.1" LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"
                               jit = on WARNING: disable JIT in PG 11-12 for complex queries
                    shared_buffers = 15GB
                          work_mem = 1GB
              maintenance_work_mem = 8GB
              effective_cache_size = 20GB
          effective_io_concurrency = 1
                   max_connections = 100
              max_worker_processes = 8
              max_parallel_workers = 8
   max_parallel_workers_per_gather = 2
                       wal_buffers = 16MB
                      min_wal_size = 80MB
                      max_wal_size = 1GB
                  random_page_cost = 4
         default_statistics_target = 100
      checkpoint_completion_target = 0.9

Verifying pgquery data source by retrieving a tile at [14,9268,3575] from 172.17.0.1:5432/openstreetmap...
a tile at [14,9268,3575] from 172.17.0.1:5432/openstreetmap was generated in 68507ms.  The result is 15532 bytes detected as gzipped data. 31483 bytes uncompressed.
Test tile begins with 1a. This byte often corresponds to a valid vector tile.
[1m 10.8s]   0.0000%      1/357.91m @    0/s | ✓ 0 □ 0 | 291012d 4h 51m 25.0s left/usr/lib/node_modules/@mapbox/tilelive/bin/tilelive-copy:100
        if (err) throw err;
                 ^

Error: Copy operation timed out
    at Timeout.<anonymous> (/usr/lib/node_modules/@mapbox/tilelive/lib/tilelive.js:392:22)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)
ERROR: 1
make: *** [Makefile:461: generate-tiles-pg] Error 1

How to solve the issue and make it work?