cacheport

Error · Composer

Fixing Composer "curl error 28 while downloading"

curl error 28 is a timeout. Composer asked Packagist or a package host for data and nothing arrived in time.

What you see

build log
curl error 28 while downloading https://repo.packagist.org/packages.json: Operation timed out after 10002 milliseconds with 0 out of 0 bytes received

Common causes

  • Slow routes to repo.packagist.org or GitHub.
  • GitHub rate limits on unauthenticated archive downloads, which can look like hangs.
  • IPv6 routes that do not work.

How to fix it

  1. 01

    Raise the timeout

    Composer reads a process timeout and a separate HTTP timeout.

    shell
    export COMPOSER_PROCESS_TIMEOUT=600
    composer config --global http-timeout 120
  2. 02

    Add a GitHub token

    Authenticated requests get much higher limits.

    shell
    composer config --global github-oauth.github.com "$GITHUB_TOKEN"
  3. 03

    Fetch from a regional cache

    Metadata and archives come from the cache after the first pull.

    composer.json
    "repositories": [
      { "type": "composer", "url": "https://acme.cacheport.cc/composer/" },
      { "packagist.org": false }
    ]

Other network failures in builds

Start on the free plan

20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.