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

Ambari upgrade 2.1.1 to 2.4 ProvisionException

Expert Contributor

Hi,

I have a problem after upgrading Ambari from version 2.1.1 to 2.4. My HDP version is 2.3.2.0-2950. During command "ambari-server upgrade" I got the following error:

Upgrading database schema
Error output from schema upgrade command:
com.google.inject.ProvisionException: Guice provision errors:


1) null returned by binding at org.apache.ambari.server.state.ServiceComponentHostFactory.createExisting()
 but parameter 2 of org.apache.ambari.server.state.svccomphost.ServiceComponentHostImpl.<init>() is not @Nullable
  while locating org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity annotated with @com.google.inject.assistedinject.Assisted(value=)
    for parameter 2 at org.apache.ambari.server.state.svccomphost.ServiceComponentHostImpl.<init>(ServiceComponentHostImpl.java:805)
  while locating org.apache.ambari.server.state.ServiceComponentHost annotated with interface com.google.inject.assistedinject.Assisted


1 error
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
        at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:632)
        at com.sun.proxy.$Proxy20.createExisting(Unknown Source)
        at org.apache.ambari.server.state.ServiceComponentImpl.<init>(ServiceComponentImpl.java:166)
        at org.apache.ambari.server.state.ServiceComponentImpl$$EnhancerByGuice$$e3b47c2a.<init>(<generated>)
        at org.apache.ambari.server.state.ServiceComponentImpl$$EnhancerByGuice$$e3b47c2a$$FastClassByGuice$$6e28fac3.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.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.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:632)
        at com.sun.proxy.$Proxy19.createExisting(Unknown Source)
        at org.apache.ambari.server.state.ServiceImpl.<init>(ServiceImpl.java:163)
        at org.apache.ambari.server.state.ServiceImpl$$EnhancerByGuice$$23f59064.<init>(<generated>)
        at org.apache.ambari.server.state.ServiceImpl$$EnhancerByGuice$$23f59064$$FastClassByGuice$$9947c704.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.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)
        at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:632)
        at com.sun.proxy.$Proxy15.createExisting(Unknown Source)
        at org.apache.ambari.server.state.cluster.ClusterImpl.loadServices(ClusterImpl.java:456)
        at org.apache.ambari.server.state.cluster.ClusterImpl.getServices(ClusterImpl.java:1044)
        at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.addNewConfigurationsFromXml(AbstractUpgradeCatalog.java:384)
        at org.apache.ambari.server.upgrade.UpgradeCatalog212.executeDMLUpdates(UpgradeCatalog212.java:157)
        at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeData(AbstractUpgradeCatalog.java:899)
        at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:234)
        at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:353)


Adjusting ambari-server permissions and ownership...
Ambari Server 'upgrade' completed successfully.

After that I can start ambari-server but only with option --skip-database-check which is not a good solution. I am using Postgres. The problem occurs also when I restore my db.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

2 REPLIES 2

New Contributor

I faced the same exception with Ambari 2.7.1 with different scenario. The scenario happens like that: I was trying to install Apache Solr with HDP Search as mpack. I wrongly installed the old version of mpack and when I restart the Ambari, Ambari couldn't open. I looked into ambari-server.log and the error was like below:

An unexpected error occured during starting Ambari Server.

com.google.inject.ProvisionException: Unable to provision, see the following errors:



1) Error injecting method, java.lang.NullPointerException

at org.apache.ambari.server.api.services.AmbariMetaInfo.init(AmbariMetaInfo.java:250)

at org.apache.ambari.server.api.services.AmbariMetaInfo.class(AmbariMetaInfo.java:123)

while locating org.apache.ambari.server.api.services.AmbariMetaInfo

for field at org.apache.ambari.server.controller.AmbariServer.ambariMetaInfo(AmbariServer.java:179)

at org.apache.ambari.server.controller.AmbariServer.class(AmbariServer.java:179)

while locating org.apache.ambari.server.controller.AmbariServer



1 error

at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1028)

at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)

at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1101)

Caused by: java.lang.NullPointerException

at org.apache.ambari.server.stack.StackModule.mergeRoleCommandOrder(StackModule.java:1336)

at org.apache.ambari.server.stack.StackModule.finalizeModule(StackModule.java:244)

at org.apache.ambari.server.stack.StackManager.fullyResolveStacks(StackManager.java:413)

at org.apache.ambari.server.stack.StackManager.<init>(StackManager.java:186)

at org.apache.ambari.server.stack.StackManager$$FastClassByGuice$$33e4ffe0.newInstance(<generated>)

at

 

I tried to start ambari-server as you said with --skip-database-check but it still couldn't open. Then I install the mpack with the same version before it down again, with this command:

 

sudo ambari-server install-mpack --mpack=/tmp/hdf-ambari-mpack-3.2.0.0-520.tar.gz --verbose

 

and I restart the ambari-server. Then ambari-server works without problem and I can access Ambari  from web. Perhaps it helps.