Service has stopped suddenly, and i can't find ctlscript.sh

Keywords: MongoDB - Microsoft Azure - Technical issue - Other
Description:
My MongoDB server which is working on Azure is stopped suddenly. After that I connect to the server via ssh and try to find the problem.

I’m searching ctlscript.sh in all folders by the following command,

sudo find . -print | grep -i 'ctlscript.sh'

but it return 0 result.
I can start mongo manually with write mongod --dbpath ....

But i can’t start bitnami…

Hi @atestoglu,

The ctlscript.sh should be in /opt/bitnami/ctlscript.sh.

You can run

/opt/bitnami/ctlscript.sh restart

to restart the application.

Regards,

Michiel D’Hont


Please, click on :heart: if you think my answer was helpful

Hi @michiel,

As i said before there is no .sh file under /opt/bitnami, so that i can’t restart the application.

How can i found content of this .sh file? Can i create it manually?

Hi @atestoglu,

We have a Support Tool that will gather relevant information for us to debug the issue. Could you please download and execute it on the machine where the stack is running by following the steps described in the guide below?

How to Run the Bitnami Support Tool

Regards,

Michiel D’Hont

Hi @michiel,

I’m trying to install support tool but its gives error about bitnami path.

However, i found a “nami” folder under /opt/bitnami/nami. I checked the status and try to start service.

$ sudo nami status mongodb
com.bitnami.mongodb not running

After that i am try to start service via

$ sudo nami start mongodb

ERROR Unable to start com.bitnami.mongodb: Pid file ‘/opt/bitnami/mongodb/tmp/mongodb.pid’ was found but either no proper PID was found or no process is running there.

So i’m stuck at this level.

Hi @atestoglu,

Just to confirm it, you are using the cluster solution MongoDB with Replication, right?

If that is the case, could you please take a look at the following log files? They may have valuable information about the issue that you are facing. Do not hesitate to share the contents with us if you need further help:

cat /opt/bitnami/mongodb/logs/mongodb.log

Execute the following command too (and share the output with us). This command will show the logs of the last 10 actions (like start/stop/restart) done with the deployment. You can find some clues there:

cat $(ls -t /tmp/nami_* | head -n10)

If you are not able to find the root cause of your problem, let us know and we will keep digging into the issue.

We’ll be looking forward to receiving your reply.

Regards,
Andrés Bono

Hi @abjimenez ,

Yes, i am using MongoDB with Replication. After running nami start mongodb,

