Comments (8)
I'm having this exact same issue when using the PHP 8 image, will share any info I find
EDIT: Oooook. We found an acceptable workaround.
TLDR: Run rm -rf ./vendor
before your composer install before deploying.
Now to our analysis 👇🏼
We run all our tests and deploys in GitLab CI (thanks to @lorisleiva 🤗 ). And we have 3 jobs in 3 stages:
- preparation stage runs the "composer" job, which runs
composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- testing stage runs the "phpunit" job
- deploy stage runs our Vapor deploy script, which runs
COMPOSER_MIRROR_PATH_REPOS=1 composer install --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader --no-dev
So, in the composer job we install our dev dependencies because we need them to test the app. The resulting ./vendor
directory gets cached by GitLab's CI system and it's automatically made available for the subsequent stages.
That's great, cause it means we install dependencies once and then we can re use that in the testing and deploying stages. So we "deploy the same thing that we tested"...
But that's actually false, cause for production we don't want to install the development dependencies. That's why we use the --no-dev
flag in composer in the deploy stage. Keep in mind, we do need those development dependencies to run phpunit.
And when we run it we see a message like:
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 0 updates, 73 removals
That makes sense, we already have access to the cached ./vendor
directory from the composer job and now we only need to remove the development dependencies.
That's when things fall apart. I've no idea if this is a bug in composer itself, in a dependency, in our codebase, etc... but composer errors out with the ...GithubActionError.php
error when trying to remove the development dependencies. If we remove the --no-dev
it works perfectly, but That's A NoNo.
Long story short, our solution is to embrace the fact that composer.lock exists and that this job runs in CI (where the download speed is insanely fast). So we nuke the ./vendor
directory running rm -rf ./vendor
right before the deployable composer install ... --no-dev
.
In the end, I think this is perfectly acceptable.
I'm sure there's a way to tell GitLab to avoid downloading the cached ./vendor
directory, or an overall better way to do this. But we've spent way to much time today trying to understand and fix this... so, it's going to stay like this. And, no, it doesn't seen to be related to lorisleiva/laravel-docker:x.x
docker images.
I hope this is helpful or at least interesting :)
Please do let me know if anyone finds a better approach.
from laravel-docker.
I ran into this same issue with a forked version of 7.4
After some debugging I wasn't able to determine the root cause but it appeared to be on GitLab's end.
Clearing the runner caches on GitLab fixed it for me.
from laravel-docker.
We're having the same error with 8.0 image and still couldn't find any solutions
from laravel-docker.
Hi Franco 👋
Thanks for the detailed report and for sharing it with us!
Do let me know if there's anything this repository can do to improve the developer experience regarding this issue.
from laravel-docker.
I have the exact same problem as you : composer updates failing with error finding the file GithubActionError.php.
Did you manage to find a solution ?
Thanks
from laravel-docker.
@admin1for2 Nope, current solution is upgrading to 7.3 or 7.4
from laravel-docker.
Sorry guys, this repo no longer maintains versions below 7.3.
from laravel-docker.
I had same issue and i found a different solution that i post here https://stackoverflow.com/a/71529389/7736155
include(/builds/myapp/myapp-api/vendor/composer/../composer/composer/sr
c/Composer/Console/GithubActionError.php): Failed to open stream: No such f
ile or directory
TL;TD
composer
command actually not working as expected i download new composer.phar file and everything works fine now.
from laravel-docker.
Related Issues (20)
- phpcs: command not found HOT 8
- bash: make: command not found HOT 2
- Error running composer install HOT 2
- phpcs: command not found HOT 1
- [Vote] Chromium for dusk tests HOT 1
- Missing extensions? HOT 1
- wkhtmltopdf issue for 7.4 HOT 6
- Latest version HOT 1
- Set php.ini parameters HOT 2
- Would it be possible to update to the latest PHPCS?
- Update to latest PHP8.1 HOT 3
- Error less: unrecognized option: X - PHP 7.4 HOT 2
- Disabling Xdebug HOT 1
- Rebuilding the images with latest PHP versions HOT 1
- build fails with node version issue HOT 1
- Imap Extension HOT 2
- Support for ARM64
- Missing git after commit "Install php extension with `docker-php-extension-installer` + get rid of already installed extension" HOT 7
- bash: git: command not found HOT 2
- phpunit: command not found HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-docker.