Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Invalid string length #672

Open
sangwoo-joh opened this issue Apr 15, 2024 · 2 comments
Open

RangeError: Invalid string length #672

sangwoo-joh opened this issue Apr 15, 2024 · 2 comments

Comments

@sangwoo-joh
Copy link
Contributor

I have a bunch of tests (4,500+) and Python bespoke asserts scripts.
When I run npx promptfoo eval -j16, it runs all jobs in parallel, but after they have finished, I got the following error:

/home/sangwoo-joh/type/work/promptfoo/node_modules/drizzle-orm/sqlite-core/columns/text.cjs:75
    return JSON.stringify(value);
                ^

RangeError: Invalid string length
    at JSON.stringify (<anonymous>)
    at SQLiteTextJson.mapToDriverValue (/home/sangwoo-joh/type/work/promptfoo/node_modules/drizzle-orm/sqlite-core/columns/text.cjs:75:17)
    at /home/sangwoo-joh/type/work/promptfoo/node_modules/drizzle-orm/sql/sql.cjs:157:73
    at Array.map (<anonymous>)
    at SQL.buildQueryFromSourceParams (/home/sangwoo-joh/type/work/promptfoo/node_modules/drizzle-orm/sql/sql.cjs:110:32)
    at /home/sangwoo-joh/type/work/promptfoo/node_modules/drizzle-orm/sql/sql.cjs:129:21
    at Array.map (<anonymous>)
    at SQL.buildQueryFromSourceParams (/home/sangwoo-joh/type/work/promptfoo/node_modules/drizzle-orm/sql/sql.cjs:110:32)
    at /home/sangwoo-joh/type/work/promptfoo/node_modules/drizzle-orm/sql/sql.cjs:132:21
    at Array.map (<anonymous>)

Node.js v19.9.0
  • Ran on 16GB RAM, 16GB Swap, 8 Core Machine
  • Node 19.9.0
@sangwoo-joh
Copy link
Contributor Author

Hmm... I reduced the number of tests to about 1k and it works fine, which seems like this error occurs when we have too many tests.

@typpo
Copy link
Collaborator

typpo commented Apr 15, 2024

Looks like we'd have to do something like this: https://stackoverflow.com/questions/29175877/json-stringify-throws-rangeerror-invalid-string-length-for-huge-objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants