Support Questions
Find answers, ask questions, and share your expertise

ERROR: Exiting with exit code -1. REASON: Ambari Server java process died with exitcode 1.

New Contributor

I tried to install Ambari 2.4.2 on Centos7 (a VM built on Openstack).

Installation and Configuration are ok.

When trying to start the ambari-server I get the following error:

	ERROR: Exiting with exit code -1.
	REASON: Ambari Server java process died with exitcode 1. Check /var/log/ambari-server/ambari-server.out for more information.

Here the log of my "spark-master" machine:

1) Error injecting constructor, java.net.UnknownHostException: spark-master: spark-master: unknown erro
1 error
Caused by: java.net.UnknownHostException: spark-master: spark-master: unknown error
Caused by: java.net.UnknownHostException: spark-master: unknown error
java.net.UnknownHostException: spark-master: spark-master: unknown error
Caused by: java.net.UnknownHostException: spark-master: unknown error
java.net.UnknownHostException: spark-master: spark-master: unknown error
Caused by: java.net.UnknownHostException: spark-master: unknown error
15 Mar 2017 11:41:45,444 ERROR [main] AmbariServer:929 - Failed to run the Ambari Server
com.google.inject.ProvisionException: Guice provision errors:

6 REPLIES 6

Super Mentor

@Claudia Volpetti

Can you please share some more stackTrace form ambari-server.log specially after the following lines:

ERROR [main] AmbariServer:929 - Failed to run the Ambari Servercom.google.inject.ProvisionException: Guice provision errors:

.

If you can share the complete "ambari-server.log" then it will be much better though. Also the "/var/log/ambari-server/ambari-server.out" file will be useful as looks like it is failing immediately....so we can find some reasons inside the Out file as well.

Explorer
Ambari-server restart Using python /usr/bin/python Restarting ambari-server Ambari Server is not running Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Ambari database consistency check started... Server PID at: /var/run/ambari-server/ambari-server.pid Server out at: /var/log/ambari-server/ambari-server.out Server log at: /var/log/ambari-server/ambari-server.log Waiting for server start...........................................ERROR: Exiting with exit code -1. REASON: Ambari Server java process has stopped. Please check the logs for more information.

New Contributor

Hi @Jay SenSharma, thank you

here the complete code of the error:

[centos@spark-master ~]$ sudo ambari-server start
Using python  /usr/bin/python
Starting ambari-server
WARNING: The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. Please check the DNS setup and fix the issue.
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
No errors were found.
Ambari database consistency check finished
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start....................
ERROR: Exiting with exit code -1.
REASON: Ambari Server java process died with exitcode 1. Check /var/log/ambari-server/ambari-server.out for more information.

and here the ambari-server.log after the ERROR:

ERROR [main] AmbariServer:929 - Failed to run the Ambari Server
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.net.UnknownHostException: spark-master: spark-master: unknown error
  at org.apache.ambari.server.controller.AmbariManagementControllerImpl.<init>(AmbariManagementControllerImpl.java:332)
  at org.apache.ambari.server.controller.AmbariManagementControllerImpl.class(AmbariManagementControllerImpl.java:213)
  while locating org.apache.ambari.server.controller.AmbariManagementControllerImpl
  while locating org.apache.ambari.server.controller.AmbariManagementController
  at org.apache.ambari.server.agent.HeartBeatHandler.<init>(HeartBeatHandler.java:161)
  at org.apache.ambari.server.agent.HeartBeatHandler.class(HeartBeatHandler.java:122)
  while locating org.apache.ambari.server.agent.HeartBeatHandler

1 error
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
        at org.apache.ambari.server.controller.AmbariServer.performStaticInjection(AmbariServer.java:831)
        at org.apache.ambari.server.controller.AmbariServer.run(AmbariServer.java:297)
        at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:927)
