Behat can't find PhpExecutableFinder - php

I get the following error when executing Behat:
PHP Fatal error: Class 'Symfony\Component\Process\PhpExecutableFinder' not found
I don't know if its normal, but the PhpExecutableFinder is located within my composer.phar after php composer.phar update is called.
{
"require": {
"php": ">=5.4",
"ext-mcrypt": "*",
"slim/slim": "~2.0",
"slim/views": "0.1.*",
"twig/twig": "1.18.*",
"propel/propel": "~2.0#dev",
"zeflasher/propel2-geocodable-behavior": "dev-master",
"behat/behat": "3.0.*#stable",
"behat/mink": "1.6.*#stable",
"behat/mink-extension": "#stable",
"behat/mink-goutte-driver": "#stable",
"behat/mink-selenium2-driver": "#stable",
"peridot-php/leo": "~1.0"
},
"autoload": {
"classmap": ["website/", "vendor/"]
}
}
Is my current composer.json. Can anybody reproduce it? composer.phar is self-updated.

composer require symfony/process
That solved the issue. I don't know why its not included in behat.

Related

Cannot find the entity manager for class

I am working on Symfony 6.1.12 after updating dependencies with the composer update command, I receive the above error when I do the symfony console make:entity command.
My composer.json file below
I tried to downgrade the doctrine/orm bundle as shown in this example but it don't work
{
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.14.1",
},
"conflict": {
"symfony/symfony": "*"
}
Could it be you dont have the Repository annotation above your entity definition?
#[ORM\Entity(repositoryClass: ProductRepository::class)]
class Product
{
}

phpinfo() shows opcache.blacklist_filename file, but contents ignored

