TL;DR: When installing a package, phive looks up its versions in the project’s GitHub release list, but it reads only the first page (releases?per_page=100). Once enough new releases pile up and push your pinned version out of those 100, phive install in CI fails with No matching release found. Don’t leave pinned versions alone forever; bump them regularly.


CI suddenly broke

In one project, I was managing PHPStan and Psalm with phive, and CI fetched the tools with phive install and then ran PHPStan. One day, without any change to the code, CI started failing.

$ phive install
Phive 0.16.0 - Copyright (C) 2015-2026 by Arne Blankerts, Sebastian Heuer and Contributors
Fetching repository list
Downloading repositories.xml [https://phar.io/data/repositories.xml]
Downloading releases [https://api.github.com/repos/vimeo/psalm/releases?per_page=100]
[ERROR]   No matching release found for psalm!

The culprit was Psalm. CI only runs PHPStan, but phive install without arguments installs every tool listed in phars.xml, so Psalm gets pulled in too. And I had pinned Psalm to 6.16.1 in .phive/phars.xml.

<phar name="psalm" version="^6.16.1" installed="6.16.1" location="./tools/psalm" copy="false"/>

6.16.1 does exist on GitHub, and phive install works fine on my machine. Only CI fails. Why?

Cause: phive reads only the first page of releases

The answer was right there in the log just before the error: releases?per_page=100.

phive resolves the alias (psalm → vimeo/psalm) using phar.io’s repository list (repositories.xml), then fetches the release list from the GitHub API. It sends a single request with per_page=100 and never reads the following pages (src/services/resolver/PharIoAliasResolver.php). If you specify the tool as owner/repo like vimeo/psalm, GithubAliasResolver also reads only the first page.

This was reported in issue #274 back in 2020, and it is still open. According to the maintainer, the GitHub API doesn’t return the total number of releases, so a fix would need to follow the Link header and fetch the next pages. That is quite different from the current implementation, so it isn’t a trivial fix. phive originally read only the API default of 30 releases, and phive 0.14.5 raised it to 100 as a mitigation.

In other words, any version that isn’t among the 100 most recent releases simply doesn’t exist as far as phive is concerned.

Psalm ships 7.x and 6.x in parallel, and counting betas and RCs, the oldest release on the first page was 6.17.1 (as of 2026-12-04). So 6.16.1 had been pushed out. Not a single 5.x release is left. PHPStan is no different: if you pin installed="2.1.1", it fails with No matching release found for phpstan!.

The more often a project releases, the sooner old versions get pushed out, and when that happens depends entirely on the upstream release schedule. That’s why CI “suddenly breaks without any code change”.

Why it works locally but fails in CI

It works on your machine because phive install first looks for an already downloaded phar in ~/.phive. If you have installed that version before, phive doesn’t ask the GitHub API at all, so you won’t notice it has dropped off the list.

CI starts from a clean environment and queries the GitHub API every time, which is where it finally fails. To reproduce it locally, pass an empty directory to --home to get the same situation as CI.

# Use an empty directory instead of ~/.phive
phive --home "$(mktemp -d)" install

Solution: bump to a version on the first page

This time I simply upgraded Psalm to 7.26.0.

One thing to watch out for: phive update psalm only upgrades within the ^6.16.1 constraint, which currently means 6.21.4 (check the Available column of phive outdated). If you want to stay on 6.x, that’s enough to fix CI for now, because 6.21.4 is on the first page. To cross a major version, run phive install again with a new constraint.

phive install psalm@^7.26

phars.xml is updated like this:

<phar name="psalm" version="^7.26" installed="7.26.0" location="./tools/psalm" copy="false"/>

Cache ~/.phive in CI (a stopgap)

Flipping the “works locally” reason around, if you cache ~/.phive in CI, phive won’t hit the GitHub API as long as the cache is there. With GitHub Actions, it looks like this:

- uses: actions/cache@v6
  with:
    path: ~/.phive
    key: phive-${{ hashFiles('.phive/phars.xml') }}

However, as soon as the cache is evicted or the key changes, you’re back to the failure. It speeds up CI, but it isn’t a real fix.

What doesn’t work

  • Specifying the tool as owner/repo - GithubAliasResolver also reads only the first page, so nothing changes
  • Pointing the url attribute directly at the download URL - phive extracts the version from the file name in the URL, so a file name without a version such as psalm.phar fails with Could not extract PHAR version (issue #456)

Summary

  • phive reads only the first page of GitHub releases (per_page=100)
  • Tools with parallel release lines or many pre-releases push old versions out faster
  • Locally, the phar already downloaded to ~/.phive makes it work, so you only notice in CI
  • Check pinned versions with phive outdated regularly and bump them

That’s how I learned that a version pinned with phive won’t necessarily keep working if you leave it alone.

What I liked about phive was that I didn’t have to put development-only tools into Composer. I never expected a pitfall like this. It’s ironic: you pin a version for reproducibility, and one day you can’t even install it. I guess I paid the price for putting off tool updates.

References