Calling Developers!
We are reenergizing our code contribution process! Learn More

Errors installing and updating packages via composer

Options
cdemerona
cdemerona Spryker Solution Partner Posts: 2 🧑🏻‍🚀 - Cadet
edited September 2023 in Spryker Dev Environment

Hi all,

I am getting errors with my composer setup in my local environment.

I'm trying to update outdated packages in an existing project that has been running fine but am running into the same error again and again.

Could someone explain if possible why I'm getting this error when running

docker/sdk cli composer install

Error :

Downgrading symfony/http-kernel (v5.4.20 => v5.4.16): Extracting archive
Downgrading spryker/company-business-unit-gui (2.10.1 => 2.10.0): Extracting archive
Downgrading spryker/company-business-unit-data-import (0.5.3 => 0.5.2): Extracting archive
Update of spryker/company-business-unit-gui failed
Update of spryker/company-business-unit-data-import failed
6/6 [============================] 100%
In Filesystem.php line 299: Could not delete /data/vendor/spryker/company-business-unit-gui/composer.json:


Furthermore, when running the following command :

docker/sdk cli composer outdated

I get this error :

https://repo.packagist.org could not be fully loaded (curl error 55 while downloading https://repo.packagist.org/p2/spryker/company-business-unit-data-import~dev.json: Failed sending data to the peer), package information was loaded from the local cache and ma
y be out of date In CurlDownloader.php line 377: curl error 55 while downloading https://repo.packagist.org/p2/spryker/shopping-list-session-extension~dev.json: Failed sending data to the peer

Here is the verbose result of the "install" command.

cdemerona@LY-7NFFVL3:~/jtekt$ docker/sdk cli composer install --prefer-dist -vvv
--> DEVELOPMENT MODERunning 2.3.10 (2022-07-13 15:48:23) with PHP 8.1.22 on Linux / 5.15.90.1-microsoft-standard-WSL2
Reading ./composer.json (/data/composer.json) Loading config file ./composer.json (/data/composer.json)
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/data): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Executing async command (/data): git rev-list master..spryker_feedback/npm_and_composer_update
Executing async command (/data): git rev-list develop..spryker_feedback/npm_and_composer_update
Executing async command (/data): git rev-list remotes/origin/master..spryker_feedback/npm_and_composer_update
Executing async command (/data): git rev-list remotes/origin/develop..spryker_feedback/npm_and_composer_update
Failed to initialize global composer: Composer could not find the config file: /home/spryker/.composer/composer.json Reading /data/vendor/composer/installed.json
Loading plugin Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin (from dealerdirect/phpcodesniffer-composer-installer)
Skipped loading "composer/package-versions-deprecated" as it is not in config.allow-plugins
Loading plugin SLLH\ComposerVersionsCheck\VersionsCheckPlugin (from sllh/composer-versions-check)
Reading ./composer.lock (/data/composer.lock) command: SLLH\ComposerVersionsCheck\VersionsCheckPlugin->command
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Reading ./composer.lock (/data/composer.lock)
Built pool.
Generating rules
Resolving dependencies through SAT
Looking at all rules. Dependency resolution completed in 0.007 seconds
Package operations: 0 installs, 2 updates, 0 removals
Updates: spryker/company-business-unit-gui:2.10.0, spryker/company-business-unit-data-import:0.5.2
Reading /home/spryker/.composer/cache/files/spryker/company-business-unit-gui/8afcfb3749ddc99736bd3ce1e7b3c635174d2147.zip from cache Loading spryker/company-business-unit-gui (2.10.0) from cache
Reading /home/spryker/.composer/cache/files/spryker/company-business-unit-data-import/e023329399cd8800f550e7e76930998a0d4f2548.zip from cache Loading spryker/company-business-unit-data-import (0.5.2) from cache Downgrading spryker/company-business-unit-gui (2.10.1 => 2.10.0): Extracting archive
Executing async command (CWD): rm -rf '/data/vendor/spryker/company-business-unit-gui' Downgrading spryker/company-business-unit-data-import (0.5.3 => 0.5.2): Extracting archive
Executing async command (CWD): rm -rf '/data/vendor/spryker/company-business-unit-data-import'
Update of spryker/company-business-unit-gui failed
Update of spryker/company-business-unit-data-import failed
Downloading https://packagist.org/downloads/
[201] https://packagist.org/downloads/ In Filesystem.php line 299: [RuntimeException]
Could not delete /data/vendor/spryker/company-business-unit-gui/composer.json:Composer\Installer\InstallationManager->execute() at /data/vendor/composer/composer/src/Composer/Installer.php:763
Composer\Installer->doInstall() at /data/vendor/composer/composer/src/Composer/Installer.php:281
Composer\Installer->run() at /data/vendor/composer/composer/src/Composer/Command/InstallCommand.php:137
Composer\Command\InstallCommand->execute() at /data/vendor/symfony/console/Command/Command.php:298
Symfony\Component\Console\Command\Command->run() at /data/vendor/symfony/console/Application.php:1040
Symfony\Component\Console\Application->doRunCommand() at /data/vendor/symfony/console/Application.php:301
Symfony\Component\Console\Application->doRun() at /data/vendor/composer/composer/src/Composer/Console/Application.php:335
Composer\Console\Application->doRun() at /data/vendor/symfony/console/Application.php:171
Symfony\Component\Console\Application->run() at /data/vendor/composer/composer/src/Composer/Console/Application.php:130
Composer\Console\Application->run() at /data/vendor/composer/composer/bin/composer:89
include() at /data/vendor/bin/composer:120

Thanks for your help

Tagged:

Answers

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    Heyhey @cdemerona ,

    for now I would not focus on the "curl 55 error". Sadly there is no solution for that right now and it happens every now and then. Best would be to create an official support ticket for that to official report it(and maybe write the support-case here so I can add additional comments).

    + I think the curl error is not the problem here.

    Lets try to unblock you (if you are not already unblocked?) - what OS are you using? If you are on Linux, have you tried the following already? https://docs.docker.com/engine/install/linux-postinstall/ - often file-system challenges I saw in the past were related to linux systems and wrong permissions.

    All the best,

    Florian

  • cdemerona
    cdemerona Spryker Solution Partner Posts: 2 🧑🏻‍🚀 - Cadet
    Options

    Hi Florian,
    Thanks for your reply.
    I managed to find a solution to the issue and yes it seemed to have been a permission issue.
    The solution was to run a `composer install` in the container but with root permission. I managed to do so by login in to the Docker container with `docker exec -it --user root 35c7195571cd /bin/sh` .

    FYI: I am using a Windows computer with a Linux Ubuntu WSL subsystem.

    BR,

    Christian