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

mongo-single-replica: Error /usr/local/bin/docker-entrypoint.sh: line 407: -u: command not found #3773

Closed
jvolker opened this issue May 17, 2022 · 2 comments · Fixed by #4162

Comments

@jvolker
Copy link

jvolker commented May 17, 2022

I'm trying to run the mongo-single-replica example.

When starting docker-compose I first ran into #3579. I solved it by changing the ports, as suggested in the issue:

ports:
      - 27016:27017

Unfortunately, I'm now getting:

mongo_1  | Waiting for initialization...
mongo_1  | Initializing replica set...
mongo_1  | /usr/local/bin/docker-entrypoint.sh: line 407: -u: command not found

How can I solve this?

Thanks in advance.

@vitaliysignly
Copy link

vitaliysignly commented Oct 5, 2022

Me too, although my issue is slightly different.

// docker container logs

Waiting for initialization...
Initializing replica set...
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:374:17
@(connect):3:6
exception: connect failed
exiting with code 1
// docker-compose.yml file

version: '3.7'
services:
  mongodb_container:
    # This image automatically creates a replica set required for transactions
    image: prismagraphql/mongo-single-replica:4.4.3-bionic
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: prisma
    ports:
      - 27016:27017

Did you manage to get this resolved, @jvolker ?

@theleanship
Copy link

Had the same issue, increasing the wait time for initialisation seems to have fixed the issue for me.

See: INIT_WAIT_SEC (https://github.com/prisma/engine-images/blob/main/mongo/4.4/docker-entrypoint.sh)

Example:

version: '3.7'
services:
  mongodb_container:
    # This image automatically creates a replica set required for transactions
    image: prismagraphql/mongo-single-replica:4.4.3-bionic
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: prisma
      INIT_WAIT_SEC: 3
    ports:
      - 27017:27017

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

Successfully merging a pull request may close this issue.

3 participants