Skip to content

Misleading error when sending _id as an object in collections mode #2366

@vkarpov15

Description

@vkarpov15

Sending the following insertMany command:

{
    "insertMany": {
        "documents": [
            {
                "text": "The Great Train Robbery\n\nA group of bandits stage a brazen train hold-up, only to find a determined posse hot on their heels.\n\nAmong the earliest existing films in American cinema - notable as the first film that presented a narrative story to tell - it depicts a group of cowboy outlaws who hold up a train and rob the passengers. They are then pursued by a Sheriff's posse. Several scenes have color included - all hand tinted.",
                "_id": {
                    "buffer": {
                        "0": 105,
                        "1": 120,
                        "2": 241,
                        "3": 2,
                        "4": 75,
                        "5": 208,
                        "6": 117,
                        "7": 104,
                        "8": 111,
                        "9": 60,
                        "10": 215,
                        "11": 86
                    }
                }
            }
        ],
        "options": {
            "returnDocumentResponses": true,
            "ordered": false
        }
    }
}

gives me the following error:

{"errors":[{"message":"Server failed: root cause: (java.util.NoSuchElementException) No value present","errorCode":"SERVER_UNHANDLED_ERROR","id":"c6ecb197-945b-4e74-9fb5-fb5919e4432d","family":"SERVER","title":"Server failed","scope":"EMPTY"}]}

Similar to #2275, but this one is in collections not tables. The _id is malformed due to a mistake in my code but the error message should indicate something along the lines of an invalid _id not an unhandled error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions