Skip to Content

Error: No Audit log configuration provided

Hello,

We have xsjs application deployed in CF. After upgrading XSJS version to 4.0.1, I am getting an error saying that “No Audit log configuration provided.”. How can I add Audit log configuration to the application?

Application : XSJS application

Platform: Cloud Foundry

Complete error details are below.

ERR /home/vcap/deps/0/node_modules/@sap/xsjs/lib/index.js:187
throw new Error(‘No Audit log configuration provided.’);
^
Error: No Audit log configuration provided.
at checkOptions (/home/vcap/deps/0/node_modules/@sap/xsjs/lib/index.js:187:11)
at module.exports (/home/vcap/deps/0/node_modules/@sap/xsjs/lib/index.js:28:3)
at Object.<anonymous> (/home/vcap/app/start.js:10:11)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)

Thanks for your time,

Dev

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Dec 12, 2018 at 12:39 PM

    The 4.x version of XSJS does make some incompatible changes that require migration/adjustment. It’s perfectly fine to actually stay with the 3.7.0 version of the library in the short term. That’s the last patch release before the major new functionality in the 4.x version.

    This is actually documented in the CHANGELOG.md in the module itself:

    4.0.0 – 2018-10-04

    Changed

    • Providing auditLog options is now mandatory.
    • Underlying database driver is now @sap/hana-client.
    • Due to the changed driver, precision and scale in metadata may differ for some data types (e.g. REAL, FLOAT, DOUBLE, BLOB).
    • $.db.ResultSetMetaData.getCatalogName now throws an exception instead of returning a value.
    • $.db.ResultSetMetaData.getColumnDisplaySize now throws an exception instead of returning a value.
    • String representations of SECONDDATE and TIMESTAMP are in a different format (without ‘T’). The format now is: YYYY-MM-DD HH24:MI:SS.FF, the format in previous versions was: YYYY-MM-DDTHH24:MI:SS.FF.
    • $.hdb, calling stored procedures with input table parameters: since default data type conversions are not performed over input table parameters, and since @sap/hana-client is more restrictive on values provided for DATE and TIME types compared to the hdb driver, scenarios with input table parameters and table content provided as an array of objects will now throw if the input table parameter has DATE or TIME columns and the values are provided as Date objects.
    • $.db.ResultSet.close does not close the result set. All results will be closed when the corresponding statement is closed.

    If you do want to convert to the 4.x version, you might have a look at the source code of the upcoming openSAP course. We use the 4.x version in that course.

    You will need an audit log resource in your mta.yaml:

    https://github.com/SAP/hana-xsa-opensap-hana7/blob/master/mta.yaml#L135

    And it needs to be added as a requirement of your xsjs service:

    https://github.com/SAP/hana-xsa-opensap-hana7/blob/master/mta.yaml#L101

    And finally you have to adjust the generated bootstrap code of your server.js in the xsjs module to load the configuration for the audit log server:

    https://github.com/SAP/hana-xsa-opensap-hana7/blob/master/xsjs/server.js#L27

    Add comment
    10|10000 characters needed characters exceeded

    • @Thomas Jung

      Hi Thomas,

      We have upgraded our xsjs application from 3.4.0 to 4.0.1 version. (We want to be in 4.x version only)

      After this update, all our query execution is getting failed with the error "Error: {"code":257,"message":"sql syntax error: invalid SQL type","sqlState":"HY000"}".

      The same queries were executing fine before the upgrade. FYI we are not running any stored procedures here.

      We execute queries with prepareStatement(query).executeQuery() function.

      I have put one sample query below which was running fine before the upgrade. But now throwing an error. I don't see any syntax error in that.

      SELECT TOP 25 "sWidth" AS "S_WIDTH", "sHeight" AS "S_HEIGHT", COUNT(DISTINCT("visUUID")) AS "VISS" FROM "com.sap.abc::scontext.WE_EV_TABLE" WHERE "type" = 'load' AND ( ("id" = 'c1b21213-8a54-7449-89e0-f76efb8c25dc') OR ("id" = 'fc94fb83-3ef6-194f-b959-c01397f4f20c') OR ("id" = 'a2f26180-76ce-ed6a-2d28-3bd394983c74' AND "subId" IN ('EmptyData1001')) OR ("id" = '0fe6f4a2-cc82-2a47-8e6a-b634687544bd') OR ("id" = '1da7bd0a-c515-cfd6-2062-627601c17707') OR ("id" = 'ec9e12bb-7ce1-2ddb-5537-19c47f4c1c35' AND "subId" IN ('123456789', 'NODATA_1001', '2ndSubsite_data')) OR ("id" = '20c2da46-f712-e6f3-d5a2-136aa76aab322323' AND "subId" IN ('NoData_1001')) OR ("id" = 'cc3540f7-ff1f-35b1-5fdd-0c21061d3b01') OR ("id" = 'cd567afa-95d6-c64c-9075-fdefc84a23d3') OR ("id" = '3ef3b1e2-f7a5-3e4b-8575-31dba7e63b0e' AND "subId" IN ('cart20001', 'SW1001'))) AND "created" BETWEEN '2018-12-20 00:00:00.000' AND '2018-12-26 23:59:59.999' GROUP BY "sWidth", "sHeight" ORDER BY "VISS" DESC, "sWidth" ASC

      before the upgrade, we were using the date format of 2018-12-20T00:00:00.000. But both the formats are not working now.

      Any suggestions here on what needs to be checked as part of the xsjs update??

      Thanks,

      Dev