Action failed: Starting mongodb

mongo

#1

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


#2

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


#3

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


#4

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


#5

Same here. Could fix it please?


#6

Can someone from Circle give an update here?


#7

Same here, please could you give an update?


#8

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


#9

That doesn’t work.


#10

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

#11

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.


#12

Can you share a build URL?


#13

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


#14

Ok that will work for now. Thanks.


#15

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


#16

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


#17

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.


#18