Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
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 ambari.properties 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 : https://issues.apache.org/jira/browse/AMBARI-24992

the work around here is :

  1. Edit the ambari.properties 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

348 Views
0 Kudos
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎12-19-2018 06:08 PM
Updated by:
 
Contributors
Top Kudoed Authors