Cannot stop or start nuoagent (NuoDB agent already started [ OK ])

{problem}

NuoDB can't be stopped or started due to an existing nuoagent.pid file. Command line output looks like

> nuoagent stop 
Stopping NuoDB agent [FAILED] 
> nuoagent start 
NuoDB agent already started [ OK ] 

{problem}

{solution}

Cause

The nuoagent.pid file is used to track the process ID of the NuoDB agent. It's possible that this file contains a process ID that doesn't correspond to an agent process. In this situation, "nuoagent start" thinks NuoDB is already running and "nuoagent stop" doesn't have a valid process to stop. This state can be reached if the process isn't properly stopped using the "service stop" command, which can occur if

  • The OS crashes without running init.d on shutdown
  • A user killed the java process
  • "service stop" was called but the OS shutdown before the agent process finished

Diagnosis

The location of the agent pid file is specified by the NUODB_AGENTPIDFILE environment variable, which defaults to /var/run/nuodb/nuoagent.pid on Linux systems. Files in /var/run are cleared on boot so OS crashes shutdown shouldn't be able to cause the issue on Linux systems using the default pid location. If there isn't a known cause we recommend opening a new support issue with

  1. The results of investigating the process (if still running) after identifying it with ps xauw | grep <pid>
  2. The agent.log from the afflicted host
  3. Any environment information you think would be relevant

Action

 Proper operation can typically be restored by removing the pid file.

{solution}

Have more questions? Submit a request

Comments