Closed DerSchwarzeJugo closed 5 months ago
hmm.. I suspect an uncommon series of events has caused this issue.
when the pelias/api
server first starts up, it reads the canonical_sources
& layers_by_source
properties from your pelias.json
, so by default the address layer is included .
in that config there is a boolean auto_discover: true
which then tells the server to query elasticsearch to enumerate a list of the actual sources/layers in your data (this allows custom data to be discovered at runtime).
if you're using docker, the pelias elastic stats
command executes the same query, which you can use to see what data was returned during that step.
after the response from elasticsearch the sources/layers are updated and if no address layer is found then it will be removed from the list of available layers.
since you mentioned that you do have data from the address layer in elasticsearch it might be some sort of race condition, restarting the pelias/api
container (but not the pelias/elasticsearch
) container should resolve the issue?
alternatively setting auto_discover: false
before restarting the pelias/api
container will skip that discovery step, if you don't have custom sources or layers then that should work for you.
hmm.. I suspect an uncommon series of events has caused this issue.
when the
pelias/api
server first starts up, it reads thecanonical_sources
&layers_by_source
properties from yourpelias.json
, so by default the address layer is included .in that config there is a boolean
auto_discover: true
which then tells the server to query elasticsearch to enumerate a list of the actual sources/layers in your data (this allows custom data to be discovered at runtime).if you're using docker, the
pelias elastic stats
command executes the same query, which you can use to see what data was returned during that step.after the response from elasticsearch the sources/layers are updated and if no address layer is found then it will be removed from the list of available layers.
since you mentioned that you do have data from the address layer in elasticsearch it might be some sort of race condition, restarting the
pelias/api
container (but not thepelias/elasticsearch
) container should resolve the issue?
Indeed a weird issue... restarting the pelias/api container did resolve the problem now. But I am pretty sure, i already tried that before and it did not help then. Anyways, thank you a lot for helping out so quickly.
Describe the bug Address Layer seems to be missing when a parameter is specifically set for it (layers=address) while requesting /search or /autocomplete endpoint. Receiving the following error code 400 "Bad Request":
When not setting the "layers" paramete while requestingr, it is returning a correct respone where the shown feauture is from source "openstreetmap" and layer type "address".
--> Therefore, I am unable to use autocomplete function for addresses only. NOTE: I did a custom build for switzerland before, and it did work correctly with the same type of setup (the only difference, that I was using the openaddress importer there as well).
Steps to Reproduce Following the default docker setup guide with previous custom europe build setup. Using only the importers geonames, openstreetmap, polylines (for that the pbf was to big, but that should not have any influnce in this issue), whosonfirst.
Providing my files in section below.
Expected behavior I should be able to provide the value "address" for parameter "layer" and receive a Response with code 200
Environment (please complete the following information): OS:
Linux octa-pelias-001 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Docker:Docker version 24.0.7, build afdd53b
Docker Compose:Docker Compose version v2.21.0
Pastebin/Screenshots
Additional context docker-compose.yml
pelias.json
Working Request /search https:///v1/search/structured?address=bahnhofstrasse 1&postalcode=8000&locality=Zurich&country=CH
Failing Request /search https:///v1/search/structured?address=bahnhofstrasse 1&postalcode=8000&locality=Zurich&country=CH&layers=address
Working Request /autocomplete https:///v1/autocomplete?text=bahnhofstrasse&focus.point.lat=47.295006918341564&focus.point.lon=8.24202060699463&size=25
Failing Request /autocomplete https:///v1/autocomplete?text=bahnhofstrasse&focus.point.lat=47.295006918341564&focus.point.lon=8.24202060699463&layers=address&size=25
References
I have already tried to get some help in the forum at https://app.gitter.im/#/room/#pelias_pelias:gitter.im