Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

ambari-server upgrade Issues from Ambari 2.4.2 to 2.5.0.3

Solved Go to solution
Highlighted

ambari-server upgrade Issues from Ambari 2.4.2 to 2.5.0.3

New Contributor

Hi,

PFA

I was trying to upgrade ambari 2.5.0.3

ambari-server upgrade

facing below error,

ERROR [main] DBAccessorImpl:847 - Error executing query: ALTER TABLE hostcomponentdesiredstate ADD CONSTRAINT PK_hostcomponentdesiredstate PRIMARY KEY (id)java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object .

Failed to run the Amba ri Server org.apache.ambari.server.AmbariException: Current database store version is not compatible with current server version, serverVersion=2.5.0.3, schemaVersion=2.4 .2 at org.apache.ambari.server.checks.DatabaseConsistencyCheckHelper.checkD BVersionCompatible(DatabaseConsistencyCheckHelper.java:222) at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.ja va:1002)

Oracle Database need to update Schema automatically once ambari-server upgrade, but some how i am geting above issues.

any solution ?


upgrade.png
1 ACCEPTED SOLUTION

Accepted Solutions

Re: ambari-server upgrade Issues from Ambari 2.4.2 to 2.5.0.3

Super Collaborator

You're hitting an issue with Ambari Server Upgrade from 2.4.2 to 2.5.0.3 - as part of this upgrade, we need to drop and re-create the primary key on the hostcomponentdesiredstate table. The error you're getting indicates that the primary key already exists and thus can't be added again.

In your logs, you might see something like this statement:

Unable to determine the primary key constraint name for hostcomponentdesiredstate

I'd like to know why this might be happening (could be an artifact of how your Oracle DB is installed). In any event, you should be able to correct this by hand and re-run the upgrade:

ALTER TABLE hostcomponentdesiredstate DROP CONSTRAINT PK_hostcomponentdesiredstate;
ALTER TABLE hostcomponentdesiredstate ADD CONSTRAINT PK_hostcomponentdesiredstate PRIMARY KEY (id);

Now you can retry "ambari-server upgrade"

2 REPLIES 2

Re: ambari-server upgrade Issues from Ambari 2.4.2 to 2.5.0.3

Super Collaborator

You're hitting an issue with Ambari Server Upgrade from 2.4.2 to 2.5.0.3 - as part of this upgrade, we need to drop and re-create the primary key on the hostcomponentdesiredstate table. The error you're getting indicates that the primary key already exists and thus can't be added again.

In your logs, you might see something like this statement:

Unable to determine the primary key constraint name for hostcomponentdesiredstate

I'd like to know why this might be happening (could be an artifact of how your Oracle DB is installed). In any event, you should be able to correct this by hand and re-run the upgrade:

ALTER TABLE hostcomponentdesiredstate DROP CONSTRAINT PK_hostcomponentdesiredstate;
ALTER TABLE hostcomponentdesiredstate ADD CONSTRAINT PK_hostcomponentdesiredstate PRIMARY KEY (id);

Now you can retry "ambari-server upgrade"

Re: ambari-server upgrade Issues from Ambari 2.4.2 to 2.5.0.3

New Contributor

I found the root cause, ambari user which is created for oracle DB not have enough privileges to drop the Constraint. When I run ambari-server update the constraint is not dropping and not replacing new constraint.

Don't have an account?
Coming from Hortonworks? Activate your account here