-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Stuck on [parsing]... no errors, just totally hangs on certain files... how to #6900
Comments
To debug, run rector against just that file and slowly remove portions of the file until rector passes successfully, that should help to narrow down the issue. As for skipping paths you can check out https://github.com/rectorphp/rector/blob/main/docs/how_to_ignore_rule_or_paths.md. |
Thank for reporting. This might be many causes. Could you share minimal reproducible repository? |
I upgraded to latest version now, 0.12.10, and I am now working on narrowing down the problem by removing parts of the code of the file. I will post my findings as soon as I have isolated the problem. |
Well, I have narrowed down the code to this example. This is useless PHP in itself, but atleast the parsing hangs which is my problem. The contents of file is: class swThreads } |
Amazing work, thanks! Could you put it to demo link? https://getrector.org/demo |
It seems got error timeout when paste in getrector.org/demo https://getrector.org/demo/1ec6a582-9588-6b4c-b085-7788681f5100 |
It seems make hang even without any service registered https://getrector.org/demo/1ec6a5a2-5cbe-63d2-84d7-c57f440713df |
The hang seems on the |
I created issue on phpstan repository phpstan/phpstan#6265 |
Thank you, I would guess this has to be the problem yes. Luckily I have avoided such code in later years, this is from the days before i grasped recursive programming good enough. Hopefully this is ironed out from phpstan in future releases. Only goes to show that this code definately needs refactoring :D I will have to do this one manually :D |
Ok, I am closing it then as we rely on internal phpstan for this. |
Resolved at PHPStan side phpstan/phpstan#6265 |
Bug Report
I am having problems when trying to debug where the problem is when Rector is hanging (crashing) on certain files in the projects I am trying to process. I have run ECS on all the files first as a quick fix to atleast make sure the files are up to date in some way, but when running rector with the --debug option I see that it stops on PARSING of some files.
That being said I know that the file in question right now has alot of if statements, so I could rewrite it no problem then again the point of rector I guess was to not do that.
I guess my question is:
Minimal PHP Code Causing Issue
Rector could not run due to error: The process "'../vendor/bin/rector' 'process' '/var/www/getrector.org/var/demo/7ltw11fmm2z5c0yladmr/rector_analyzed_file.php' '--config' '/var/www/getrector.org/var/demo/7ltw11fmm2z5c0yladmr/rector.php' '--output-format' 'json'" exceeded the timeout of 60 seconds.
The text was updated successfully, but these errors were encountered: