mongodb: UnknownError assertion src/mongo/db/server_options_helpers.cpp:355 - mongodb

I was running mongodb without any issues until now. I don't really know what happened, as don't remember doing nothing weird. Still, now I get the following error when I try to launch the mongo server.
$ mongod --config /usr/local/etc/mongod.conf
2015-01-22T13:58:04.153+0100 Assertion failure getcwd(buffer, 1000) src/mongo/db/server_options_helpers.cpp 355
2015-01-22T13:58:04.169+0100 0x1017ae5aa 0x101759135 0x101745bf2 0x1015509ed 0x10132b7a3 0x100fd2be6 0x100fc5291 0x100fd60be 0x100fd68ae 0x100fc41eb 0x7fff8aff35c9
0 mongod 0x00000001017ae5aa _ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE + 58
1 mongod 0x0000000101759135 _ZN5mongo10logContextEPKc + 453
2 mongod 0x0000000101745bf2 _ZN5mongo12verifyFailedEPKcS1_j + 626
3 mongod 0x00000001015509ed _ZN5mongo18storeServerOptionsERKNS_17optionenvironment11EnvironmentERKNSt3__16vectorINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS9_ISB_EEEE + 10237
4 mongod 0x000000010132b7a3 _ZN5mongo18storeMongodOptionsERKNS_17optionenvironment11EnvironmentERKNSt3__16vectorINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS9_ISB_EEEE + 35
5 mongod 0x0000000100fd2be6 _ZN5mongo45_mongoInitializerFunction_MongodOptions_StoreEPNS_18InitializerContextE + 38
6 mongod 0x0000000100fc5291 _ZN5boost6detail8function17function_invoker1IPFN5mongo6StatusEPNS3_18InitializerContextEES4_S6_E6invokeERNS1_15function_bufferES6_ + 17
7 mongod 0x0000000100fd60be _ZNK5mongo11Initializer7executeERKNSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEERKNS1_3mapIS8_S8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEE + 270
8 mongod 0x0000000100fd68ae _ZN5mongo21runGlobalInitializersEiPKPKcS3_ + 526
9 mongod 0x0000000100fc41eb main + 331
10 libdyld.dylib 0x00007fff8aff35c9 start + 1
2015-01-22T13:58:04.177+0100 SEVERE: Failed global initialization: UnknownError assertion src/mongo/db/server_options_helpers.cpp:355
I've tried running mongo --repair too, but got the same error.

This is weird!
I'm on OSX, using iTerm where I've tried to run the above process. Once I've quite iTerm, and restarted it, the created shell could run the process without any problems.
It seems as the process could not stop previously. Before, I even tried running mongo to see if I can connect, but it failed.

Related

mongoDB: child process failed, exited with 1 & 14

I have already tried it with the following thread but it didn't help me:
ERROR: child process failed, exited with error number 1,mongodb
Tried that:
sudo mongod --fork --config /etc/mongod.conf --logpath /var/log/mongodb/mongod.log
Result:
forked process: 2887
ERROR: child process failed, exited with 48
To see additional information in this output, start without the "--fork" option.
Tried the following as well:
sudo systemctl start mongod
One of the lines in the error message say:
ERROR: child process failed, exited with 14
Would appreciate any help. mongod was working pretty well until I have started trying to implement a replica set.
Use this command on the terminal:
sudo mongod --dbpath /System/Volumes/Data/data/db
It should start the MongoDB server and allocate a port for it. You can exit out of the server and then try the command again and it should work.

Unable to start mongodb without access control

I am using EC2(for Ubuntu 16.04) and i have installed mongodb 3.6
but when i start it using following command
mongod --port 27017 --dbpath /data/db
It is giving following error
An unsupported journal format detected - If you are trying to rollback from version 4.0 to 3.6, please re-start a 4.0 binary and cleanly shut it down so that the journal format will be downgraded.
Assertion: 28595:13: Permission denied src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 488
exception in initAndListen: Location28595: 13: Permission denied, terminating
Invariant failure globalStorageEngine src/mongo/db/service_context_d.cpp 272
please suggest
Try:
sudo service mongod restart
sudo service mongod status
sudo service mongod stop
sudo service mongod status
and then maybe your commands to follow

Is the server running locally and accepting connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”? in Odoo

After some time the Postgres database stopped working of my live server. I'm working on this server from last 8 months. Now suddenly it's stopped working.
when I try to enter the command, psql produces an error
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
enter image description here
I'm using odoo8.
First, you need to make sure the socket file is located in /var/run/postgresql/.s.PGSQL.5432. To check that
$ cat /var/run/postgresql/.s.PGSQL.5432
if result shows something, then the problem is anything else. But, if file is not there you need to check /tmp dir (specially for OSX Homebrew users)
$ cd /tmp
$ l
total 16
drwxrwxrwt 7 root wheel 224B Mar 11 08:03 .
drwxr-xr-x 6 root wheel 192B Jan 23 18:35 ..
-rw-r--r-- 1 root wheel 65B Nov 7 22:59 .BBE72B41371180178E084EEAF106AED4F350939DB95D3516864A1CC62E7AE82F
srwxrwxrwx 1 shiva wheel 0B Mar 11 08:03 .s.PGSQL.5432
-rw------- 1 shiva wheel 57B Mar 11 08:03 .s.PGSQL.5432.lock
drwx------ 3 shiva wheel 96B Mar 10 17:11 com.apple.launchd.C1tUB2MvF8
drwxr-xr-x 2 root wheel 64B Mar 10 17:10 powerlog
Now, there are two ways you can solve the error
Solution One
You can change the application configuration to see for sockets at /tmp/.s.PGSQL.5432
For Rails Users
# config/database.yml
default: &default
adapter: postgresql
pool: 5
# port:
timeout: 5000
encoding: utf8
# min_messages: warning
socket: /tmp/.s.PGSQL.5432
Solution Two
You can create symlinks to the expected location
$ sudo mkdir /var/pgsql_socket
$ sudo ln /tmp/.s.PGSQL.5432 /var/pgsql_socket/
Then the error should go.
Hope this helps.
Note: Your default socket directory may not be /tmp
Did you update/upgrade your database?
Did you start a docker container that interfered with any of your data-store/socket file locations?
This probably doesn't fit your situation exactly, but maybe it will provide some insight:
Sometimes when you try
sudo systemctl start postgresql.service
and the systemd status says it is started but you still get that error message when trying to connect, try this instead:
sudo pg_ctlcluster <version> <cluster> <action>
which in my case had been
sudo pg_ctlcluster 13 main start

