cancel
Showing results for 
Search instead for 
Did you mean: 

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

jens_borau
Explorer
0 Kudos

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.

mariya_yordanova
Explorer
0 Kudos

Hi jens.borau ,

Could you please provide an example (preferably with bookshop) to reproduce the issue?

Best Regards

Maria

jens_borau
Explorer
0 Kudos

Helllo mariya.yordanova02,

thanks for your reply.

I tried to create an example with the bookshop but unfortunately everything is working fine with it.

There is also an image (LargeBinary @Core.MediaType : 'image/png') in the model in the Books entity and I set an FIORI app on top. No errors when using sqlite in memory and also no errors when using sqlite persistent.

In my app the FIORI app with the image shown on the object page works fine when using sqlite with in memory option but the FIORI app crashes when using the persistent option.

I compared the the two apps but could'nt find any significant difference until now.

Best regards,

Jens Borau

jens_borau
Explorer
0 Kudos

Update of @cap-js/sqlite to 1.0.1 solved the problem

Accepted Solutions (0)

Answers (0)