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

Error: spawn E2BIG #705

Open
mcollao opened this issue May 6, 2023 · 0 comments
Open

Error: spawn E2BIG #705

mcollao opened this issue May 6, 2023 · 0 comments

Comments

@mcollao
Copy link

mcollao commented May 6, 2023

Hi!

A service running many days begins to log this error.

Error: spawn E2BIG
at ChildProcess.spawn (node:internal/child_process:413:11)
at Object.spawn (node:child_process:700:9)
at PDF.PdfExec [as exec] (/app/node_modules/html-pdf/lib/pdf.js:89:28)
at PDF.PdfToFile [as toFile] (/app/node_modules/html-pdf/lib/pdf.js:85:8)
at Observable._subscribe (/app/node_modules/rxjs/dist/cjs/internal/observable/bindCallbackInternals.js:73:30)
at Observable._trySubscribe (/app/node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
at /app/node_modules/rxjs/dist/cjs/internal/Observable.js:35:31
at Object.errorContext (/app/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9)
at Observable.subscribe (/app/node_modules/rxjs/dist/cjs/internal/Observable.js:26:24)
at AsapAction. (/app/node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js:8:71)
at AsapAction.AsyncAction._execute (/app/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js:76:18)
at AsapAction.AsyncAction.execute (/app/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js:64:26)
at AsapScheduler.flush (/app/node_modules/rxjs/dist/cjs/internal/scheduler/AsapScheduler.js:33:33)
at /app/node_modules/rxjs/dist/cjs/internal/util/Immediate.js:21:74
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)

The line mentioned in log is
var child = childprocess.spawn(this.options.phantomPath, [].concat(this.options.phantomArgs, [this.script]), this.options.childProcessOptions)

In my local environment printed the content of this.options.phantomArgs, which is an array, bigger and bigger in each execution. For example

First execution:
[ '--local-url-access=false' ]

Second execution:
[ '--local-url-access=false', '--local-url-access=false' ]

Third execution:
[
'--local-url-access=false',
'--local-url-access=false',
'--local-url-access=false'
]

and so on until reach the supported max command length, throwing E2BIG exception.

Thanks in advanced.
Marcelo.

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

1 participant