SAP-samples / hana-developer-cli-tool-example

Learn how to build a developer-centric SAP HANA command line tool, particularly designed to be used when performing SAP HANA development in non-SAP tooling (for example from VS Code).
Apache License 2.0
90 stars 24 forks source link

cds deploy --to hana TypeError: Cannot read properties of undefined (reading 'options') #121

Closed rgadirov closed 3 months ago

rgadirov commented 3 months ago

Hi Thomas,

lately, we are getting issues when running "cds deploy --to hana". FYI - we don´t yet use the latest cds version (8) yet. Does this currently have a side effect? What might be the issue?

Info CDS Version: cds -v @cap-js/cds-types: 0.2.0 @sap/cds: 6.8.4 @sap/cds-compiler: 3.9.12 @sap/cds-dk: 7.9.6 @sap/cds-dk (global): 7.9.6 @sap/cds-fiori: 1.2.7 @sap/cds-foss: 5.0.1 @sap/cds-hana: 2.0.0 @sap/cds-mtxs: 1.18.3 @sap/cds-odata-v2-adapter-proxy: 1.9.21 @sap/eslint-plugin-cds: 3.0.4 Node.js: v20.12.0 cvapp-launchpad: 1.0.0

=>"hana-cli": "^3.202405.1",

Running build building project [/home/user/projects/cvapp], clean [true] cds-dk [7.9.6], cds [6.8.4], compiler [3.9.12], home [/home/user/projects/cvapp/node_modules/@sap/cds]

/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/provider/internalBuildTaskProvider.js:311 const ws = hasOptionValue(task.options?.[CONTENT_WS], true) || cds.cli.options?.ws

TypeError: Cannot read properties of undefined (reading 'options') at InternalBuildTaskProvider._setDefaultModel (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/provider/internalBuildTaskProvider.js:311:80) at InternalBuildTaskProvider.applyTaskDefaults (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/provider/internalBuildTaskProvider.js:40:41) at /managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/buildTaskProviderFactory.js:154:55 at Array.map () at BuildTaskProviderFactory._applyTaskDefaults (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/buildTaskProviderFactory.js:154:34) at /managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/buildTaskProviderFactory.js:50:25 at Array.map () at BuildTaskProviderFactory.applyTaskDefaults (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/buildTaskProviderFactory.js:42:34) at BuildTaskFactory._createTasks (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/buildTaskFactory.js:62:40) at BuildTaskFactory.getTasks (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@7.9.6/node_modules/@sap/cds-dk/lib/build/buildTaskFactory.js:26:34)

Thank you in advance.

Best regards Rufat

jung-thomas commented 3 months ago

So you are getting this error when running cds deploy? If so I'm confused why you are asking here. cds deploy isn't part of the hana-cli, it's the cds development kit. Please help me understand the touch point here with hana-cli.

rgadirov commented 3 months ago

It happens during deployment to SAP HANA Cloud via cds deploy --to hana, since hana-cli connects to a remote HANA instance and I thought that the issue is linked also to hana-cli tool as interface. But yes, you are right, it is cds dk related issue.

jung-thomas commented 3 months ago

hana-cli doesn't have any role to play here. The command in question is self-contained within the @sap/cds-dk. I think you need to enter a support ticket for the SAP Cloud Application Programming Model for that.

rgadirov commented 3 months ago

Yes, thank you.

rgadirov commented 3 months ago

@jung-thomas So, I found out that the issue is that the script in package.json is no longer runnable somehow. Only "cds deploy" works. I remember that I got this issue in the past as well. Hence, it is script execution related....

"scripts": { "hana": "cds deploy --to hana:cv_multienv_db --auto-undeploy",