New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
symfony/finder incompatibility #143
Comments
@bytestream Thanks for reporting this. Unfortunately, without a clear way to reproduce this issue, there is not much we can do. |
I think we determined in composer/composer#10413 that it's a composer issue. |
@bytestream Thanks for the update! |
Hello, Fixed by removing slevomat/coding-standard dependency which became useless after moving our phpcs to PSR12. |
I've written up a test scenario to see if this in any reliable way could be reproduced, but no luck. Test: 9eda3f1 @Potherca Shall I clean up the test and pull it anyway ? Or leave this as "can't reproduce" ? |
Looking at composer/composer#10413 I don't think this is part of "our" side of the equation, so I'd vote for "leave as is". |
Yes and no. Yes, this is primarily a Composer native problem. My analysis of what's happening, is as follows:
So, yes, this is primarily a Composer problem as the But no... The "no" answer is that we could possibly use a But to do so, I'd need to be able to reproduce the issue consistently to ensure the @Potherca Does that make sense ? Anyway, that was the reason for me to try and reproduce the issue. Either way, this write up will hopefully help the next person running into the issue understand what's going on 😄 |
We might need to take a look at other/more places a try/catch might be needed to guard against external code. However, I think if such things are added, they should be tested at the unit level, as that would also make it trivial to reproduce since the exception would then be thrown from a mock instead of the actual code. Unless / Until this problem becomes more prevalent, I think it should not receive much priority (other than us thinking about the try/catch in general for hardening this project regarding external code).
|
We're seeing the same thing after installing dealerdirect/phpcodesniffer-composer-installer to get https://github.com/FloeDesignTechnologies/phpcs-security-audit working. We're currently using the latest stable composer version in CI & are randomly seeing this issue on our CI jobs. Any suggestion workaround and/or fix one can apply to resolve this? |
@danniehansen My apologies for the late reply, I watch comments on issues less strictly than new issue. Regarding |
I update |
@Potherca Sorry for the late reply as well. Appreciate you looking into this. Here is the information that I have at hand: PHP version: 8.0 composer.json: Click to expand composer.json details{
"name": "....",
"type": "project",
"description": ".....",
"keywords": [],
"license": "MIT",
"repositories": [
{
"type": "git",
"url": "https://github.com/danniehansen/FuelSDK-PHP.git"
}
],
"require": {
"php": "^8.0",
"ext-curl": "*",
"ext-dom": "*",
"ext-ftp": "*",
"ext-gd": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-pdo": "*",
"ext-redis": "*",
"ext-simplexml": "*",
"ext-soap": "*",
"ext-zip": "*",
"24slides/laravel-saml2": "^2.0.10",
"aws/aws-sdk-php-laravel": "^3.6.0",
"bacon/bacon-qr-code": "^2.0.6",
"box/spout": "^v3.3.0",
"bref/bref": "^1.5.6",
"bref/extra-php-extensions": "^0.11.30",
"bref/laravel-bridge": "^1.2.0",
"campaignmonitor/createsend-php": "^v6.1.2",
"doctrine/dbal": "^2.13.7",
"drewm/mailchimp-api": "^v2.5.4",
"emailplatform/api_parser": "^1.2.4",
"fideloper/proxy": "^4.4.1",
"firebase/php-jwt": "^v5.5.1",
"fruitcake/laravel-cors": "^v2.2.0",
"genealabs/laravel-model-caching": "^0.11.0",
"google/apiclient": "^v2.12.1",
"guzzlehttp/guzzle": "^7.4.5",
"heyloyalty/hl-phpclient": "^1.6.3",
"imtigger/laravel-job-status": "^1.2.0",
"intervention/image": "^2.7.1",
"laravel/framework": "^v8.83.3",
"laravel/passport": "^v10.3.2",
"laravel/tinker": "^v2.7.0",
"laravel/ui": "^v3.4.5",
"lavary/laravel-menu": "^v1.8.3",
"league/flysystem-aws-s3-v3": "^1.0.29",
"league/flysystem-cached-adapter": "^1.1.0",
"league/oauth2-client": "^2.6.1",
"maxmind-db/reader": "^v1.11.0",
"owen-it/laravel-auditing": "^v12.2.1",
"phpoffice/phpspreadsheet": "^1.22.0",
"phpseclib/phpseclib": "^2.0.36",
"picqer/php-barcode-generator": "^v2.2.1",
"pragmarx/google2fa": "^8.0.0",
"rennokki/laravel-sns-events": "^6.4.0",
"salesforce-mc/fuel-sdk-php": "dev-hotfix/php-7.4",
"sentry/sentry-laravel": "^2.5.3",
"shiftonelabs/laravel-sqs-fifo-queue": "^2.0.1",
"snowplow/snowplow-tracker": "^0.4.0",
"sonata-project/google-authenticator": "^2.3.1",
"symfony/yaml": "^v5.4.3",
"whichbrowser/parser": "^v2.1.2"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^v2.8.5",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"facade/ignition": "^2.17.5",
"itsgoingd/clockwork": "^v5.1.5",
"knuckleswtf/scribe": "3.18.0",
"micheh/phpcs-gitlab": "^1.1",
"mockery/mockery": "^1.5.0",
"nunomaduro/collision": "^v5.11.0",
"nunomaduro/larastan": "^v0.7.15",
"orchestra/testbench": "^v6.24.1",
"pheromone/phpcs-security-audit": "^2.0",
"phpstan/phpstan": "^0.12.99",
"phpunit/phpunit": "^9.5.18",
"roave/security-advisories": "dev-master",
"spatie/laravel-ray": "^1.29.4",
"squizlabs/php_codesniffer": "^3.6.2"
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"extra": {
"laravel": {
"dont-discover": []
},
"hooks": {
"pre-push": [
"git-hooks/pre-push.sh"
]
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"files": [
"app/Utilities/Includes/Utilities.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-install-cmd": "git-hooks/add.sh",
"post-update-cmd": "git-hooks/add.sh",
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
} Versions resolved from selectors related.
We're seeing the issue quite frequently in our jobs. Stopping test suites, builds & releases. |
The same thing happens to me. We are using bitbucket pipelines and I think the problem occurs when there are two or more pipelines running at the same time. |
I'm reopening the issue for further investigation, though I'm not holding out much hope that we'll be able to find a stable solution. All the same, between the combined brainpower in this thread who knows what we can come up with ;-) |
yeah, I'd love to be able to reproduce this. I've been chewing on an idea that boils down to brute forcing a reproduction scenario: automatically creating all variations of a known "broken" |
Here you can see the |
One thing I've found that may help reproduce this is when resources on the machine running the CI job are exhausted. After we switched from raw EC2 instances running our CI jobs with 1 job per machine to Kubernetes with 2 EC2 instances running concurrent jobs - then we started seeing it almost every time. So I have a sinking feeling that it may be more easily reproducible in an environment that is under stress. Could maybe be possible to provoke through a docker container restricted to a few CPU/RAM resources? |
For anyone else that become stuck on this issue & need a solution here and now. We decided just to script our way out of it using the following bash script: echo "Installing dependencies..."
while ! composer install --prefer-dist
do
((c++)) && ((c==10)) && break
echo "Installing dependencies retry in 1 second..."
sleep 1
done In our case it automatically resolves itself after attempting the second time. Leading us to think it's a matter of system constraints at that point in time provoking it. We've had 0 issues after using the above bash in our pipelines since adding it. |
Just to reiterate:
So... The most actionable item is opening en MR with try-catch around possible failure scenarios (i.e. third-party calls) and/or adding an outer / catch-all try-catch. |
Problem/Motivation
My CI jobs are occasionally failing with the below error
Expected behaviour
No fatal error
Actual behaviour
Steps to reproduce
Unclear, happens randomly. Composer version is fixed in a Docker image.
Proposed changes
The issue seems to be with the auto loader and a mismatch in
symfony/finder
versions. I depend onv5.4.0
whilecomposer.phar
usesv2.8
(I think). TheCannot call constructor
error is becausev5.4.0
callsparent::__construct()
and a__construct()
doesn't exist in the parent class (due to the version mismatch).Environment
curl -L -o /usr/bin/composer https://getcomposer.org/composer-2.phar && chmod +x /usr/bin/composer
Tested against
master
branch?master
branch.The text was updated successfully, but these errors were encountered: