openmaptiles icon indicating copy to clipboard operation
openmaptiles copied to clipboard

Error message after update, during the make generate-changed-tiles step "error: function getmvt(unknown, unknown, unknown) does not exist"

Open npignier-cegedim opened this issue 1 year ago • 1 comments

Hi, I'm following UPDATE.md for keeping an existing instance up-to-date.

Execution of make start-update-osm and make stop-update-osm are Ok without errors

then I run make generate-changed-tiles and it fails after seconds with this output message :

Using docker compose V2 (docker compose)
find ./data -name "*.tiles" -exec cat {} \; -exec rm {} \; | \
  docker compose run --rm --user=0:0 openmaptiles-tools \
    tile_multiplier 0 14 >> data/tiles.txt
WARN[0000] /var/map/osm/docker-compose.yml: `version` is obsolete 
# Re-generating updated tiles, if needed
if [ -s data/tiles.txt ] ; then \
  docker compose  run --rm --user=0:0 openmaptiles-tools refresh-views; \
  docker compose run --rm --user=0:0 -e LIST_FILE=data/tiles.txt openmaptiles-tools generate-tiles; \
  rm data/tiles.txt; \
fi
WARN[0000] /var/map/osm/docker-compose.yml: `version` is obsolete 
Connecting to PostgreSQL at postgres:5432, db=openmaptiles, user=openmaptiles...
Loading all materialized views from openmaptiles...
Refreshing 0 materialized views...
WARN[0000] /var/map/osm/docker-compose.yml: `version` is obsolete 
2024-08-26 08-45-35 Generating tiles from a list data/tiles.txt from 1 servers, using 10 connections per server, 10 streams
+ tilelive-copy --scheme=list --list=data/tiles.txt --timeout=1800000 --exit --retry=2 --concurrency=10 'pgquery://?database=openmaptiles&host=postgres&port=5432&username=openmaptiles&password=openmaptiles&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 postgres:5432:
                         version() = PostgreSQL 14.9 (Debian 14.9-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
            postgis_full_version() = POSTGIS="3.3.4 3.3.4" [EXTENSION] PGSQL="140" GEOS="3.9.0-CAPI-1.16.2" PROJ="7.2.1" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"
                               jit = off
                    shared_buffers = 128MB
                          work_mem = 4MB
              maintenance_work_mem = 64MB
              effective_cache_size = 4GB
          effective_io_concurrency = 1
                   max_connections = 100
              max_worker_processes = 8
              max_parallel_workers = 8
   max_parallel_workers_per_gather = 2
                       wal_buffers = 4MB
                      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 postgres:5432/openmaptiles...
Failed to get a tile at [14,9268,3575] from postgres:5432/openmaptiles (in 3ms), aborting tilelive-pgquery initialization:
error: function getmvt(unknown, unknown, unknown) does not exist
/usr/local/lib/node_modules/@mapbox/tilelive/bin/tilelive-copy:100
        if (err) throw err;
                 ^

error: function getmvt(unknown, unknown, unknown) does not exist
    at /usr/local/lib/node_modules/tilelive-pgquery/node_modules/pg-pool/index.js:45:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PgQuery._getRawTileAsync (/usr/local/lib/node_modules/tilelive-pgquery/lib/PgQuery.js:283:19)
    at async PgQuery._testSingleServer (/usr/local/lib/node_modules/tilelive-pgquery/lib/PgQuery.js:431:19)
    at async Promise.all (index 0)
    at async PgQuery.testOnStartupAsync (/usr/local/lib/node_modules/tilelive-pgquery/lib/PgQuery.js:489:21)
    at async PgQuery.init (/usr/local/lib/node_modules/tilelive-pgquery/lib/PgQuery.js:117:7) {
  length: 226,
  severity: 'ERROR',
  code: '42883',
  detail: undefined,
  hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
  position: '34',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_func.c',
  line: '629',
  routine: 'ParseFuncOrColumn'
}

Node.js v18.19.0

TOOLS_VERSION=7.1 Latest version from repository : Update CI to use docker compose v2. (#1680)

Thanks

npignier-cegedim avatar Aug 26 '24 09:08 npignier-cegedim

Hi, the initial full import of database must be done. (it is maybe a little bit confusing the initial download and import of the OSM data must be done when DIFF_MODE=true is set in the .env file. (in UPDATE.md))

So, please, change the DIFF_MODE=false to DIFF_MODE=true in the .env file and then run:

  • make clean
  • make
  • make downaload area=xxx
  • make import-osm
  • make import-wikikidata
  • make import-sql
  • make generate-tiles-pg
  • make start-update-osm

TomPohys avatar Sep 17 '24 17:09 TomPohys

Please, if you have further questions, feel free to reopen the issue or create a new issue.

TomPohys avatar Dec 18 '24 16:12 TomPohys

Hi, the initial full import of database must be done. (it is maybe a little bit confusing the initial download and import of the OSM data must be done when DIFF_MODE=true is set in the .env file. (in UPDATE.md))

So, please, change the DIFF_MODE=false to DIFF_MODE=true in the .env file and then run:

  • make clean
  • make
  • make downaload area=xxx
  • make import-osm
  • make import-wikikidata
  • make import-sql
  • make generate-tiles-pg
  • make start-update-osm
  • make download instead of make downaload
  • make import-wikidata instead of make import-wikikidata

JabriAbdelilah avatar May 26 '25 14:05 JabriAbdelilah