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.

Configuring Ranger with PostgreSQL fails

Configuring Ranger with PostgreSQL fails

New Contributor

Greetings,

I'm working on a POC for a configuration that specifies Ranger using PostgreSQL. I have deployed a sandbox and also an external VM with Postgresql DB. The setup script fails with PSQLException function last_insert_id() does not exist.

Any help how to resolve it would be much appreciated. TIA.

2016-07-15 19:22:01,505  [JISQL] /usr/lib/jvm/java/bin/java -cp /usr/share/java/postgresql-jdbc.jar:/usr/hdp/2.4.0.0-169/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver postgresql -cstring jdbc:postgresql://postgres/ranger -u rangeradmin -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = 'J10001' and active = 'Y';"
2016-07-15 19:22:01,856  [I] java patch PatchPasswordEncryption_J10001 is being applied..
[EL Warning]: 2016-07-15 19:22:11.416--ClientSession(547700634)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20131113-a7346c6): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: function last_insert_id() does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.
  Position: 8
Error Code: 0
Call: SELECT LAST_INSERT_ID()
Query: ValueReadQuery(name="x_service_config_def_SEQ" sql="SELECT LAST_INSERT_ID()")
[EL Warning]: 2016-07-15 19:22:11.441--UnitOfWork(804661898)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20131113-a7346c6): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
Error Code: 0
Call: INSERT INTO x_service_config_def (ADDED_BY_ID, CREATE_TIME, def_id, default_value, description, is_mandatory, item_id, label, name, sort_order, rb_key_description, rb_key_label, rb_key_validation_message, sub_type, type, ui_hint, UPDATE_TIME, UPD_BY_ID, validation_message, validation_reg_ex) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        bind => [20 parameters bound]
Query: InsertObjectQuery(XXServiceConfigDef [XXDBBase={createTime={Fri Jul 15 19:22:11 UTC 2016} updateTime={Fri Jul 15 19:22:11 UTC 2016} addedByUserId={null} updatedByUserId={null} } id=null, defId=1, name=username, type=string, itemId=1, subType=, isMandatory=true, defaultValue=null, label=Username, validationRegEx=, validationMessage=, uiHint=, description=null, rbKeyLabel=null, rbKeyValidationMessage=null, rbKeyDecription=null, order=0])
[EL Warning]: 2016-07-15 19:22:11.46--UnitOfWork(804661898)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20131113-a7346c6): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
Error Code: 0
Call: INSERT INTO x_service_config_def (ADDED_BY_ID, CREATE_TIME, def_id, default_value, description, is_mandatory, item_id, label, name, sort_order, rb_key_description, rb_key_label, rb_key_validation_message, sub_type, type, ui_hint, UPDATE_TIME, UPD_BY_ID, validation_message, validation_reg_ex) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        bind => [20 parameters bound]
Query: InsertObjectQuery(XXServiceConfigDef [XXDBBase={createTime={Fri Jul 15 19:22:11 UTC 2016} updateTime={Fri Jul 15 19:22:11 UTC 2016} addedByUserId={null} updatedByUserId={null} } id=null, defId=1, name=username, type=string, itemId=1, subType=, isMandatory=true, defaultValue=null, label=Username, validationRegEx=, validationMessage=, uiHint=, description=null, rbKeyLabel=null, rbKeyValidationMessage=null, rbKeyDecription=null, order=0])
[EL Warning]: 2016-07-15 19:22:11.471--UnitOfWork(804661898)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20131113-a7346c6): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
Error Code: 0
Don't have an account?
Coming from Hortonworks? Activate your account here