SAP CDS Endpoint Erroring Out When Receiving An OData Create (PUT) Request

52 views Asked by At

When I post to my sap cds OData endpoint, I get an error (see below). The actual http return is a 'Connection Refused', status code 0. The indication of the error is an emission to stdout where cds is listening. After logging the error, cds 'shuts down' and stops listening. Any help as far as what the error is or my avenues for getting more information about it, would be appreciated. While researching it, these additional questions have come up

-- I don't think it's occurring 'at the database level'. One indication of this is that when I use pgAdmin against the database to do query execution tracing, it never shows a query being run. Also, it seems like a javascript error. (The error mentions postgre, but it seems like maybe the tooling/adapter i.e. 'PostgreService')

-- I believe that if it were a matter of a 'bad request', that the cds framework wouldn't just stop but would return the appropriate http response (like a 403 or something).

-- Some of my research also indicates that CDS at least tries to 'gracefully handle' internal errors and return a 500 before shutting down due to CDS's 'Let It Crash' philosophy. So I'm not sure exactly what's happening regarding it just shutting down, but it could (maybe?) have to do with the error occurring in say the postgre adapter.

-- Finally, if anyone can shed light on the cause, etc. of the error - based on the info below - I'd appreciate it

---------ERROR DETAILS (EMITTED TO THE CONSOLE)

[cds] - TypeError: Cannot convert undefined or null to object at Function.keys () at _getKeysOfEntity (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@sap/cds/libx/_runtime/cds-services/services/utils/compareJson.js:22:10) at compareJsonDeep (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@sap/cds/libx/_runtime/cds-services/services/utils/compareJson.js:195:16) at compareJson (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@sap/cds/libx/_runtime/cds-services/services/utils/compareJson.js:265:18) at getDeepQueries (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@cap-js/db-service/lib/deep-queries.js:187:14) at PostgresService.onDeep (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@cap-js/db-service/lib/deep-queries.js:33:19) at next (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@sap/cds/lib/srv/srv-dispatch.js:79:36) at PostgresService.fill_in_keys (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@cap-js/db-service/lib/fill-in-keys.js:75:10) at next (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@sap/cds/lib/srv/srv-dispatch.js:79:36) at PostgresService.handle (/Users/sladestewart/projects/work/grc_forms/grc_eforms_backend_prototype/node_modules/@sap/cds/lib/srv/srv-dispatch.js:83:6) { id: '1049714', level: 'ERROR', timestamp: 1697639278350

Thanks!

I'm running a SAP CDS project locally. In the first instance where my SAP UI5 front end issues an 'OData Create' (PUT) request to it, it fails in the way described above.

0

There are 0 answers