Skip to content

If collection is missing from ingesting Item, a low-level OpenSearch client error occurs rather than a clear invalid response #580

@philvarner

Description

@philvarner
Collaborator

If collection is missing from ingesting Item, a low-level OpenSearch client error occurs:

{
    "level": "error",
    "message": "Error while ingesting item Missing required parameter: index",
    "name": "ConfigurationError",
    "stack": "ConfigurationError: Missing required parameter: index\n    at IndicesApi.indicesExistsApi [as exists] (/var/task/index.js:6779:17)\n    at writeRecordToDb (/var/task/index.js:62664:41)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async ingestItems (/var/task/index.js:62727:16)\n    at async Runtime.handler (/var/task/index.js:63194:21)"
}

The code path here is that the Item is checked that it has a Feature type and then the collection is retrieved to check in an index with that name exists, without checking that the collection field is actually defined.

Instead, there should be a validation that the collection field is defined.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @philvarner

        Issue actions

          If `collection` is missing from ingesting Item, a low-level OpenSearch client error occurs rather than a clear invalid response · Issue #580 · stac-utils/stac-server