dorgflow icon indicating copy to clipboard operation
dorgflow copied to clipboard

PHP Fatal Error: Return value of LocalSetup::execute must be of the type int, "NULL" returned.

Open dungahk opened this issue 5 years ago • 6 comments

I'm getting this error message when trying to run dorgflow {ISSUE_URL}:

Hello, this is Dorgflow!
Detected master branch 8.x-1.x.
Fetching node 3132912 from drupal.org.
Created feature branch 3132912-Override-getIdealConditionsLimit-and-make-it-configurable.
There are no patches to apply.
PHP Fatal error:  Uncaught TypeError: Return value of "Dorgflow\Command\LocalSetup::execute()" must be of the type int, "NULL" returned. in /home/emerson/drupal/contrib/dorgflow/vendor/symfony/console/Command/Command.php:258
Stack trace:
#0 /home/emerson/drupal/contrib/dorgflow/vendor/symfony/console/Application.php(912): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /home/emerson/drupal/contrib/dorgflow/vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand(Object(Dorgflow\Command\LocalSetup), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /home/emerson/drupal/contrib/dorgflow/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/emerson/drupal/contrib/dorgflow/dor in /home/emerson/drupal/contrib/dorgflow/vendor/symfony/console/Command/Command.php on line 258

php --version

PHP 7.2.29-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 20 2020 13:54:39) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.29-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.9.3, Copyright (c) 2002-2020, by Derick Rethans

dungahk avatar May 01 '20 19:05 dungahk

Is this due to a change in Symfony Console?

joachim-n avatar May 01 '20 20:05 joachim-n

I'm not sure, the version I have installed here is 5.0.8 and the composer.json says >=3.2. Maybe we need to lock the versions? I can see the version for all the other dependencies are all higher than the one in composer.json as well.

Something like this

"require": {
    "symfony/dependency-injection": ">=3.2 <4",
    "symfony/console": ">=3.2 <4"
  },
  "require-dev": {
    "phpunit/phpunit": ">=6.0 <7",
    "symfony/var-dumper": ">=2.8 <3"
  },

I checked with Snyk and no known vulnerabilities were found with those version constraints.

Or maybe commit your composer.lock file?

dungahk avatar May 02 '20 09:05 dungahk

Forgot to mention, but doing those changes in the version constraints works.

dungahk avatar May 02 '20 10:05 dungahk

Had the exact same issue today on a fresh install (running php 7.2 as well) and the version constraint update from above fixed it.

dumityty avatar May 03 '20 14:05 dumityty

Also had this issue today on macOS with PHP 7.4. Can also confirm that the version constraints above fixed the issue after removing vendor and composer.lock and re-installing.

PHP 7.4.0 (cli) (built: Nov 29 2019 16:18:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies

andycarlberg avatar May 13 '20 19:05 andycarlberg

raised #56 to add the constraints

dungahk avatar Jun 26 '20 22:06 dungahk