Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Request When Writing Data Modification To api.auditlog.cf For Entity #128

Open
Keith-Barrett opened this issue Nov 19, 2024 · 1 comment
Labels

Comments

@Keith-Barrett
Copy link

Hello Experts,

We are migrating our Audit Logging from @sap/audit-logging to @cap-js/audit-logging but have encountered some sort of issue we cannot find a solution for.

Some quick background, our Entity initially used an Integer for the Key and it seems that the Cap Audit Logging did not work with the DataSubjectId being an Integer. It does not seem to get passed via the DataSubject { Id: }
property. So we added a UUID to the Entity and the CAP Audit Logging works as expected for any new Entity created after this deployment.

You can read more about that here if needed :
https://sap.stackenterprise.co/questions/62533

We then created a script to update the UUID in all existing entities. So after the successfuly execution of this script, all existing Routes have a UUID. Which we have verified. But when we do any data modification on any existing Route, whereby we added a UUID via the script, we receive the following error :

"msg":"Emit failed {\n event: 'PersonalDataModified',\n cause: Error: Request failed with status 400\n at IncomingMessage.<anonymous> (/home/vcap/app/node_modules/@cap-js/audit-logging/srv/log2restv2.js:162:23)\n at /home/vcap/app/dynatrace/oneagent/agent/bin/1.297.74.20240930-123813/any/nodejs/nodejsagent.js:2267:48\n at t.runInContext (/home/vcap/app/dynatrace/oneagent/agent/bin/1.297.74.20240930-123813/any/nodejs/nodejsagent.js:2378:24)\n at IncomingMessage.<anonymous> (/home/vcap/app/dynatrace/oneagent/agent/bin/1.297.74.20240930-123813/any/nodejs/nodejsagent.js:2267:18)\n at IncomingMessage.emit (node:events:531:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at /home/vcap/app/dynatrace/oneagent/agent/bin/1.297.74.20240930-123813/any/nodejs/nodejsagent.js:2267:48\n at t.runInContext (/home/vcap/app/dynatrace/oneagent/agent/bin/1.297.74.20240930-123813/any/nodejs/nodejsagent.js:2378:24)\n at endReadableNT (/home/vcap/app/dynatrace/oneagent/agent/bin/1.297.74.20240930-123813/any/nodejs/nodejsagent.js:2267:18)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {\n request: {\n method: 'POST',\n url: 'https://api.auditlog.cf.eu10.hana.ondemand.com:8081/audit-log/oauth2/v2/data-modifications',\n headers: [Object],\n body: [Object]\n },\n response: {\n statusCode: 400,\n statusMessage: '',\n headers: [Object],\n body: [Object]\n },\n unrecoverable: true\n }\n}","type":"log"}

But when we do any data modification on any route we create after our changes have been deployed, the audit log does not fail to emit with a 400 and instead we can actually see the audit log event in the audit log service.

Can you provide any guidence here please?

Kind regards,
Keith.

@github-actions github-actions bot added the new label Nov 19, 2024
@Keith-Barrett Keith-Barrett changed the title Bad Request When Writing Data Modification To api.auditlog.cf For Existing Routes Bad Request When Writing Data Modification To api.auditlog.cf For Entity Nov 19, 2024
@sjvans
Copy link
Contributor

sjvans commented Nov 27, 2024

hi @Keith-Barrett

the 400 is a result of data_subject: { id: {}, .... however, integer keys are supported, so there must be a different issue. i'd need steps on how to reproduce...

best,
sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants