sapmentors / sitregcapm

SITreg implemented in the SAP Cloud Application Programming Model
Apache License 2.0
12 stars 13 forks source link

no such table error after upgrade to 3.5.2 #17

Closed gregorwolf closed 5 years ago

gregorwolf commented 5 years ago

I've just run an npm install and also npm i -g @sap/cds to get me to the latest cds version. Running cds --version returns:

@sap/cds: 3.5.2 @sap/cds-compiler: 1.8.1 @sap/cds-ql: 1.5.1 @sap/cds-hana: 1.5.1 @sap/cds-sql: 1.5.1 @sap/cds-sqlite: 1.5.1 @sap/cds-reflect: 2.3.0 @sap/cds-services: 1.5.2 @sap/odata-server: 1.0.0 @sap/odata-commons: 1.0.0 @sap/generator-cds: 2.3.9

But when I now run a cds deploy and cds run I can all service endpoints except this two:

http://localhost:4004/organizer/EventTypes http://localhost:4004/organizer/RelationsToSAP

For both the error

<error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
<code>500</code>
<message>Internal Server Error</message>
</error>

is returned. In the console I see:

[2019-03-29T06:23:22.331Z | ERROR | 1232631]: An error occurred: SQLITE_ERROR: no such table: OrganizerService_EventTypes [2019-03-29T06:28:23.944Z | ERROR | 1348642]: An error occurred: SQLITE_ERROR: no such table: OrganizerService_RelationsToSAP

When I look into the sqlite database I see that the view wasn't created as OrganizerService_RelationsToSAP but as OrganizerService_com_sap_sapmentors_sitregcapm_EventTypes:

Screenshot 2019-03-29 at 07 23 17

I would think that must be an issue with the sap.common.CodeList that is used for the entity EventTypes. Because the entity Organizers which just inherits from managed works fine and returns data at http://localhost:4004/organizer/Organizers.

David-Kunz commented 5 years ago

Hi Gregor,

Thanks a lot for this detailed analysis. We could reproduce this error and can confirm that the view is not correctly created.

We will fix this problem.

As a temporary workaround you can try to remove the annotation @cds.peristence.skip: 'if-unused' for the abstract entity CodeList cds-commons.

Best regards David

gregorwolf commented 5 years ago

I've used a local definition for CodeList before. I've removed that in f0ceedfbb9c9b84f8e9954ed1c8cbe628559dbec

SamuelBrucksch commented 5 years ago

Hi Gregor,

this issue has now been fixed and will be available in the next release of CDS. Thanks for the detailed analysis.

Kind regards

Samuel

gregorwolf commented 5 years ago

Hi @SamuelBrucksch thank you for the response. Can you provide a version number of CDS which contains the fix?

SamuelBrucksch commented 5 years ago

Hi Gregor,

we will notify you when the new version is available.

Kind regards

Samuel

i-pip commented 5 years ago

Hi Gregor,

we will notify you when the new version is available.

Kind regards

Samuel

Hi Samuel,

This issue is back in @sap/cds: 3.20.1

gregorwolf commented 5 years ago

Hi @i-pip ,

I've just tried in my local installation and all endpoints work fine for me. Now even mixing anonymous access and authenticated access works.

If your error persists please provide more details.

Best regards Gregor

silasd23 commented 3 years ago

I'm having the same problem here ! image

image

follow my package Json:

image

Do we have a solution to this already ?

The problem occours when I deploy the app using sqlite3

silasd23 commented 3 years ago

I'm having the same problem here ! image

image

follow my package Json:

image

Do we have a solution to this already ?

The problem occours when I deploy the app using sqlite3

The problem was only solved when I puted this in the package.json in the start script image