Skip to Content
0
Jul 21, 2023 at 11:17 AM

Error in CAP with image in data model and persisten sqlite database

80 Views

For CAP working on BAS I created a data model with a field "image" with annotation "@Core.MediaType: 'image/png'" in one entity. On top is a FIORI Elements app. Data is provided via csv file and field image is left empty.

When using the sqlite in memory option in the development environment everything is fine.

The image is tried to be loaded by the FIORI app via

GET /maint-articles/Articles(ID=017b04c0-7f5c-420e-85d1-77f7f8a6e614,IsActiveEntity=true)/image?xcache=16899376

No problem that there is no content for the image in this case.

But when i use the sqlite persisten db option with

cds deploy --to sqlite:db/my-bookshop.db

I get an error on the CAP (node.js) server when the FIORI Elements app tries to load the image.

Process exited with code 7

Uncaught RangeError RangeError: Maximum call stack size exceeded

at onStream (/home/user/projects/mm-srm-catmaint/node_modules/@cap-js/sqlite/lib/db/sqlite/SQLiteService.js:145:17)

Any ideas why this is handled different depending on using sqlite in memory vs. persistent?

How can I avoid this error? Don't know hot this would look like after deployment.

In general it should be possible to leave an image field with "@Core.MediaType: 'image/png'" empty in the database.