phpstan: Random failures when running in parallel: Child process error (exit code 1): Could not open input file: vendor/bin/phpstan

When using the new “bleeding edge” parallelism, phpstan sometimes randomly fails with the error message

Child process error (exit code 1): Could not open input file: vendor/bin/phpstan

Setup

  • Windows host but runs in a docker container
  • os: ubuntu 18.04.2
  • php: 7.3.14
  • phpstan: 0.12.10

PHP info

www-data@75aa1a95d12a:/var/www/current$ php -v
PHP 7.3.14-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jan 23 2020 13:59:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.14, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.14-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.30.0~linux-x64-non_zts73, https://blackfire.io, by Blackfire

OS Info

www-data@75aa1a95d12a:/var/www/current$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Example

www-data@75aa1a95d12a:/var/www/current$ php vendor/bin/phpstan analyse Modules/ app/ --level=5 --configuration=.qa/phpstan/phpstan.neon

 1617/1617 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 -- ----------------------------------------------------------------------------------
     Error
 -- ----------------------------------------------------------------------------------
     Child process error (exit code 1): Could not open input file: vendor/bin/phpstan

     Child process error (exit code 1): Could not open input file: vendor/bin/phpstan

 -- ----------------------------------------------------------------------------------

 [ERROR] Found 2 errors

.qa/phpstan/phpstan.neon

(not sure if relevant but for completeness sake)

includes:
    - %currentWorkingDirectory%/vendor/phpstan/phpstan/conf/bleedingEdge.neon
parameters:
    universalObjectCratesClasses:
        - Illuminate\Database\Eloquent\Model
    excludes_analyse:
        - *.blade.php
        - *Trait.php
        - *.migrations/
        - *CloudStorageTest.php
        - *_ide_helper.php
        - *_ide_helper_models.php
        - *.phpstorm.meta.php
        - %currentWorkingDirectory%/bin
        - %currentWorkingDirectory%/vendor
        - %currentWorkingDirectory%/storage
        - %currentWorkingDirectory%/resources
        - %currentWorkingDirectory%/public
        - %currentWorkingDirectory%/.qa
        - %currentWorkingDirectory%/.local
        - %currentWorkingDirectory%/.experimental
        - %currentWorkingDirectory%/.dev
        - %currentWorkingDirectory%/Modules/Polyfill/Illuminate/Support/CollectionMacros.php
        - %currentWorkingDirectory%/Modules/AttributionModeling/tests/Unit/Style/StyleTestHelper.php
    ignoreErrors:
        - "#Parameter \\#2 \\$files of method PharData::extractTo\\(\\) expects array\\|string, null given\\.#"
        - "#Call to an undefined static method .*::(query|truncate|get|first|create|where|whereBetween|whereIn|insert|findOrFail|find|exists|distinct|count|fake|connection|shouldReceive|min|max|orderBy)\\(\\)#"
        - "#Call to an undefined method .*(HasMany|Builder)::(insert|whereIn|from|getBindings|toSql)\\(\\)#"
        - "#Call to an undefined method .*::(groupByMulti|where|whereNotIn|delete|canFinish|isRunning|itemize|table|orderBy|select|limit|getQuery|query|each|getCurrentRunNode|flushdb|whereBetween|)\\(\\)#"
        - "#Call to an undefined method .*Collection.*(compare|format|sortMulti|sortByMulti|fastFlatMap|rename|transpose|table|intersectKey|keyByFirst|groupByMulti|consolidate|pluckMulti|flattenAssoc|toArrayRecursive|toObjectRecursive|multiLineTable|fastFlatten|fastCollapse|combineByMulti|fill)\\(\\)#"
        - "#Call to an undefined method .*Fluent::(references)\\(\\)#"
        - "#Call to an undefined method .*Connection::(info)\\(\\)#"
        - "#Call to an undefined method .*Test::(getName)\\(\\)#"
        - "#Call to an undefined static method .*Collection::(mixinWithArgs)\\(\\)#"
        - "#.* cannot be cast to string#"
        - "#.*::withoutMiddleware\\(\\)#"
        - "#Method .*(BaseFormatSetting|DateRange|BaseDag)::(\\_\\_clone).*#"
        - "#.*WindowExpression#"
        - "#(EventsValueObject|ReportInformation|BaseFormatSetting|Google_Service_Sheets_Response|BaseArguments|BaseExtractor|BaseTransformer) supplied for foreach, only iterables are supported#"
        - "#does not call parent constructor from#"
        - "#Unsafe usage of new static#"
        - "#should return static#"
        - "#does not match any variable in the foreach loop#"
        - "#Cannot instantiate interface#"
        - "#Instantiated class .* is abstract#"

    reportUnmatchedIgnoredErrors: false
    bootstrap: %currentWorkingDirectory%/vendor/autoload.php
    autoload_files:
        - %currentWorkingDirectory%/.dev/ide/phpstorm/helpers/_ide_helper.php

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

The option is:

parameters:
    parallel:
        maximumNumberOfProcesses: 1

Please open a new issue if this still happens.