Community Articles
Find and share helpful community-sourced technical articles
Labels (1)

Consider my cluster is having SSO configured and my SSO certificate contains character larger than 2048 and i am upgrading to ambari-2.7.0 using the command : ambari-server upgrade

There is a high chance your upgrade will get stuck at schema upgrade phase and in the ambari-server log you will find the below exception :

Internal Exception: java.sql.BatchUpdateException: Batch entry 2 INSERT INTO ambari_configuration (property_name, category_name, property_value) VALUES ('ambari.sso.provider.certificate','sso-configuration',<LONG VERTIFICATE VALUE>') was aborted: ERROR: value too long for type character varying(2048)  Call getNextException to see other errors in the batch.

Root Cause : While upgrade to ambari-2.7.x + versions ambari will move the sensitive data from to ambari database table : ambari_configuration . if any of this sensitive data contains more than 2048 characters it will fail. usually certificates issues wont be more than 2048 characters but some cases if its higher than 2048. you might hit the abouve error.

This issue is fixed in Ambari-2.8 as part of :

the work around here is :

  1. Edit the file and remove the entry for authentication.jwt.publicKey
  2. Perform the Ambari upgrade
  3. Manually alter the database:
ALTER TABLE ambari_configuration ALTER COLUMN property_value TYPE VARCHAR(4000);

NOTE: This syntax is specific to Postgres

4. Manually insert the relevant PEM file's contents into the database

INSERT INTO ambari_configuration(category_name, property_name, property_value) 
VALUES ('sso-configuration', 'ambari.sso.provider.certificate', '<CONTENT OF THE PEM FILE>');

5. Restart ambari database

0 Kudos