2018-01-30T17:13:29.560+0000 I CONTROL  [main] ***** SERVER RESTARTED *****
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] MongoDB starting : pid=9805 port=27017 dbpath=/opt/bitnami/mongodb/data/db 64-bit host=mongocms0
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] db version v3.4.1
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] git version: 5e103c4f5583e2566a45d740225dc250baacfbd7
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] modules: none
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] build environment:
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten]     distmod: debian81
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten]     distarch: x86_64
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2018-01-30T17:13:29.579+0000 I CONTROL  [initandlisten] options: { config: "/opt/bitnami/mongodb/conf/mongodb.conf", net: { bindIp: "0.0.0.0", port: 27017, unixDomainSocket: { enabled: true, pathPrefix: "/opt/bitnami/mongodb/tmp" } }, processManagement: { fork: false, pidFilePath: "/opt/bitnami/mongodb/tmp/mongodb.pid" }, replication: { replSetName: "replicaset" }, security: { authorization: "enabled", keyFile: "/opt/bitnami/mongodb/conf/keyfile" }, setParameter: { enableLocalhostAuthBypass: "false" }, storage: { dbPath: "/opt/bitnami/mongodb/data/db", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/opt/bitnami/mongodb/logs/mongodb.log" } }
2018-01-30T17:13:29.600+0000 I -        [initandlisten] Detected data files in /opt/bitnami/mongodb/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-01-30T17:13:29.600+0000 I STORAGE  [initandlisten]
2018-01-30T17:13:29.600+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-01-30T17:13:29.600+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-01-30T17:13:29.600+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=6513M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2018-01-30T17:13:29.608+0000 E STORAGE  [initandlisten] WiredTiger error (13) [1517332409:608966][9805:0x7f76a6ae7cc0], file:WiredTiger.wt, connection: /opt/bitnami/mongodb/data/db/WiredTiger.turtle: handle-open: open: Permission denied
2018-01-30T17:13:29.609+0000 I -        [initandlisten] Assertion: 28595:13: Permission denied src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267
2018-01-30T17:13:29.609+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 13: Permission denied, terminating
2018-01-30T17:13:29.609+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-01-30T17:13:29.609+0000 I NETWORK  [initandlisten] removing socket file: /opt/bitnami/mongodb/tmp/mongodb-27017.sock
2018-01-30T17:13:29.609+0000 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2018-01-30T17:13:29.609+0000 I CONTROL  [initandlisten] now exiting
2018-01-30T17:13:29.609+0000 I CONTROL  [initandlisten] shutting down with code:100
root@mongocms0:/opt/bitnami/nami# 2018-01-30T17:13:29.560+0000 I CONTROL  [main] ***** SERVER RESTARTED *****
2018-01-30T17:13:29.600+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-01-30T17:13:29.600+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/corebash: 2018-01-30T17:13:29.560+0000: command not found
/prodnotes-filesystem
2018-01-30T17:13:29.600+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=6513M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2018-01-30T17:13:29.608+0000 E STORAGE  [initandlisten] WiredTiger error (13) [1517332409:608966][9805:0x7f76a6ae7cc0], file:WiredTiger.wt, connection: /opt/bitnami/mongodb/data/db/WiredTiger.turtle: handle-open: open: Permission denied
2018-01-30T17:13:29.609+0000 I -        [initandlisten] Assertion: 28595:13: Permission denied src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267
2018-01-30T17:13:29.609+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 13: Permission denied, terminating
2018-01-30T17:13:29.609+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-01-30T17:13:29.609+0000 I NETWORK  [initandlisten] removing socket file: /opt/bitnami/mongodb/tmp/mongodb-27017.sock
2018-01-30T17:13:29.609+0000 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2018-01-30T17:13:29.609+0000 I CONTROL  [initandlisten] now exiting
2018-01-30T17:13:29.609+0000 I CONTROL  [initandlisten] shutting down with code:100

And, after cat $(ls -t /tmp/nami_* | head -n10)

[Tue Jan 30 2018 17:16:32 GMT+0000 (UTC)] nami    ERROR Unable to start com.bitnami.mongodb: Pid file '/opt/bitnami/mongodb/tmp/mongodb.pid' was found but either no proper PID was found or no process is running there.
[Tue Jan 30 2018 14:53:15 GMT+0000 (UTC)] nami    ERROR Unknown command 'update'
[Tue Jan 30 2018 14:49:15 GMT+0000 (UTC)] nami    ERROR Command 'install' expects at least 1 argument but you provided 0

Thank you for help

Hi @atestoglu,

Thanks for sharing this information.

If you look carefully to the MongoDB logs you can see that it’s showing an error message. It is giving information about a permissions issue with the /opt/bitnami/mongodb/data/db/WiredTiger.turtle file:

file:WiredTiger.wt, connection: /opt/bitnami/mongodb/data/db/WiredTiger.turtle: handle-open: open: Permission denied

Could you please check which are the file permissions of the database files? To do it, you can execute the following command:

ls -Rla /bitnami/mongodb/data/db/

All these files should have read and write permissions for the mongo user:


-rw------- 1 mongo mongo WiredTiger.turtle

If for some reason that’s not the case, you should fix those permissions. (It’s really extrange that you ended up with those permissions changed!). The commands below should be useful for you:

sudo chown -R mongo: /bitnami/mongodb/data/db/
sudo chmod -R u+rw /bitnami/mongodb/data/db/

After you fix the permissions, you should be able to start the service:

sudo service bitnami start

Also, keep in mind that maybe you need to do the same operations in the rest of the nodes of your cluster.

Note that MongoDB with replication is not expected to have a ctlscript.sh but a regular service script. You can read more about your solution here: Bitnami MongoDB For Microsoft Azure Multi-Tier Solutions.

Let us know if that is the actual issue and if you were able to solve it by fixing the permissions.

Regards,
Andrés Bono

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.