Caused by: java.net.UnknownHostException: spark-master: spark-master: unknown error
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
        at org.apache.ambari.server.controller.AmbariManagementControllerImpl.<init>(AmbariManagementControllerImpl.java:339)
        at org.apache.ambari.server.controller.AmbariManagementControllerImpl$$EnhancerByGuice$$b5e6349b.<init>(<generated>)
        at org.apache.ambari.server.controller.AmbariManagementControllerImpl$$EnhancerByGuice$$b5e6349b$$FastClassByGuice$$8d4e4172.newInstance(<generated>)
        at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
        at com.google.inject.internal.ProxyFactory$ProxyConstructor.newInstance(ProxyFactory.java:260)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
        at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
        at org.apache.ambari.server.agent.HeartbeatMonitor.<init>(HeartbeatMonitor.java:90)
        at org.apache.ambari.server.agent.HeartBeatHandler.<init>(HeartBeatHandler.java:165)
        at org.apache.ambari.server.agent.HeartBeatHandler$$FastClassByGuice$$710e5a0c.newInstance(<generated>)
        at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
        at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
        at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
        ... 4 more
Caused by: java.net.UnknownHostException: spark-master: unknown error
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
        ... 36 more
15 Mar 2017 13:19:30,511  INFO [Stack Version Loading Thread] LatestRepoCallable:80 - Loading latest URL info for stack HDP-2.4 from http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
15 Mar 2017 13:19:30,601  INFO [Stack Version Loading Thread] LatestRepoCallable:219 - Stack HDP-2.4 cannot resolve OS debian6 to the supported ones: suse11,redhat7,debian7,redhat6,ubuntu14,ubuntu12. Family: null
15 Mar 2017 13:19:30,731  INFO [Stack Version Loading Thread] LatestRepoCallable:80 - Loading latest URL info for stack HDP-2.5 from http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
15 Mar 2017 13:19:30,962  INFO [Stack Version Loading Thread] LatestRepoCallable:219 - Stack HDP-2.5 cannot resolve OS ubuntu16 to the supported ones: suse12,suse11,redhat7,debian7,redhat6,ubuntu14,ubuntu12. Family: ubuntu16
15 Mar 2017 13:19:30,963  INFO [Stack Version Loading Thread] LatestRepoCallable:80 - Loading latest URL info for stack HDP-2.3.ECS from http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json
15 Mar 2017 13:19:31,344  INFO [Stack Version Loading Thread] LatestRepoCallable:80 - Loading latest URL info for stack HDP-2.1.GlusterFS from http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
15 Mar 2017 13:19:31,369  INFO [Stack Version Loading Thread] LatestRepoCallable:80 - Loading latest URL info for stack HDP-2.3.GlusterFS from http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json
15 Mar 2017 13:19:31,584  INFO [Stack Version Loading Thread] LatestRepoCallable:80 - Loading latest URL info for stack HDP-2.0 from http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json

and the ambari-server.out:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Exception in thread "main" org.apache.ambari.server.AmbariException: Error stopping the server
        at org.apache.ambari.server.controller.AmbariServer.stop(AmbariServer.java:812)
        at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:931)

Thank you for helping

Super Mentor

@Claudia Volpetti

Looks like somewhere the hostname settings on the ambari server host are not correct.

Please check the "/etc/hosts" file to see if it has proper entries?

Also check if the output of the following command shows the desired FQDN?

# hostname  -f 

.

In your case ambari is failing to resolve the Hostname at: https://github.com/apache/ambari/blob/release-2.4.2/ambari-server/src/main/java/org/apache/ambari/se...

So please fix the hostname on the host where you are running the AmbariServer.

.

Setting correct hostname /FQDN is one of the prerequisite: https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-installation/content/edit_the_hos...

And

https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-installation/content/edit_the_net...

New Contributor
@Jay SenSharma

It works!

You are right, my FQDN was not set, as you can see by the following:

# hostname -f

hostname: Name or service not known

I had just to edit the /etc/hosts and give IP Address,FQDN name and Server name and everything works!

Thank you

@Jay SenSharma

Thanks, Worked for me too