Linux Failed to start couchbase-server : timed out - linux

Linux is installed on my server. Couchbase is not functioning well on the server, so i just try to stop and start it
service couchbase-server stop
It will take to much time and in between my server connection getting lost, after again connected to server i checked the status of couchbase
service couchbase-server status
It will telling that the couchbase-server is not running. Now i am trying to start the couchbase-server as
service couchbase-server start
But it always displaying message
Failed to start couchbase-server:timed out
There are also two crash_log.bin and crash_log_v2.bin file in my logs directory.

Related

Error restarting service: Failed to try-restart nscd.service: Unit nscd.service not found

I am trying to add a startup script in my GCP VM Instance to fetch data from a website (web crawler). I wanted to automate the crawling task following this answer. So, I added a startup script in my VM instance. The script looks like below:
#! /bin/bash
python3 /home/sadmanks/site-spider/src/main.py
Then, I wanted to schedule this instance. But when executing this startup script, it doesn't start the program that I want to execute. The log message that I get is following:
"Error restarting service: Failed to try-restart nscd.service: Unit nscd.service not found
I tried to do this in the browser ssh connection: sudo service nscd start outputs:
Failed to start nscd.service: Unit nscd.service not found.
Does anyone have any idea, how to resolve this issue?
Note: The program runs perfectly when I try to connect the instance with an SSH to my local machine.
The error "Error restarting service: Failed to try-restart nscd.service: Unit crond.service not found." is just harmless log spam. These error messages show up on every VM on start-up and are expected since systemd services like crond.service and nscd.service do not exist on COS. So, try updating the version of google-guest-agent service. But as suggested by #John Hanley that service is not related to python, web scraping/crawling, etc. So, make sure you know what the program is doing before running it on public servers.

Azure VM no response after installing update and auto-restart

When there was an update being installed and it required a restart, Azure VM restarted during off-hours, then it went into no response state. I had to stop and start it via portal.
It occurred a couple of times already. One example is KB4592440.
=====
Windows Setup log:
9/12/2020 11:29:15 AM
A reboot is necessary before package KB4592440 can be changed to the Installed state.
System logs:
10/12/2020 1:18:00 AM
The process C:\windows\system32\svchost.exe (MyVM) has initiated the restart of computer MyVM on behalf of user NT AUTHORITY\SYSTEM for the following reason: Operating System: Service pack (Planned)
Reason Code: 0x80020010
Shutdown Type: restart
Comment:
Other system logs:
The Windows Modules Installer service entered the running state.
The Update Orchestrator Service service entered the stopped state.
The Update Orchestrator Service service terminated with the following error:
This operation returned because the timeout period expired.
...(many other service went into stopped state)...
The Windows Event Log service entered the stopped state.
The Remote Desktop Services service entered the stopped state.
===========
No more logs. MyVM is stuck in nowhere, until I stopped & started it. Then there was a Setup log:
Package KB4592440 was successfully changed to the Installed state.
Appreciate any help.

node-opcua-samples - simple_client.js does not connect to simple_server.js

i'm trying to gain deeper knowledge of using opc. So i installed node js and then node-opcua-samples via npm.
Afterwards i went to powershell, changed cwd to the bin directory of node-opcua-samples and started simple_server.js with
node simple_server.js
The server is starting and prints
server now waiting for connections. CTRL+C to stop
to the console. Then it prints
contacting discovery server backoff opc.tcp://localhost:4840 attempt # 0 retrying in 2 seconds
server registration is still pending (is Local Discovery Server up and running ?)
From the output i expect to be able to connect to the running server, even though it shows the warning concerning the discovery server. Am i right?
The next step is to start simple_client.js in a second powershell by changeing the cwd to the bin directory of node-opcua-samples and then use
node simple_client.js >endpointUrl printed by server<
At this point i'm expecting the client to connect to the started server and complete the test cases build in. But the client seemingly is not able to connect to the server and prints
backoff attempt # 0 retrying in 2 seconds
Following the hint given inside of simple_client.js and running simple_client_ts.ts with ts-node results in the same behavior.
So where is my mistake?
Any hints or questions will be appreciated.
Regards
Gregor
Systemdetails for reproduction:
Windows 10
Node Version 12.13.0
node-opcua-samples Version 2.5.7
Ok, i solved the problem....
Instead of using the endpointUrl printed by the server, i had to start the client with the endpoint opc.tcp://localhost:26543. The used port is the default port set in simple_server.js.
The warning about the discovery server vanished after setting registerServerMethod in simple_server.js from RegisterServerMethod.LDS to RegisterServerMethod.HIDDEN.
Best regards
Gregor

NodeJS - Keep my App running with Forever

Currently, I have a NodeJS service running on my server. It provides a RestAPI thanks to HAPI.JS
This service run permanently with forever executed in upstart script but I got some trouble.
Sometimes, the service have an error like this :
Debug: internal, implementation, error
TypeError: Uncaught error: Cannot call method 'replace' of undefined....
At this moment, server is completly down and never restart :(
I need a 100% stable service that why I have to restart it when an error appears.
My Question :
How can I restart NodeJS Service with forever when errors occured ?
Run you app with pm2 instead of forever. Pm2 will restart the node server even after uncaught exceptions.
If the process fails on startup then it won't restart automatically. You can configure the minimum uptime --minUptime flag.
You can then use the --watch flag to watch for changes of the fix.
However, the specific error you're receiving wouldn't normally stop the Hapi process which would suggest this isn't a forever issue.

couchdb don't start on server reboot

I've using the standard init.d script that comes with CouchDB. I'm using it on Ubuntu.
On server restart, this is printed on local console:
* Starting database server couchdb [ OK ]
So, it's assumed that CouchDB was started, but not. CouchDB is not started.
I must log into the server and start service with service couchdb start, then CouchDB was started correctly.
Any idea in how to debug why CouchDB is not started on reboot ? Already done the update-rc.d command.

Resources