Skip to content

MongoHealtIndicator fails without sufficient privileges #1289

@laurikimmel

Description

@laurikimmel

MongoHealtIndicator uses command { serverStatus: 1 } to check MongoDB connection status. This command fails in case user has insufficient privileges in database.

For example if MongoDB user account has only built in roles read and/or readWrite assigned. As result misleading message is shown in /health output:

"mongo":{"status":"DOWN","error":"java.lang.IllegalArgumentException: Data must not be null"}

Proposed solution: use MongoDB command { buildInfo: 1 } to get server version. This command is working with built in roles read, readWrite, userAdmin.

MongoDB version used: 2.6.3.
Not tested with other versions.
Not tested with all built in roles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions