Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server Error when Adding STAC Collection to Geoportal Server #594

Open
Anna-leungtn opened this issue Jan 21, 2025 · 2 comments
Open

Comments

@Anna-leungtn
Copy link

I am experiencing an issue while attempting to add the sample JSON STAC collection to the Geoportal Server catalog. Upon submission, I encounter the following error:

Image

It appears that the error is related to a missing property in the JSON payload. I would appreciate any guidance on resolving this issue or any updates regarding a potential fix.

@eltonhcchan
Copy link

When trying to post a new STAC collection in geoportal via STAC API, geoportal would check the collection id if it exists in the elasticsearch.

Upon an id is retrieved from given collection.json, it will use getCollectionWithId(String id) function in Stachelper.java, to check if same id can be found in existing index, i.e. collections.

DocumentContext elasticResContext = JsonPath.parse(response);
 **// When reading "$hits", it will jump to error 404 as the index: collections is yet to be created**
net.minidev.json.JSONArray items = elasticResContext.read("$.hits.hits");
JSONObject item = null;

It seems geoportal should have created or checked the index "collections" before getting no. of returned hits but didn't do it. I've tested it in release 2.7.2. Not sure, if it works in latest release 2.7.2.1 as I still cannot compile it successfully. Please advise.

@mhogeweg
Copy link
Member

Geoportal Server does check if the index exists and if not creates it. this happens when Tomcat is restarted. Does your collection index not exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants