Because Mongo is abnormally closed, an error message of “error: child process failed, exited with error number 1” may appear when it is started again.
Step 1: delete the lock file
Find Mongo directory and delete mogod lock
Step 2: create a new log file
Find the log file directory of Mongo and delete or modify the original log file name
[because I don’t want to modify Mongo’s configuration file, I modified the file name and added a file with the same name as the original file. I can also take another name and modify Mongo configuration]
Step 3 try to restart
Generally, the restart is successful at this step.
If it still fails, take a look at Mongo’s log file
the errors reported in my log file are as follows:
2021-12-16T11:58:12.810+0800 I CONTROL [main] ***** SERVER RESTARTED *****
2021-12-16T11:58:12.815+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2021-12-16T11:58:12.820+0800 I CONTROL [main] ERROR: Cannot write pid file to /var/run/mongodb/mongod2.pid: No such file or directory
Then go to the prompt “/var/run” directory, create a new mongodb folder, and restart. Start successfully and solve the problem!
Read More:
- [Solved] Linux Mongodb Error: # Error: coul-bash: connecting: command not found
- [Solved] prometheus Startup Error: opening storage failed
- Ubuntu found an error during apt operation [How to Solve]
- [Solved]unpacking of archive failed: cpio: lstat failed – Not a directory
- Could not find an NgModule. Use the skip-import option to skip importing in NgModule
- [Solved] Exception in replication between CentOS virtual machine and host
- [Solved] Docker Staratup Error: Failed to start Docker Application Container Engineadsafdsad.
- Ubuntu sub process/usr/bin/dpkg returned an error code (1) solution
- How to fix the ERROR: Failed to build gem native extension in Centos 8
- Solution of device eth0 does not see to be present, delaying initialization. Error in network card under Linux
- [Solved] Ubuntu 20.04.3 Fail to Start sshd Error: Failed to start OpenBSD Secure Shell server
- [Solved] Sshd startup error: Failed at step CGROUP spawning /usr/sbin/sshd: No space left on device
- How to Fix error 28 from storage engine
- [Solved] Linux virtual machine startup error: operating system not found
- Problem solving / etc/ rc.local The boot entry of the file configuration is invalid
- The solution of insufficient disk space of docker in Ubuntu
- Restart and stop of nginx in Linux service
- [Solved] Job for network.service failed because the control process exited with error code. See “systemctl st
- [Solved] /usr/bin/ld: cannot find crti.o: No such file or directory & /usr/bin/ld: cannot find -lc