Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-12597

Ambari should support custom stack names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.1.0
    • 2.3.0, 2.2.2
    • ambari-server
    • None

    Description

      When upgrading to Ambari 2.1.0, with a custom stack name and version that contains letters, the Ambari Upgrade will fail, and most likely so will starting services.

      E.g.,
      /var/lib/ambari-server/stacks/HDP/
      2.2
      2.2.MYNAME

      If "2.2.MYNAME" is a stack, then the upgrade to Ambari 2.1 will attempt to insert a record in the stack table. The upgrade will then try to insert appropriate repo_version items, and then fail when trying to compare versions.

      First error,

      1) Error injecting method, java.lang.NullPointerException
        at org.apache.ambari.server.api.services.AmbariMetaInfo.init(AmbariMetaInfo.java:242)
        at org.apache.ambari.server.api.services.AmbariMetaInfo.class(AmbariMetaInfo.java:124)
        while locating org.apache.ambari.server.api.services.AmbariMetaInfo
      
      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.upgrade.UpgradeCatalog210.executeStackPreDMLUpdates(UpgradeCatalog210.java:670)
      	at org.apache.ambari.server.upgrade.UpgradeCatalog210.executePreDMLUpdates(UpgradeCatalog210.java:985)
      	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.preUpgradeData(AbstractUpgradeCatalog.java:531)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executePreDMLUpdates(SchemaUpgradeHelper.java:205)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:295)
      Caused by: java.lang.NullPointerException
      	at org.apache.ambari.server.stack.StackModule.processRepositories(StackModule.java:650)
      	at org.apache.ambari.server.stack.StackModule.resolve(StackModule.java:159)
      	at org.apache.ambari.server.stack.StackManager.fullyResolveStacks(StackManager.java:201)
      	at org.apache.ambari.server.stack.StackManager.<init>(StackManager.java:119)
      	at org.apache.ambari.server.stack.StackManager$$FastClassByGuice$$33e4ffe0.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.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.$Proxy26.create(Unknown Source)
      	at org.apache.ambari.server.api.services.AmbariMetaInfo.init(AmbariMetaInfo.java:246)
      	at org.apache.ambari.server.api.services.AmbariMetaInfo$$FastClassByGuice$$202844bc.invoke(<generated>)
      	at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
      	at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:56)
      	at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:90)
      	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
      	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
      	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)
      	... 6 more
      

      Next error,

      java.lang.NumberFormatException: For input string: "NEA"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
              at java.lang.Integer.parseInt(Integer.java:580)
              at java.lang.Integer.parseInt(Integer.java:615)
              at org.apache.ambari.server.utils.VersionUtils.compareVersions(VersionUtils.java:76)
              at org.apache.ambari.server.utils.VersionUtils.compareVersions(VersionUtils.java:136)
              at org.apache.ambari.server.upgrade.UpgradeCatalog210.removeStormRestApiServiceComponent(UpgradeCatalog210.java:1141)
              at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeDMLUpdates(UpgradeCatalog210.java:1001)
              at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeData(AbstractUpgradeCatalog.java:536)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:220)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:297)
      30 Jul 2015 22:28:59,105 ERROR [main] SchemaUpgradeHelper:308 - Exception occurred during upgrade, failed
      org.apache.ambari.server.AmbariException: For input string: "NEA"
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:223)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:297)
      Caused by: java.lang.NumberFormatException: For input string: "NEA"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
              at java.lang.Integer.parseInt(Integer.java:580)
              at java.lang.Integer.parseInt(Integer.java:615)
              at org.apache.ambari.server.utils.VersionUtils.compareVersions(VersionUtils.java:76)
              at org.apache.ambari.server.utils.VersionUtils.compareVersions(VersionUtils.java:136)
              at org.apache.ambari.server.upgrade.UpgradeCatalog210.removeStormRestApiServiceComponent(UpgradeCatalog210.java:1141)
              at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeDMLUpdates(UpgradeCatalog210.java:1001)
              at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeData(AbstractUpgradeCatalog.java:536)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:220)
              ... 1 more
      

      Attachments

        1. AMBARI-12597.patch
          9 kB
          Sumit Mohanty

        Issue Links

          Activity

            People

              sumitmohanty Sumit Mohanty
              afernandez Alejandro Fernandez
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: