Open
Description
Describe the bug
Pelias whosonfirst importer reports the following error when importing with npm run start
with an improper timeout setting in pelias.json
. The reported error is:
ERROR: Elasticsearch index pelias does not exist
You must use the pelias-schema tool (https://github.com/pelias/schema/) to create the index first
For full instructions on setting up Pelias, see http://pelias.io/install.html
/home/user/pelias/whosonfirst/node_modules/pelias-dbclient/src/configValidation.js:39
throw new Error(`elasticsearch index ${config.schema.indexName} does not exist`);
Error: elasticsearch index pelias does not exist
at existsCallback (/home/user/Softwares/whosonfirst/node_modules/pelias-dbclient/src/configValidation.js:39:15)
at respond (/home/user/Softwares/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:368:9)
at /home/user/Softwares/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:396:7
at Timeout.<anonymous> (/home/user/Softwares/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:429:7)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Whereas one can clearly see that the index does exist:
$ curl http://localhost:9200/_cat/indices/*?v=true
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .geoip_databases Cfim9lIdRZO1D6X2UqcHqQ 1 0 41 0 39mb 39mb
green open pelias iQYgJrn9QWySZgZ-tC80NA 1 0 0 0 226b 226b
The configuration was done as:
"esclient": {
"apiVersion": "7.x",
"keepAlive": true,
"requestTimeout": 12000,
"hosts": [{
"env": "development",
"protocol": "http",
"host": "localhost",
"port": 9200
}],
}
Steps to Reproduce
- Install elasticsearch, with required dependencies
- Load elasticsearch schema
- Have the above mentioned configuration in
pelias.json
- Download wof data in data directory
- Start wof import with
npm run start
Expected behavior
A message should be presented that this was an issue with timeout, or perhaps an issue with JSON file.
Environment (please complete the following information):
- OS: Linux / Ubuntu 22.04
- Installation Mode: Install pelias from scratch
Pastebin/Screenshots
Additional context
Complete command run with stack trace was given as:
> [email protected] start
> ./bin/start
2022-10-23T20:44:18.540Z - debug: [whosonfirst] Loading 'ocean' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:21.299Z - debug: [whosonfirst] Loading 'marinearea' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:24.400Z - debug: [whosonfirst] Loading 'continent' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:27.180Z - debug: [whosonfirst] Loading 'empire' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:29.851Z - debug: [whosonfirst] Loading 'country' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:34.716Z - debug: [whosonfirst] Loading 'dependency' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:37.350Z - debug: [whosonfirst] Loading 'disputed' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:40.029Z - debug: [whosonfirst] Loading 'macroregion' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
2022-10-23T20:44:43.366Z - debug: [whosonfirst] Loading 'region' of whosonfirst-data-admin-latest.db database from /home/user/Downloads/whosonfirst/sqlite
ERROR: Elasticsearch index pelias does not exist
You must use the pelias-schema tool (https://github.com/pelias/schema/) to create the index first
For full instructions on setting up Pelias, see http://pelias.io/install.html
/home/user/Softwares/whosonfirst/node_modules/pelias-dbclient/src/configValidation.js:39
throw new Error(`elasticsearch index ${config.schema.indexName} does not exist`);
^
Error: elasticsearch index pelias does not exist
at existsCallback (/home/user/Softwares/whosonfirst/node_modules/pelias-dbclient/src/configValidation.js:39:15)
at respond (/home/user/Softwares/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:368:9)
at /home/user/Softwares/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:396:7
at Timeout.<anonymous> (/home/user/Softwares/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:429:7)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
References
What fixed it?
Having a proper pelias.json
configuration with timeout fixed it:
Note: requestTimeout
as changed to a string
with a value of "120000"
.
"esclient": {
"apiVersion": "7.x",
"keepAlive": true,
"requestTimeout": "120000",
"hosts": [{
"env": "development",
"protocol": "http",
"host": "localhost",
"port": 9200
}],
}
Activity