Skip to content
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

Docker + Composer is not using external providers-url error Composer repositories that have providers can not load the complete list of packages, use getPackageNames instead #798

Open
martijn-bigbridge opened this issue Feb 10, 2024 · 4 comments
Labels

Comments

@martijn-bigbridge
Copy link

Describe the bug
You will get the error below when you use a composer repository inside satis.json that contains a provider-url.

Example file after running the Docker command .composer/cache/repo/https---repo.magento.com/packages.json

{"packages":[],"providers-url":"\/p\/%package%$%hash%.json","provider-includes":{"p\/provider-ce$%hash%.json":{"sha256":"58241c175cc120030c9ca901174fa02981e5bc58e79114c40b0cb7052dd4f4b5"},"p\/provider-ee$%hash%.json":{"sha256":"886f47fee3d8235884a5bc81d87a3d76a41ead199772880cea791b6081ef14a9"},"p\/provider-b2b$%hash%.json":{"sha256":"6e8b73c78b66e76d531c7e2f5acb1c5b4e23bf63502af898192916d295289869"},"p\/provider-marketplace-extensions$%hash%.json":{"sha256":"07ca7c7ba7030a0d710e523dc3cde9d4bf6b71e509ea73a45ac07b28b9d66380"}}}

To Reproduce
satis.json

{
    "name": "x/repo-x",
    "homepage": "https://x.y.z/b",
    "minimum-stability": "dev",
    "providers": true,
    "pretty-print": true,
    "require-all": false,
    "require-dependencies": true,
    "require-dev-dependencies": true,
    "require-dependency-filter": true,
    "archive": {
        "directory": "dist",
        "format": "zip",
        "skip-dev": false
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://repo.magento.com",
            "name": "magento"
        }
    ],
    "require": {
        "magento/product-community-edition": ">=2.2.6"
    },
}
docker run --rm --init -it \
  --user $(id -u):$(id -g) \
  --volume $(pwd):/build \
  --volume "/Users/martijn/repotest/composer:/composer" \
  composer/satis build /build/satis.json /Users/martijn/repotest/public

Create a free Adobe Magento account for the repo username and password.

Or find another composer repository for satis, that is using (multiple) providers-url's like Magento.

Outcome

In ComposerRepository.php line 351:
                                                                                                                      
  [LogicException]                                                                                                    
  Composer repositories that have providers can not load the complete list of packages, use getPackageNames instead.  
                                                                                                                      
Exception trace:
  at /satis/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php:351
 Composer\Repository\ComposerRepository->getPackages() at /satis/vendor/composer/composer/src/Composer/Repository/RepositorySet.php:335
 Composer\Repository\RepositorySet->createPoolWithAllPackages() at /satis/src/PackageSelection/PackageSelection.php:628
 Composer\Satis\PackageSelection\PackageSelection->pruneBlacklisted() at /satis/src/PackageSelection/PackageSelection.php:259
 Composer\Satis\PackageSelection\PackageSelection->select() at /satis/src/Console/Command/BuildCommand.php:240
 Composer\Satis\Console\Command\BuildCommand->execute() at /satis/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /satis/vendor/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /satis/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /satis/vendor/composer/composer/src/Composer/Console/Application.php:382
 Composer\Console\Application->doRun() at /satis/src/Console/Application.php:62
 Composer\Satis\Console\Application->doRun() at /satis/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /satis/vendor/composer/composer/src/Composer/Console/Application.php:145
 Composer\Console\Application->run() at /satis/bin/satis:71

build [--repository-url REPOSITORY-URL] [--repository-strict] [--no-html-output] [--skip-errors] [--stats] [--minify] [--] [<file> [<output-dir> [<packages>...]]]

Expected behavior
Accept and follow the providers-url , so you don't get this error.

Additional context
I don't know if this only with Docker.

@artmouse
Copy link

artmouse commented Nov 6, 2024

Same issue with Magento repository

@artmouse
Copy link

artmouse commented Nov 7, 2024

@martijn-bigbridge Were you able to fix this error?

@martijn-bigbridge
Copy link
Author

Not for the latest satis version and composer >= 2.
It is possible to use composer 1.x for satis, but it is much slower.

@artmouse
Copy link

artmouse commented Nov 7, 2024

Maybe problem on this part of code
onspli@367c9ec
And dumping very slow on 3.0-dev...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants