rector
rector copied to clipboard
Rector fails with: Child process timed out after 120 seconds
Bug Report
Hi!
Subject | Details |
---|---|
0.13.9 | Latest version when issue was observed |
On a random basis my Rector runs end with the following error; also with increased memory; it deals with ~1100 classes.
$ ./vendor/bin/rector process --dry-run --memory-limit=1G
...
[ERROR] Could not process "/app/vendor/rector/rector/vendor/symplify/easy-parallel/src/ValueObject/ParallelProcess.php" file, due to: "Child process timed out after 120 seconds". On line: 103
[ERROR] Could not process some files, due to: "Reached system errors count limit of 50, exiting...".
Especially when used in CI this lead to failed pipelines.
Minimal PHP Code Causing Issue
PHP Code is up-to-date, all Rector rules were applied and the runs mostly pass without the above error.
Expected Behaviour
It should always finish without error.
is increasing timeout seconds help?
$rectorConfig->parallel(240);
or is disable parallel make it working?
$rectorConfig->disableParallel();
I am experiencing the same. I will try the suggestions.
Fixed on my end. Increasing the timeout and adjusting the max number of processes to be aligned with the machine running it:
$rectorConfig->parallel(240, 2);
@rafaelbernard awesome! That's will be worth mentioning it in the documentation, could you try create PR for documenting how to troubleshoot it? You can create PR to
https://github.com/rectorphp/rector-src/tree/main/build/target-repository/docs
Thank you.
Thanks everyone for the feedback. For me it was pretty stable for a while now but now randomly hit again; so sooner or later I'll try the suggestions, thank you!
[ERROR] Could not process "/app/vendor/rector/rector/vendor/symplify/easy-parallel/src/ValueObject/ParallelProcess.php" file, due to: "Child process timed out after 120 seconds". On line: 103
Looking at the error, it looks like you're running on the root directory. That should never happen. Always explicitly state your directories with PHP code, e.g.
vendor/bin/rector process src
If this error repeat, please create a reproducible repository on Github, so we have isolated environment and can tackle this issue directly :slightly_smiling_face:
Thanks
Hi Thomas, Sorry, the example code was incomplete; we are indeed limiting the runs on certain directories and the error occurred from time to time, either locally on a strong machine or during CI with less stronger workers. For now we excluded it from our CI and run the checks from time to time manually and limited scope.