Failed preparing audit log insert: Unexpected error in database interface. Error code -1063. Code: -1063. DB Code: 0
search cancel

Failed preparing audit log insert: Unexpected error in database interface. Error code -1063. Code: -1063. DB Code: 0

book

Article ID: 251304

calendar_today

Updated On:

Products

SITEMINDER CA Single Sign On Secure Proxy Server (SiteMinder) CA Single Sign On Federation (SiteMinder)

Issue/Introduction


After "Enable Enhance Tracing" (1), the Policy Server gets these errors in large numbers:

[9513/140656882214656][Fri Jul 29 2022 20:26:35.367][SmReportsODBCLog.cpp:821][INFO][sm-Server-04550] Failed attempt to insert audit message: Code: -1044. DB Code: 2

[9513/140656882214656][Fri Jul 29 2022 20:33:44.499][SmReportsODBCLog.cpp:696][INFO][sm-Server-04610] Failed attempt to bulk insert audit message: Code: -4007. DB Code: -1

[9513/140656882214656][Mon Aug 01 2022 01:02:11.944][SmReportsODBCLog.cpp:636][ERROR][sm-Server-04560] Failed preparing audit log insert: Unexpected error in database interface. Error code -1063. Code: -1063. DB Code: 0

[19847/140025245669120][Thu Aug 01 2022 10:50:32.469][CSmDbODBC.cpp:1343][INFO][sm-log-00000] Execution time exceeded threshold. (CSmDbConnectionODBC::Connect, 31638, 5000, )

[8721/139950619842304][Thu Aug 04 2022 21:57:42.315][CSmDbSessionManager.cpp:148][INFO][sm-Server-04330] Failing over to 'Audit Logs' data source 'Audit DS'.

[8721/139950334490368][Thu Aug 04 2022 21:57:44.786][CSmDbSessionManager.cpp:156][INFO][sm-Server-04340] Failing back to 'Audit Logs' data source 'Audit DS'.

Possible error in smtracedefault.log:

[09/14/2022][16:11:36.462][16:11:36][165887][140019609143040][][CSmDbODBC.cpp:1834][CSmDbConnectionODBC::DoBulkInsert][][][][][][][][][][][][Enter function CSmDbConnectionODBC::DoBulkInsert][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]

[09/14/2022][16:11:36.462][16:11:36][165887][140019609143040][][CSmDbODBC.cpp:1472][CSmDbConnectionODBC::CheckForError][][][][][][][[CA SSO][ODBC Oracle Wire Protocol driver]Invalid precision value. Error in parameter 25.][][][][][SQL Error.][-1][][][][][][][][][][HY104][][][][][][][][][][][][][][][][][][][][][][][]

[09/14/2022][16:11:36.462][16:11:36][165887][140019609143040][][CSmDbODBC.cpp:1899][CSmDbConnectionODBC::DoBulkInsert][][][][][][][][][][][][Leave function CSmDbConnectionODBC::DoBulkInsert][-1][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]

[09/14/2022][16:11:36.471][16:11:36][165887][140019609143040][][CSmDbODBC.cpp:362][CSmDbConnectionODBC::MapResult][][][][][][][[CA SSO][ODBC Oracle Wire Protocol driver]Invalid precision value. Error in parameter 25.][][][][][ODBC Error: State = HY104 Internal Code = 0 - s - MappedResult:-4007][][][][][][][][][][][-1][][][][][][][][][][][][][][][][][][][][][][][]

[09/14/2022][16:11:36.472][16:11:36][165887][140019609143040][][SmReportsODBCLog.cpp:696][][][][][][][][][][][][][LogMessage:INFO:[sm-Server-04610] Failed attempt to bulk insert audit message: Code: -4007. DB Code: -1][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]

[09/14/2022][16:11:36.472][16:11:36][165887][140019609143040][][CSmDbUtilities.cpp:806][CSmDbMonitoredClass::SetState][][][][][][][][][][][][Connection SiteMinder Logs Data Source: Changing object state 'Dedicated' to state 'Hung'.][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]

 

Environment


ORACLE Database as Audit store.

 

Cause


When "Enable Enhance Tracing" is turned on from sm.registry, Policy Server will start to log the Federation transaction into audit DB.

The parameter 25 is the position for "sm_assertion_destinationurl  VARCHAR2 (4000) NULL", and generally this parameter should be either null or a valid assertion URL value.

During the BulkInsert, if the parameter does not have a default value (in case of a non-Federation transaction), then error could occur.

When manually testing, this error condition was not met, hence no error.

The error condition will happen only when "DoBulkInsert" is triggered. The "DoBulkInsert" is controlled by SQLBulkInsertFlushRowCount and SQLBulkInsertFlushInterval from sm.registry.

When setting "SQLBulkInsertFlushRowCount=  0x5;  REG_DWORD", it will trigger more frequent BulkInsert to simulate the error.

 

Resolution

 

  1. Stop the Policy Server;
  2. In system_odbc.ini file add the below entry under SiteMinder Logs Data Source:

    IgnoreCharLength=1, (2)

    That should look like this:

    Driver=/app/CA/siteminder/odbc/lib/NSora28.so

    [...omitted for brevity...]

    EnableTimestampWithTimeZone=1
    EnableNcharSupport=0
    IgnoreCharLength=1

    Add EnableNcharSupport, as this is required per documentation (3).
  3. Start the Policy Server, ensure there no more DB error;
  4. Test again, and monitor the trace logs, the ODBC traces to verify the result.

 

Additional Information