contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
83 stars 33 forks source link

Unknown error on dry-run #788

Closed berecont closed 4 months ago

berecont commented 8 months ago

Situation: Contao 4.13.32, incl. own extension local dev installation with Laragon

By add one new extension I get an Unknown Error on dry-run.

$ C:\laragon\bin\php\php-8.1.8-Win32-vs16-x64\php.EXE -q -dmax_execution_time=0 -dmemory_limit=-1 -ddisplay_errors=0 -ddisplay_startup_errors=0 -derror_reporting=0 -dallow_url_fopen=1 -ddisable_functions= -ddate.timezone=UTC C:/laragon/www/dev413/public/contao-manager.phar.php composer require hofff/contao-calendarfield --no-update --no-scripts --prefer-stable --sort-packages --no-ansi --no-interaction

Using version ^4.0 for hofff/contao-calendarfield
C:\laragon\www\dev413\composer.json has been updated

# Process terminated with exit code 0
# Result: OK

$ C:\laragon\bin\php\php-8.1.8-Win32-vs16-x64\php.EXE -q -dmax_execution_time=0 -dmemory_limit=-1 -ddisplay_errors=0 -ddisplay_startup_errors=0 -derror_reporting=0 -dallow_url_fopen=1 -ddisable_functions= -ddate.timezone=UTC C:/laragon/www/dev413/public/contao-manager.phar.php composer update --with-dependencies --no-install --no-scripts --no-dev --no-progress --no-ansi --no-interaction --optimize-autoloader --dry-run

Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
  - Locking hofff/contao-calendarfield (4.0.1)
  - Locking menatwork/contao-multicolumnwizard-bundle (3.6.2)
Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
108 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

# Process terminated with exit code 0
# Result: OK

$ C:\laragon\bin\php\php-8.1.8-Win32-vs16-x64\php.EXE -q -dmax_execution_time=0 -dmemory_limit=-1 -ddisplay_errors=0 -ddisplay_startup_errors=0 -derror_reporting=0 -dallow_url_fopen=1 -ddisable_functions= -ddate.timezone=UTC C:/laragon/www/dev413/public/contao-manager.phar.php composer install --no-dev --no-progress --no-ansi --no-interaction --optimize-autoloader --dry-run

Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update `.
- Required package "hofff/contao-calendarfield" is not present in the lock file.
This usually happens when composer files are incorrectly merged or the composer.json file is manually edited.
Read more about correctly resolving merge conflicts https://getcomposer.org/doc/articles/resolving-merge-conflicts.md
and prefer using the "require" command over editing the composer.json file directly https://getcomposer.org/doc/03-cli.md#require-r

# Process terminated with exit code 4
# Result: Unknown error

Installing the new extention without 'dry-run' ... there's no error. note on contao-forum

aschempp commented 7 months ago

Can this be reproduced with other packages? And does it only happen for Laragon?

fritzmg commented 7 months ago

Presumably this happens with any package (see also here for example). The Contao Manager must not run a composer install after a --dry-run as it would have no effect (on the contrary: it would unnecessarily and inadvertently run the post-install-cmd, even though it was only a --dry-run before).

aschempp commented 7 months ago

it would unnecessarily and inadvertently run the post-install-cmd, even though it was only a --dry-run before).

looks like --no-scripts is missing

DPiddy44 commented 7 months ago

Hi All,

Having a similar issue. Trying to install "craffft/contao-calendar-ical-bundle". I was directed here from the Contao Community.

`composer install

$ /usr/bin/php -q -dmax_execution_time=0 -dmemory_limit=-1 -ddisplay_errors=0 -ddisplay_startup_errors=0 -derror_reporting=0 -dallow_url_fopen=1 -ddisable_functions= -ddate.timezone=America/Halifax /usr/local/cms/cms0/web/contao-manager.phar.php composer install --no-dev --no-progress --no-ansi --no-interaction --optimize-autoloader Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Nothing to install, update or remove Package contao-components/highlight is abandoned, you should avoid using it. No replacement was suggested. Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead. Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead. Package symfony/swiftmailer-bundle is abandoned, you should avoid using it. Use symfony/mailer instead. Package true/punycode is abandoned, you should avoid using it. No replacement was suggested. Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead. Generating optimized autoload files composer/package-versions-deprecated: Generating version class... composer/package-versions-deprecated: ...done generating version class contao/manager-plugin: Generating plugin class... contao/manager-plugin: ...done generating plugin class 88 packages you are using are looking for funding. Use the composer fund command to find out more!

Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication In Process.php line 143:

[TypeError]
Argument 1 passed to Symfony\Component\Process\Process::__construct() must
be of the type array, string given, called in /usr/local/cms/cms0/vendor/co
ntao/manager-bundle/src/Composer/ScriptHandler.php on line 75

Exception trace: at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/symfony/process/Process.php:143 Symfony\Component\Process\Process->__construct() at /usr/local/cms/cms0/vendor/contao/manager-bundle/src/Composer/ScriptHandler.php:75 Contao\ManagerBundle\Composer\ScriptHandler::executeCommand() at /usr/local/cms/cms0/vendor/contao/manager-bundle/src/Composer/ScriptHandler.php:30 Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php:450 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php:257 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php:129 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Installer.php:393 Composer\Installer->run() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Command/InstallCommand.php:147 Composer\Command\InstallCommand->execute() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/symfony/console/Application.php:1040 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/symfony/console/Application.php:301 Symfony\Component\Console\Application->doRun() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Console/Application.php:382 Composer\Console\Application->doRun() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/symfony/console/Application.php:171 Symfony\Component\Console\Application->run() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Console/Application.php:145 Composer\Console\Application->run() at phar:///usr/local/cms/cms0/web/contao-manager.phar.php/api/console:98 require() at /usr/local/cms/cms0/web/contao-manager.phar.php:42 install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [...]

Process terminated with exit code 1

Result: General error`

Any suggestions?

aschempp commented 4 months ago

Fixed in 7e9829f56aa56aea343fe740f38cf91023c240a2