[ 
https://issues.apache.org/jira/browse/AMBARI-23129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Levas updated AMBARI-23129:
----------------------------------
    Description: 
*1. An NPE is thrown will initializing the Ambari server upgrade catalog*

{code:title=com.google.inject.persist.jpa.JpaPersistService#begin}
    public void begin() {
        Preconditions.checkState(null == this.entityManager.get(), "Work 
already begun on this thread. Looks like you have called UnitOfWork.begin() 
twice without a balancing call to end() in between.");
        this.entityManager.set(this.emFactory.createEntityManager());
    }
{code}

{{this.emFactory}} is {{null}}.

*Cause*
{{com.google.inject.persist.jpa.JpaPersistService#start()}} was not called 
before {{com.google.inject.persist.jpa.JpaPersistService#begin}} to do order of 
operations in {{org.apache.ambari.server.upgrade.SchemaUpgradeHelper#main}}.  

*Solution*
Ensure {{com.google.inject.persist.jpa.JpaPersistService#start()}} is being 
called before {{com.google.inject.persist.jpa.JpaPersistService#begin}} in 
{{org.apache.ambari.server.upgrade.SchemaUpgradeHelper#main}}.  

-----

*2. Missing repo_os table*

The {{repo_os}} table was never added to the UpgradeCatalog implementation.

*Solution*
Add the {{repo_os}} table while executing 
{{org.apache.ambari.server.upgrade.UpgradeCatalog270#executeDDLUpdates}}. 

-----

*3. Entity classes are initialized before the schema of the underlying database 
is updated*

*Solution*
Notify relevant classes that the persistence infrastructure is ready after DDL 
updates have been applied. 

The {{org.apache.ambari.server.events.publishers.AmbariEventPublisher}} is to 
be used for issuing  a {{org.apache.ambari.server.events.JpaInitializedEvent}}.





  was:
An NPE is thrown will initializing the Ambari server upgrade catalog:

{code:title=com.google.inject.persist.jpa.JpaPersistService#begin}
    public void begin() {
        Preconditions.checkState(null == this.entityManager.get(), "Work 
already begun on this thread. Looks like you have called UnitOfWork.begin() 
twice without a balancing call to end() in between.");
        this.entityManager.set(this.emFactory.createEntityManager());
    }
{code}

{{this.emFactory}} is {{null}}.

*Cause*
{{com.google.inject.persist.jpa.JpaPersistService#start()}} was not called 
before {{com.google.inject.persist.jpa.JpaPersistService#begin}} to do order of 
operations in {{org.apache.ambari.server.upgrade.SchemaUpgradeHelper#main}}.  

*Solution*
Ensure {{com.google.inject.persist.jpa.JpaPersistService#start()}} is being 
called before {{com.google.inject.persist.jpa.JpaPersistService#begin}} in 
{{org.apache.ambari.server.upgrade.SchemaUpgradeHelper#main}}.  





> Multiple issues while executing Ambari server upgrade to Ambari 2.7.0
> ---------------------------------------------------------------------
>
>                 Key: AMBARI-23129
>                 URL: https://issues.apache.org/jira/browse/AMBARI-23129
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.7.0
>            Reporter: Robert Levas
>            Assignee: Robert Levas
>            Priority: Critical
>             Fix For: 2.7.0
>
>
> *1. An NPE is thrown will initializing the Ambari server upgrade catalog*
> {code:title=com.google.inject.persist.jpa.JpaPersistService#begin}
>     public void begin() {
>         Preconditions.checkState(null == this.entityManager.get(), "Work 
> already begun on this thread. Looks like you have called UnitOfWork.begin() 
> twice without a balancing call to end() in between.");
>         this.entityManager.set(this.emFactory.createEntityManager());
>     }
> {code}
> {{this.emFactory}} is {{null}}.
> *Cause*
> {{com.google.inject.persist.jpa.JpaPersistService#start()}} was not called 
> before {{com.google.inject.persist.jpa.JpaPersistService#begin}} to do order 
> of operations in 
> {{org.apache.ambari.server.upgrade.SchemaUpgradeHelper#main}}.  
> *Solution*
> Ensure {{com.google.inject.persist.jpa.JpaPersistService#start()}} is being 
> called before {{com.google.inject.persist.jpa.JpaPersistService#begin}} in 
> {{org.apache.ambari.server.upgrade.SchemaUpgradeHelper#main}}.  
> -----
> *2. Missing repo_os table*
> The {{repo_os}} table was never added to the UpgradeCatalog implementation.
> *Solution*
> Add the {{repo_os}} table while executing 
> {{org.apache.ambari.server.upgrade.UpgradeCatalog270#executeDDLUpdates}}. 
> -----
> *3. Entity classes are initialized before the schema of the underlying 
> database is updated*
> *Solution*
> Notify relevant classes that the persistence infrastructure is ready after 
> DDL updates have been applied. 
> The {{org.apache.ambari.server.events.publishers.AmbariEventPublisher}} is to 
> be used for issuing  a 
> {{org.apache.ambari.server.events.JpaInitializedEvent}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to