Action failed: Starting mongodb

With this config:

machine:
services:
- mongodb

i’m getting error:

service mongodb status || service mongodb start
mongodb: unrecognized service
service mongodb status || service mongodb start returned exit code 1
Action failed: Starting mongodb

i believe command should looks like this:

service mongod status || service mongod start

1 Like

Which build image are you using (Precise or Trusty)?

I’m using Trusty and I have the same issue.
I also tried adding pecl install mongo to dependencies (pre) without success.

We’re seeing the same issue with Trusty.

We get the following error:

service mongodb status || service mongodb start
mongodb: unrecognized service
mongodb: unrecognized service

service mongodb status || service mongodb start returned exit code 1

Action failed: Starting mongodb`

Our circle.yml file looks like:

machine:
  node:
    version: 6
  services:
    - mongodb
    - redis

It doesn’t seem to make a difference if I remove mongodb from the services list

1 Like

Same here. Could fix it please?

1 Like

Can someone from Circle give an update here?

Same here, please could you give an update?

1 Like

Hi all,

Sorry for the delay!

The service name changed in Trusty from mongodb to mongod you should be able to get it to work by running the same commands with mongod.

Best,
Lev

That doesn’t work.

Not the services, that should still be mongodb

But if you want to see the status, or restart it you should run

sudo service mongod restart

Not the services, that should still be mongodb

Are you saying we should continue to list mongodb in the services? Because that is what is breaking.

Can you share a build URL?

Bah, sorry for the confusion :frowning:

Can you do the following:

  1. Remove mongodb from your services completely
  2. Add the following to test: pre
service mongod status || service mongod start

We need to fix this in our container, which we will do, but the above workaround should work in the meantime.

Best,
Lev

1 Like

Ok that will work for now. Thanks.

1 Like

Thank you! I will update this thread when this workaround is no longer necessary.

Ok I got some further clarification from our engineering team .

  1. Mongodb is started by default on the 14.04 image . So this means that it is not necessary to list it under services.
  2. If you need to stop or restart Mongo during your build you should use sudo service mongod $COMMAND

Best,
Lev

The build shouldn’t break just because you specify you need a service that happens to be started by default. After all what you want to say that is just that “I require this service running”. To make things worse an error message like this “mongodb: unrecognized service” just leads to further confusion. I initially thought I mistyped the name, or it’s called ‘mongo’.

What’s even more frustrating is that the behaviour is different between environments. On Ubuntu 12.04 it works, on 14.04 it doesn’t.