In my Symfony/Sonata application's php.ini file, I have opcache.blacklist_filename set to /usr/src/app/config/opcache-exclude.txt. In a phpinfo() call on my test server, that file shows up in the correct place. Here is the content of the file:
/usr/src/app/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/SonataAdminBundle.php
/usr/src/app/vendor/symfony/security-core/Authorization/TraceableAccessDecisionManager.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/*/*.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/*/*/*.php
/usr/src/app/vendor/sonata-project/core-bundle/src/CoreBundle/SonataCoreBundle.php
/usr/src/app/vendor/sonata-project/core-bundle/src/*/*.php
/usr/src/app/vendor/sonata-project/core-bundle/src/*/*/*.php
/usr/src/app/vendor/symfony/security-core/Authorization/*
However, when I load my Sonata application, I still get this error, which is the same error that shows up when no blacklist is used:
Fatal error: Cannot redeclare twig_truncate_filter() (previously declared in vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php:38)
Am I using the wrong format in my exclusion file? How can I fix this so that the file's contents do not get ignored?
====
Update #1: When I simplify the contents of the blacklist file to this:
/usr/src/app/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/SonataAdminBundle.php
/usr/src/app/vendor/symfony/security-core/Authorization/TraceableAccessDecisionManager.php
... I still get essentially the same error:
Compile Error: Cannot declare class Twig_Extensions_Extension_Text,
because the name is already in use in Text.php line 15
(Yes, this is technically a different error, but it's essentially saying the same thing: The contents of Text.php are already declared in the opcache and cannot be redeclared.)
====
Update #2: Running php -v shows 7.4.19 as the version. Here is a bit of version info that shows up when I use composer info:
twig/extra-bundle v3.3.1
twig/twig v2.12.2
Running composer why twig/twig shows this output:
app-insights-php/app-insights-php-bundle 0.2.5 requires twig/twig (^1.2|^2)
friendsofsymfony/user-bundle v2.1.2 requires twig/twig (^1.28 || ^2.0)
sonata-project/admin-bundle 3.55.0 requires twig/twig (^2.10)
sonata-project/block-bundle 3.18.2 requires twig/twig (^1.34 || ^2.0)
sonata-project/core-bundle 3.17.2 requires twig/twig (^1.34 || ^2.0)
sonata-project/formatter-bundle 4.1.3 requires twig/twig (^2.4)
sonata-project/media-bundle 3.21.0 requires twig/twig (^2.10)
sonata-project/page-bundle 3.13.0 requires twig/twig (^2.10)
sonata-project/seo-bundle 2.9.0 requires twig/twig (^1.40 || ^2.9 || ^3.0)
sonata-project/translation-bundle 2.5.0 requires twig/twig (^2.12)
sonata-project/user-bundle 5.x-dev requires twig/twig (^2.9)
symfony-cmf/routing-bundle 2.1.1 requires twig/twig (^1.35 || ^2.4.4)
symfony/twig-bridge v4.4.16 requires twig/twig (^1.41|^2.10|^3.0)
symfony/twig-bundle v4.4.16 requires twig/twig (^1.41|^2.10|^3.0)
symfony/web-profiler-bundle v4.4.16 requires twig/twig (^1.41|^2.10|^3.0)
twig/extensions v1.5.4 requires twig/twig (^1.27|^2.0)
twig/extra-bundle v3.3.1 requires twig/twig (^2.4|^3.0)
====
Edit #3: There is no use of include_once() or require_once() in this app, beyond the normal autoloaders and configuration loaders found in many Symfony applications. This problem goes away when opcache is turned off. So it's definitely related to opcaching.
====
Edit #4: Here is my composer.json file.
{
"type": "project",
"license": "proprietary",
"name": "exozet/oesterreich-werbung-cms",
"description": "the new cms for Österreich Werbung based on symfony with sonata",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-curl": "*",
"ext-iconv": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-simplexml": "*",
"ext-zip": "*",
"ext-zend-opcache": "*",
"app-insights-php/app-insights-php-bundle": "^0.2.5",
"app-insights-php/doctrine-dependency-logger": "^0.2.0",
"cocur/slugify": "^3.2",
"dracoblue/craur": "^2.1",
"elao/enum": "^1.7",
"friendsofsymfony/elastica-bundle": "^5.1",
"friendsofsymfony/rest-bundle": "^2.5",
"friendsofsymfony/user-bundle": "^2.0",
"galbar/jsonpath": "^1.0",
"guzzlehttp/guzzle": "6.3.3",
"jms/serializer-bundle": "3.8.0",
"knplabs/knp-gaufrette-bundle": "^0.6.1",
"knplabs/knp-menu-bundle": "^2.0",
"lightsaml/sp-bundle": "^1.2",
"madcoda/php-youtube-api": "^1.2",
"microsoft/azure-storage-blob": "^1.4",
"microsoft/azure-storage-file": "^1.2",
"microsoft/azure-storage-queue": "^1.3",
"microsoft/azure-storage-table": "^1.1",
"nelmio/api-doc-bundle": "^4.3",
"predis/predis": "^1.1",
"sensio/framework-extra-bundle": "^5.1",
"sonata-project/admin-bundle": "^3.20",
"sonata-project/datagrid-bundle": "^2.0",
"sonata-project/doctrine-orm-admin-bundle": "^3.10",
"sonata-project/formatter-bundle": "^4.1",
"sonata-project/media-bundle": "^3.2",
"sonata-project/page-bundle": "^3.12",
"sonata-project/translation-bundle": "^2.5",
"sonata-project/user-bundle": "dev-master",
"stof/doctrine-extensions-bundle": "^1.4",
"symfony/asset": "4.4.*",
"symfony/console": "4.4.*",
"symfony/dotenv": "4.4.*",
"symfony/expression-language": "4.4.*",
"symfony/flex": "^1.3.1",
"symfony/form": "4.4.*",
"symfony/framework-bundle": "4.4.*",
"symfony/http-client": "4.4.*",
"symfony/intl": "4.4.*",
"symfony/lock": "4.4.*",
"symfony/messenger": "4.4.*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "4.4.*",
"symfony/security-bundle": "4.4.*",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/translation": "4.4.*",
"symfony/twig-bundle": "4.4.*",
"symfony/validator": "4.4.*",
"symfony/web-link": "4.4.*",
"symfony/yaml": "4.4.*",
"twig/extra-bundle": "^3.3",
"webmozart/assert": "^1.5"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.2",
"hautelook/alice-bundle": "^2.5",
"squizlabs/php_codesniffer": "*",
"symfony/debug-pack": "*",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"symfony/web-server-bundle": "4.4.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*",
"egeloen/ckeditor-bundle": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"ckeditor:install --clear=drop": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts",
"/bin/sh -c \"if [ -f contrib/setup.sh ]; then contrib/setup.sh; fi\""
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.4.*"
}
}
}
====
Edit #5:
Here is the output of composer why twig/extensions:
sonata-project/admin-bundle 3.55.0 requires twig/extensions (^1.5)
sonata-project/core-bundle 3.17.2 requires twig/extensions (^1.5)
Here is the content of my preload.php file:
<?php
if (file_exists(dirname(__DIR__).'/var/cache/dev/srcApp_KernelDevContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/dev/srcApp_KernelDevContainer.preload.php';
}
if (file_exists(dirname(__DIR__).'/var/cache/dev/App_KernelDevContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/dev/App_KernelDevContainer.preload.php';
}
... and the referenced App_KernelDevContainer.preload.php file contains this logic that you can see here:
https://gist.github.com/patrickmaynard/0f2cff49628fe068b989a7024cd21e34
The errors
Compile Error: Cannot declare class Twig_Extensions_Extension_Text, because the name is already in use in Text.php line 15
Fatal error: Cannot redeclare twig_truncate_filter() (previously declared in vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php:38)
sound a lot like you're having multiple declarations of same method or class or you're calling include()/require() multiple times explicitly or implicitly.
Do you use include() or require() anywhere that could be called depending on opcache being effective or not?
When you use PHP autoloader, the only explicit include() calls you should have are one call to load the autoloader and all the other calls in the autoloader implementation only. And make sure you don't have include_once() nor require_once() anywhere in your codebase because those do not mix well with autoloader.
The only reason to blacklist something from the opcache should be if you need to generate code that should be reloaded. It shouldn't be used to workaround code errors (e.g. incorrect include() chains).

Composer won't install due to strange syntax in composer.json: "package/package": "other-package as x.xx.x"

This composer.json file won't install due to an inline alias. This line appears to be the culprit:
"jms/serializer": "xsd2php-dev as 0.18.0",
I'm not sure what this is trying to do. Is it trying to replace the jms/serializer with xsd2php-dev at version 0.18.0?
Here is the full file:
{
"require": {
"jsanc623/phpbenchtime": "dev-master",
"gte451f/phalcon-json-api-package": "dev-master",
"soundasleep/html2text": "~0.2",
"phpmailer/phpmailer": "~5.2",
"php": ">=5.2.0",
"ext-curl": "*",
"jms/serializer": "xsd2php-dev as 0.18.0",
"robmorgan/phinx": "^0.5.3",
"aws/aws-sdk-php": "^3.19"
},
"require-dev": {
"codeception/codeception": "*",
"flow/jsonpath": "dev-master",
"goetas/xsd2php": "2.*#dev",
"goetas/xsd-reader": "2.*#dev"
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/goetas/serializer.git"
}]
}
Composer version 1.10.19
here is an example of my error I get:
$ composer
[UnexpectedValueException]
Invalid version string "xsd2php-dev" in "xsd2php-dev as 0.18.0", the alias source must be an exact version, if it is a branch name you should prefix it with dev-
As per #rob006:
Try change it to dev-xsd2php as 0.18.0 - non-version-like branches should be prefixed by dev, not suffixed.
"jms/serializer": "xsd2php-dev as 0.18.0",
to
"jms/serializer": "dev-xsd2php as 0.18.0",

Symfony 4.4 unknown inky_to_html filter

I recently updated Symfony to 4.4 (from 4.3) and can't have my translations files updated automatically (using php bin/console tran:up --force) any more. The error that pops up is:
In body.html.twig line 1:
Unknown "inky_to_html" filter.
The file in question is vendor/symfony/twig-bridge/Resources/views/Email/zurb_2/notification/body.html.twig which I never use, I have no idea why it's inclued all at a sudden. To get rid of the message I tried to require twig/inky-extra but that requires the ext-xsl-extension and I don't really want to bloat my code with things I don't need just to get rid of an error related to a twig-extension that's also not needed.
I tried to change the version of the translation-interface as described here, but that also didn't change anything.
I guess it has something to do with my project as I couldn't find any similar problem, but I can't figure it out, so any help is appreciated.
EDIT:
Here's my composer.json, it's basically the same as it was generated when creating the Symfony 4.3-project, I only changed the version names to upgrade as described in the docs and ran composer update.
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-intl": "*",
"apy/breadcrumbtrail-bundle": "^1.5",
"craue/config-bundle": "^2.3",
"easycorp/easy-log-handler": "^1.0",
"friendsofsymfony/jsrouting-bundle": "^2.4",
"league/csv": "^9.4",
"nesbot/carbon": "^2.25",
"sensio/framework-extra-bundle": "^5.1",
"sg/datatablesbundle": "^1.1",
"symfony/apache-pack": "^1.0",
"symfony/asset": "^4.0",
"symfony/console": "^4.0",
"symfony/dotenv": "^4.0",
"symfony/expression-language": "^4.0",
"symfony/flex": "^1.3.1",
"symfony/form": "^4.0",
"symfony/framework-bundle": "^4.0",
"symfony/http-client": "^4.0",
"symfony/intl": "^4.0",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "^4.0",
"symfony/security-bundle": "^4.0",
"symfony/security-csrf": "^4.0",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/translation": "^4.0",
"symfony/twig-bundle": "^4.0",
"symfony/validator": "^4.0",
"symfony/web-link": "^4.0",
"symfony/yaml": "^4.0",
"tetranz/select2entity-bundle": "^3.0"
},
"require-dev": {
"dama/doctrine-test-bundle": "^6.1",
"doctrine/doctrine-fixtures-bundle": "^3.2",
"pdepend/pdepend": "^2.5",
"phpmd/phpmd": "^2.7",
"phpunit/php-code-coverage": "^7.0",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "3.*",
"symfony/debug-pack": "*",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^4.3",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"symfony/web-server-bundle": "^4.0"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.4.*"
}
}
}
symfony/twig-bridge:4.4 changed the dev requirements to require twig/inky-extra and also added the new Resources/views/Email template files that utilize the inky_to_html filter, that were not included in 4.3.
Since tran:up attempts to scan files within the <Bundle>/Resources/views directories of each bundle for translations, to circumvent the issue and avoid scanning the twig-bridge views, you should be able to specify the bundle name you want to update the translations of.
php bin/console tran:up <locale> <bundle or directory>
Outside of including the dev requirements to circumvent the issue, you would need to revert to symfony/symfony:4.3 to get rid of the new twig-bridge/Resources/views/Email directory.
Since you are using symfony/symfony:4.4 it requires the corresponding twig-bridge.
symfony/symfony:4.4 require [sic]
"symfony/twig-bridge": "self.version"
symfony/twig-bridge:4.4 require-dev [sic]
"twig/cssinliner-extra": "^2.12",
"twig/inky-extra": "^2.12",
"twig/markdown-extra": "^2.12"
Ultimately it appears to be a bug with the dev dependencies that should be reported to Symfony.
Update: A patch has been issued for version 3.4+, see: Fix the translation commands when a template contains a syntax error #34711

Symfony2 crash after composer update

I encounter a problem since I have update my vendors on Symfony2 installation.
This is content of my composer.json :
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.4",
"symfony/symfony": ">=2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": ">=1.2",
"twig/extensions": ">=1.0",
"symfony/assetic-bundle": ">=2.3",
"symfony/swiftmailer-bundle": ">=2.3",
"symfony/monolog-bundle": ">=2.4",
"sensio/distribution-bundle": ">=2.3",
"sensio/framework-extra-bundle": ">=3.0",
"sensio/generator-bundle": ">=2.3",
"incenteev/composer-parameter-handler": "~2.0",
"white-october/pagerfanta-bundle": "dev-master",
"friendsofsymfony/rest-bundle": "1.3.*",
"friendsofsymfony/comment-bundle": "2.0.*#dev",
"friendsofsymfony/message-bundle": "1.2.*#dev",
"friendsofsymfony/user-bundle": "~2.0#dev",
"nelmio/api-doc-bundle": "#stable",
"ornicar/akismet-bundle": "dev-master",
"friendsofsymfony/jsrouting-bundle": "2.0.*#dev",
"appventus/alertify-bundle": "dev-master",
"friendsofsymfony/oauth-server-bundle": "dev-master",
"willdurand/propel-typehintable-behavior": "*",
"hwi/oauth-bundle": "0.4.*#dev",
"nomaya/social-bundle": "dev-master"
}
}
After a php composer.phar update, when I try /app.php, I have following errors :
Deprecated: The Symfony\Component\Security\Core\SecurityContextInterface interface is deprecated since version 2.6 and will be removed in 3.0. in /var/www/html/xxx/app/cache/prod/classes.php on line 3035
Deprecated: The Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage or Symfony\Component\Security\Core\Authorization\AuthorizationChecker instead. in /var/www/html/xxx/app/cache/prod/classes.php on line 3047
Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Catchable
Fatal Error: Argument 1 passed to Symfony\Component\Routing\Router::Symfony\Component\Routing\{closure}() must be an instance of Symfony\Component\Config\ConfigCacheInterface, instance of Symfony\Component\Config\ConfigCache given' in /var/www/html/xxx/app/cache/prod/classes.php:1302
Stack trace:
#0 /var/www/html/xxx/app/cache/prod/classes.php(1302): Symfony\Component\Debug\ErrorHandler->handleError(4096, 'Argument 1 pass...', '/var/www/html/p...', 1302, Array)
#1 [internal function]: Symfony\Component\Routing\Router->Symfony\Component\Routing\{closure}(Object(Symfony\Component\Config\ConfigCache))
#2 /var/www/html/xxx/vendor/symfony/symfony/src/Symfony/Component/Config/ConfigCacheFactory.php(46): call_user_func(Object(Closure), Object(Symfony\Component\Config\ConfigCache))
#3 /var/www/html/xxx/app/cache/prod/classes.php(1313): Symfony\Component\Config\ConfigCacheFactory->cache('/var/ww in /var/www/html/xxx/app/cache/prod/classes.php on line 5261
and when I go to /app_dev.php I have this one :
Whoops, looks like something went wrong.
1/1
FatalErrorException in ConfigDataCollector.php line 276:
Error: Undefined class constant 'END_OF_MAINTENANCE'
My PHP Version is 5.6.9 on Apache/2.2.15.
Anyone have a clue ?
Thanks
Knut
I solved this problem by regenerating bootstrap.php.cache (by running composer update / composer install, or directly via script)
You can try this:
php composer.phar self-update
before
php composer.phar update
The problem was an incompatibility between my different vendors, I have updated my composer.json to :
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.4",
"symfony/symfony": ">=2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": ">=1.2",
"twig/extensions": ">=1.0",
"symfony/assetic-bundle": ">=2.3",
"symfony/swiftmailer-bundle": ">=2.3",
"symfony/monolog-bundle": ">=2.4",
"sensio/distribution-bundle": ">=2.3",
"sensio/framework-extra-bundle": ">=3.0",
"sensio/generator-bundle": ">=2.3",
"incenteev/composer-parameter-handler": "~2.0",
"white-october/pagerfanta-bundle": "dev-master",
"friendsofsymfony/rest-bundle": "1.3.*",
"friendsofsymfony/comment-bundle": "2.0.*#dev",
"friendsofsymfony/message-bundle": "1.2.*#dev",
"friendsofsymfony/user-bundle": "~2.0#dev",
"nelmio/api-doc-bundle": "#stable",
"ornicar/akismet-bundle": "dev-master",
"friendsofsymfony/jsrouting-bundle": "2.0.*#dev",
"appventus/alertify-bundle": "dev-master",
"friendsofsymfony/oauth-server-bundle": "dev-master",
"willdurand/propel-typehintable-behavior": "*",
"hwi/oauth-bundle": "0.4.*#dev",
"nomaya/social-bundle": "dev-master"
}
}
and all works ...
Thanks.
try:
rm /var/www/html/xxx/app/cache/prod/* -rf
For what it's worth, I encountered this issue after upgrading symfony (to 2.8 from 2.6) which was running on a vagrant guest.
The issue was indeed with the app/bootstrap.php.cache file. In our case, it was not excluded from our rsync which meant if the host had not also updated composer the problem would reoccur. It was solved by excluding bootstrap.php.cache from rsync in our Vagrantfile:
config.vm.synced_folder "host/path", "guest/path", type: "rsync",
rsync__exclude: [ 'bootstrap.php.cache'],
This file is generated by composer, so running sudo composer install or sudo composer update on the guest will regenerate it.
Hope this saves someone else some time.

Categories