Rector: Online Demo no longer works: proc_open() has been disabled
Created on 20 Oct 2020
ยท
10Comments
ยท
Source: rectorphp/rector
Bug Report
| Subject | Details |
| :------------- | :---------------------------------------------------------------|
| Rector version | Unknown - using the online demo |
| Installed as | Unknown - using the online demo |
I tried to use the online demo but after clicking "Process!" and waiting for a short time, the following warning is displayed as a result:
Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162 Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162 In Filesystem.php line 100: Failed to create "": mkdir(): Invalid path process [-n|--dry-run] [-a|--autoload-file AUTOLOAD-FILE] [--match-git-diff] [--only ONLY] [-o|--output-format [OUTPUT-FORMAT]] [--no-progress-bar] [--output-file OUTPUT-FILE] [--cache-debug] [--clear-cache] [--] [...]
The proc_open() is "only" warning, it is security notice and it should be strip from the error message (it is another issue ๐).
So far i have found out that something changed and while not providint --output-file in combination with --output-format it no longer works in the demo:
Json output without --output-file
root@00c2f5084b51:/project# rector process /project/rector_analyzed_file.php \
> --autoload-file /project/rector_analyzed_file.php \
> --output-format json \
> --config /project/rector.php
Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162
Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162
In Filesystem.php line 100:
Failed to create "": mkdir(): Invalid path
process [-n|--dry-run] [-a|--autoload-file AUTOLOAD-FILE] [--match-git-diff] [--only ONLY] [-o|--output-format [OUTPUT-FORMAT]] [--no-progress-bar] [--output-file OUTPUT-FILE] [--cache-debug] [--clear-cache] [--] [<source>...]
Default output, works well:
root@00c2f5084b51:/project# rector process /project/rector_analyzed_file.php --autoload-file /project/rector_analyzed_file.php --config /project/rector.php
Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162
Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162
Rector dev-master@5bb03f2
Config file: rector.php
4/4 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100%
[OK] Rector is done!
Json output with --output-file, is okay:
root@00c2f5084b51:/project# rector process /project/rector_analyzed_file.php --autoload-file /project/rector_analyzed_file.php --output-format json --output-file output.json --config /project/rector.php
Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162
Warning: proc_open() has been disabled for security reasons in /rector/vendor/symfony/console/Terminal.php on line 162
root@00c2f5084b51:/project#
Working on a fix now
@TomasVotruba Seems like not related to docker at all, it is failing even locally, looks like the --output-format json option is bugged:
โฏ /Users/janmikes/Sites/rector/bin/rector process rector_analyzed_file.php \
--autoload-file rector_analyzed_file.php \
--output-format json \
--config rector.php
In Filesystem.php line 100:
Failed to create "": mkdir(): Invalid path
process [-n|--dry-run] [-a|--autoload-file AUTOLOAD-FILE] [--match-git-diff] [--only ONLY] [-o|--output-format [OUTPUT-FORMAT]] [--no-progress-bar] [--output-file OUTPUT-FILE] [--cache-debug] [--clear-cache] [--] [<source>...]
--debug
File "/Users/janmikes/Sites/rector/bin/../vendor/autoload.php" is about to be loaded in "AutoloadIncluder::includeDependencyOrRepositoryVendorAutoloadIfExists()" on line 115"
File "rector_analyzed_file.php" is about to be loaded in "AutoloadIncluder::autoloadFromCommandLine"
File "/Users/janmikes/Sites/rector/bin/../vendor/autoload.php" is about to be loaded in "AutoloadIncluder::includeDependencyOrRepositoryVendorAutoloadIfExists()" on line 115"
File "rector_analyzed_file.php" is about to be loaded in "AutoloadIncluder::autoloadFromCommandLine"
[parsing] rector_analyzed_file.php
[refactoring] rector_analyzed_file.php
[applying] Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector
[applying] Rector\DeadCode\Rector\Class_\RemoveUnusedDoctrineEntityMethodAndPropertyRector
[applying] Rector\Utils\DoctrineAnnotationParserSyncer\Rector\ClassMethod\ChangeOriginalTypeToCustomRector
[applying] Rector\Utils\DoctrineAnnotationParserSyncer\Rector\ClassMethod\LogIdentifierAndResolverValueInConstantClassMethodRector
[applying] Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector
[applying] Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector
[applying] Rector\DeadCode\Rector\FunctionLike\RemoveOverriddenValuesRector
[applying] Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector
[applying] Rector\DeadCode\Rector\FunctionLike\RemoveCodeAfterReturnRector
[applying] Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRector
[applying] Rector\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector
[applying] Rector\DeadCode\Rector\ClassMethod\RemoveDelegatingParentCallRector
[applying] Rector\PHPUnit\Rector\ClassMethod\RemoveEmptyTestMethodRector
[applying] Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector
[applying] Rector\DeadCode\Rector\ClassMethod\RemoveDeadRecursiveClassMethodRector
[applying] Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector
[post rectors] rector_analyzed_file.php
[printing] rector_analyzed_file.php
PHP Fatal error: Uncaught Symfony\Component\Filesystem\Exception\IOException: Failed to create "": mkdir(): Invalid path in /Users/janmikes/Sites/rector/vendor/symfony/filesystem/Filesystem.php:100
Stack trace:
4 /Users/janmikes/Sites/rector/src/Console/Command/AbstractCommand.php(44): Sym in /Users/janmikes/Sites/rector/vendor/symfony/filesystem/Filesystem.php on line 100
Fatal error: Uncaught Symfony\Component\Filesystem\Exception\IOException: Failed to create "": mkdir(): Invalid path in /Users/janmikes/Sites/rector/vendor/symfony/filesystem/Filesystem.php:100
Stack trace:
4 /Users/janmikes/Sites/rector/src/Console/Command/AbstractCommand.php(44): Sym in /Users/janmikes/Sites/rector/vendor/symfony/filesystem/Filesystem.php on line 100
Most helpful comment
I can confirm demo is working again.