Cannot start ambari services with 400 status code

Error Message

You maybe meet this kind of error message showing below when you click the button “Start All”.

cannotstartambari

Error message: java.lang.IllegalArgumentException: Invalid transition for servicecomponenthost, clusterName=ambari, clusterId=2, serviceName=SMARTSENSE, componentName=ACTIVITY_EXPLORER, hostname=ambari.com, currentState=STOPPING, newDesiredState=STARTED

Solution

It’s so annoying I cannot find any great solutions online until I saw this article in the hortonworks community.

cannotstartambari

Step1: Update the state of components in Ambari

cannotstartambari

So, update the table hostcomponentstate.

Step2: Restart Ambari agents and server

1
2
3
ambari-agent restart

ambari-server restart

Reason

Stopping your Ambari cluster in an exceptional steps will cause this kind of message such as exceptional poweroff.

So, we ought to follow the correct steps blow to avoid this kind of unexpectable error.

  1. Clicking the button “Stop All”.

  2. Running the commands below.

    1
    2
    3
    ambari-agent stop

    ambari-server stop
  3. Powering off VMs.