Skip to content

MONGO_INITDB_ROOT_USERNAME not working with nanoserver image #598

@hatzhang

Description

@hatzhang

The sample stack.yml works with linux.

version: '3.1'
services:
  mongo:
    image: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example

But if i change image to nanoserver, and run it under windows, authentication error will occur.

version: '3.1'
services:
  mongo:
    image: mongo:nanoserver
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
    ports:
      - 27017:27017

On client side:

MongoDB.Driver.MongoAuthenticationException
Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.

On server side:

"error":"UserNotFound: Could not find user "root" for db "test""}}

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