IssueRaiser

Error: Failed to convert rust `String` into napi `string`

### Latest reproduction > Still failing in version 6.0.1 I updated the test repo https://github.com/Quesstor/prisma-error ### Bug Description When querying large amounts of data (approximately 500MB or more), the following error occurs: ``` Error: Failed to convert rust `String` into napi `string` at RequestHandler.request (/app/node_modules/@prisma/client/runtime/index.js:49022:15) at async /app/build/services/data.service.js:8:20 at async PrismaClient._request (/app/node_modules/@prisma/client/runtime/index.js:49919:18) at async getData (/app/build/services/data.service.js:16:25) at async basicStatisticsController (/app/build/controllers/statistics/index.js:16:48) ``` This issue appears to be related to a memory limitation or possible memory leak in the Prisma client when handling large datasets. ### How to Reproduce The error occurs when querying data that is large in size, typically around 500MB or more. It has been observed that the error can be triggered with as few as 1,066 rows if the rows contain very large string properties (>500KB). Example queries that can trigger this issue: ```typescript await prisma.table.findMany({ where: { dateTime: { gte: date.start, lte: date.end, }, }, }); // Or using raw SQL: await prisma.$queryRaw` SELECT * FROM "Table" WHERE "dateTime" BETWEEN ${date.start} AND ${date.end} `; ``` ### Expected Behavior The query should complete successfully, regardless of the size of the result set. ### Env

Posted by sxnney on Jun 17, 2022, 8:04 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

github (SaaS)

Error: Failed to convert rust `String` into napi `string`

sxnneyJun 17, 2022, 8:04 AM

### Latest reproduction > Still failing in version 6.0.1 I updated the test repo https://github.com/Quesstor/prisma-error ### Bug Description When querying large amounts of data (approximately 500MB or more), the following error occurs: ``` Error: Failed to convert rust `String` into napi `string` at RequestHandler.request (/app/node_modules/@prisma/client/runtime/index.js:49022:15) at async /app/build/services/data.service.js:8:20 at async PrismaClient._request (/app/node_modules/@prisma/client/runtime/index.js:49919:18) at async getData (/app/build/services/data.service.js:16:25) at async basicStatisticsController (/app/build/controllers/statistics/index.js:16:48) ``` This issue appears to be related to a memory limitation or possible memory leak in the Prisma client when handling large datasets. ### How to Reproduce The error occurs when querying data that is large in size, typically around 500MB or more. It has been observed that the error can be triggered with as few as 1,066 rows if the rows contain very large string properties (>500KB). Example queries that can trigger this issue: ```typescript await prisma.table.findMany({ where: { dateTime: { gte: date.start, lte: date.end, }, }, }); // Or using raw SQL: await prisma.$queryRaw` SELECT * FROM "Table" WHERE "dateTime" BETWEEN ${date.start} AND ${date.end} `; ``` ### Expected Behavior The query should complete successfully, regardless of the size of the result set. ### Env

Comments (0)

No comments yet. Start the discussion.

Comment on this issue