cap-js / sdm

CAP Plugin for SAP Document Management service
Apache License 2.0
12 stars 2 forks source link

Error: Can't execute query as no primary database is connected. #59

Closed horsemanjackyliu closed 2 months ago

horsemanjackyliu commented 3 months ago

Just follow the github readme .

Try run the projectwith the following command

npm install cf login cds bind -2 sdmServiceInctance:serviceKey cdw watch --profile hybrid

[odata] - POST /odata/v4/processor/$batch [odata] - > CREATE /Incidents(ID=3583f982-d7df-4aad-ab26-301d4a157cd7,IsActiveEntity=true)/ProcessorService.draftEdit { '$select': 'HasActiveEntity,HasDraftEntity,ID,IsActiveEntity,customer_ID,status_code,title,urgency_code', '$expand': 'DraftAdministrativeData($select=DraftIsCreatedByMe,DraftUUID,InProcessByUser),customer($select=ID,name),status($select=code,criticality,descr),urgency($select=code,descr)' } [cds] - Error: Can't execute query as no primary database is connected. at get then [as then] (/Users/username/projects/incidents-app/node_modules/@cap-js/sdm/node_modules/@sap/cds/lib/ql/Query.js:38:50) at ProcessorService.onEdit (/Users/username/projects/incidents-app/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js:1503:54) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async next (/Users/username/projects/incidents-app/node_modules/@sap/cds/lib/srv/srv-dispatch.js:69:17) at async ProcessorService.handle (/Users/username/projects/incidents-app/node_modules/@sap/cds/lib/srv/srv-dispatch.js:67:10) at async ProcessorService.handle (/Users/username/projects/incidents-app/node_modules/@sap/cds/libx/_runtime/common/Service.js:84:16) [error] - 500 > { code: '500', message: "Can't execute query as no primary database is connected." }

image
yashmeet29 commented 3 months ago

Hi @horsemanjackyliu, try executing cds deploy before running cds watch --profile hybrid. Also please ensure that cds.requires section of your package.json has below section "db": { "kind": "sqlite", "credentials": { "url": "db.sqlite" } }

horsemanjackyliu commented 3 months ago

Hi, Action as your suggestion. But not work and the issue keeps the same .

image image
horsemanjackyliu commented 3 months ago

It seems CAP want to persist the attachment into DB instead of to SDM .

yashmeet29 commented 3 months ago

Which github readme you are following? Can you share the link?

horsemanjackyliu commented 3 months ago

https://github.com/cap-js/sdm/blob/develop/README.md

horsemanjackyliu commented 3 months ago

And run the following additional command: Try run the projectwith the following command

npm install cf login cds bind -2 sdmServiceInctance:serviceKey cdw watch --profile hybrid

yashmeet29 commented 3 months ago

Steps mentioned in README are for testing on cloud. Can you please deploy your CAP application on cloud by following the readme and try there.

yashmeet29 commented 3 months ago

Hi @horsemanjackyliu, any update on this? Are you able to deploy and test the CAP application on cloud? If yes, can we close this issue?

yashmeet29 commented 2 months ago

Closing this issue as there is no any response since last two weeks. @horsemanjackyliu please create a new issue in case you still need any assistance.

Regards, Yashmeet