MongoDB crashes with signal 6

Tue Apr 1 17:21:38.898 [initandlisten] connection accepted from 127.0.0.1:58349 #42 (5 connections now open)
Tue Apr 1 17:21:50.855 [journal] exception in dur::groupCommitLL causing immediate shutdown: boost::filesystem::current_path: Too many open files in system
Tue Apr 1 17:21:50.855 dur4
Tue Apr 1 17:21:50.855 Got signal: 6 (Abort trap: 6).
Tue Apr 1 17:21:50.858 Backtrace:
0x100447d8b 0x100001531 0x7fff9225990a 0x104e80818 0x7fff922b0f61 0x1001e462a 0x10016dc3c 0x10016d537 0x10047a8b5 0x7fff9226b772 0x7fff922581a1
0 mongod 0x0000000100447d8b _ZN5mongo15printStackTraceERSo + 43
1 mongod 0x0000000100001531 _ZN5mongo10abruptQuitEi + 225
2 libsystem_c.dylib 0x00007fff9225990a _sigtramp + 26
3 ??? 0x0000000104e80818 0x0 + 4377282584
4 libsystem_c.dylib 0x00007fff922b0f61 abort + 143
5 mongod 0x00000001001e462a _ZN5mongo10mongoAbortEPKc + 90
6 mongod 0x000000010016dc3c _ZN5mongo3dur27groupCommitWithLimitedLocksEv + 1052
7 mongod 0x000000010016d537 _ZN5mongo3dur9durThreadEv + 583
8 mongod 0x000000010047a8b5 thread_proxy + 229
9 libsystem_c.dylib 0x00007fff9226b772 _pthread_start + 327
10 libsystem_c.dylib 0x00007fff922581a1 thread_start + 13
Would anyone know what is causing mongo to crash? If you need more context please comment - I'll see what else I can dig up.
Change the ulimit value works for me (previously it was 256):
ulimit -n 1000
In this case I'm setting ulimit to 1.000, but you can use whatever value that you want.
According to documentation:
ulimit refers to the per-user limitations for various resources.
Therefore, if your mongod instance executes as a user that is also
running multiple processes, or multiple mongod processes, you might
see contention for these resources. Also, be aware that the processes
value (i.e. -u) refers to the combined number of distinct processes
and sub-process threads.

JavaScript execution failed connected to mongoHQ shell

Trying to access MongoHQ directly:
> mongo mongodb://heroku:mypassword#alex.mongohq.com:10046/myapp
MongoDB shell version: 2.4.3
connecting to: mongodb://heroku:mypassword#alex.mongohq.com:10046/myapp
Tue Jun 4 16:10:09.255 Assertion failure _setName.size() src/mongo/client/dbclientinterface.h 211
0x10017116b 0x100135396 0x100068356 0x100129bab 0x10010f92f 0x10024b2fa 0x139ba3a06362 0x139ba3a0ce93 0x139ba3a400c9 0x139ba3a0c76e
0 mongo 0x000000010017116b _ZN5mongo15printStackTraceERSo + 43
1 mongo 0x0000000100135396 _ZN5mongo12verifyFailedEPKcS1_j + 310
2 mongo 0x0000000100068356 _ZN5mongo16ConnectionString5parseERKSsRSs + 1878
3 mongo 0x0000000100129bab _ZN5mongo17mongoConsExternalEPNS_7V8ScopeERKN2v89ArgumentsE + 187
4 mongo 0x000000010010f92f _ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE + 175
5 mongo 0x000000010024b2fa _ZN2v88internalL30Builtin_HandleApiCallConstructENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 618
6 ??? 0x0000139ba3a06362 0x0 + 21559186056034
7 ??? 0x0000139ba3a0ce93 0x0 + 21559186083475
8 ??? 0x0000139ba3a400c9 0x0 + 21559186292937
9 ??? 0x0000139ba3a0c76e 0x0 + 21559186081646
Tue Jun 4 16:10:09.264 JavaScript execution failed: Error: assertion src/mongo/client/dbclientinterface.h:211 at src/mongo/shell/mongo.js:L114
exception: connect failed
What's to be done?
This is a shell bug and it's not a new one. Basically the mongo shell doesn't accept the same format of connection string that regular mongodb drivers do. I can reproduce this error in the current and previous versions and this syntax isn't expected to work (though it probably shouldn't crash either, but there is already a bug for the shell to accept standard connection string: jira.mongodb.org/browse/SERVER-3254
Meanwhile you can connect by using the mongo shell options such as
mongo -u <user> -p <passwd> hostIP:port/db
or
mongo --host host --port port [ other options ] db
Just see if you have $ in your password, in that scenario enclose your password with ' ' then try to connect.
e.g.
mongo mongodb://host:port/authdb -username
dbusername -p 'password$123'