cakephp / upgrade

Upgrade tools for CakePHP meant to facilitate migrating from one version of the framework to another
MIT License
110 stars 60 forks source link

Process "xxxxx" not found #267

Open dan-comentis opened 8 months ago

dan-comentis commented 8 months ago

Hi - I am trying to upgrade from CakePHP 4.4 to 5, however as I'm running the migration code I get the following:

➜  upgrade git:(5.x) bin/cake upgrade rector --rules cakephp50 <path>/app/src
  56/131 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  42%
In ProcessPool.php line 31:

  Process "z5zo7cwtj3" not found.

process [-n|--dry-run] [-a|--autoload-file AUTOLOAD-FILE] [--no-progress-bar] [--no-diffs] [--output-format OUTPUT-FORMAT] [--debug] [--memory-limit MEMORY-LIMIT] [--clear-cache] [--port PORT] [--identifier IDENTIFIER] [--] [<source>...]

It doesn't seem to consistently fail at the same place either.

I'm running this on a Macbook M3 Pro

garas commented 8 months ago

It looks like something wrong with subprocess manager in Rector itself.

Run bin/cake upgrade rector with --verbose to get command /path/vendor/bin/rector process .... Then run that Rector command with --debug to get more details from Rector.

dan-comentis commented 8 months ago

Hey @garas - thanks for that, although it hasn't shed much more light on the situation I don't think. I now can see the exception and the full stack trace, but it doesn't give me a lot to go on (with my limited knowledge):

PHP Fatal error:  Uncaught RectorPrefix202311\Symplify\EasyParallel\Exception\ParallelShouldNotHappenException: Process "idnwsqbylf" not found. in /Users/d/work/upgrade/vendor/rector/rector/vendor/symplify/easy-parallel/src/ValueObject/ProcessPool.php:31

I've uploaded the trace here in case thats of any use: trace.txt

garas commented 8 months ago

Report issue to https://github.com/rectorphp/rector. It is problem inside of Rector, they might know better how to debug and fix the problem.

LordSimal commented 8 months ago

I am able to reproduce your problem, but only with "larger" codebases, not smaller plugins.

Looking at your error message it could only be caused by this exception

I am no expert in rector internals but it feels like something is wrong with the parallel file processing logic as it seems to quit a process which doesn't exist any more. Maybe something related to a timeout? 🤔