google-api-php-client: Composer failed : Filesystem could not delete , in Docker
Environment details
- OS: ubuntu:22.04 (Docker) using Laravel 9 with Sail
- PHP version: 8.1
- Package name and version: latest 2.12
Steps to reproduce
composer install
- get the following error :
sail@769b4c6a1916:/var/www/html$ composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 1 install, 0 updates, 0 removals
- Downloading google/apiclient-services (v0.274.0)
- Installing google/apiclient-services (v0.274.0): Extracting archive
Install of google/apiclient-services failed
In Filesystem.php line 314:
Could not delete /var/www/html/vendor/composer/f9cf999e/googleapis-google-api-php-client-services-670c385/src/Contentwarehouse:
I tried to :
chmod -R 777 vendor
But still … any idea ?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 15
- Comments: 16 (2 by maintainers)
Just a note, what worked for me, adding timeout set to 1200 in config (due to old laptop, and large size of package being extracted:
This is a Composer bug; the outcome of a function should not depend on how old (or fast) the hardware running it is. It should work the same for all team member regardless of the age of their hardware… eventually 😃
In my case, this was caused by composer process timeout. Giving it more time to complete fixed it:
COMPOSER_PROCESS_TIMEOUT=600 composer install
More info: https://koop.sh/software/fix-composer-process-timeout-issues/
I had this problem last week too and it got solved on its own on the second try. But for my colleague, it keeps failing:
Version 12.3
Getting the same problem still. Interestingly enough, it only happens under Windows. Using same docker image on Ubuntu it works. Both 2.13.0 and 2.12.1 returns the same error:
`Install of google/apiclient-services failed
In Filesystem.php line 314:
Could not delete /var/www/slim_app/vendor/composer/86f7e636/googleapis-google-api-php-client-services-4b31efa/src/Directory/Resource:`
Image:
composer.json
{ "require": { "slim/slim": "^3.10", "illuminate/database": "^5.6", "monolog/monolog": "^1.23", "awurth/slim-validation": "^3.0", "illuminate/events": "^5.6", "robmorgan/phinx": "^0.9.2", "tuupola/slim-jwt-auth": "^3.0", "firebase/php-jwt": "^5.0", "google/apiclient": "^2.13" }, "autoload": { "psr-4": { "App\\": "app/" } }, "require-dev": { "phpunit/phpunit": "7" } }
Same happens to me, but its something with docker as I figured out
if I install outside docker with --ignore-platform-reqs it works, but not inside, timing out or if I run in verbose mode to crash my Docker
The workaround I did was:
go out of the docker, install it with --ignore-platform-reqs
composer require google/apiclient --ignore-platform-reqs
go inside the docker, now we have the package cached and unpacked in vendor
remove the composer.lock and install again