phive
phive copied to clipboard
Cryptic error "Change the name of the list of all installed Phars file."
Hello, I got this issue from time to time when running phive install on my CI:
[ERROR] Phive is not ready to run due to the following failed migration(s):
[ERROR] Change the name of the list of all installed Phars file.
I don't understand this error. What should I do? I searched for some doc, and within the code but did not find anything.
Could you explain me this error and let me know which action I should take?
As of version 0.14, the internal database file of phars that are installed via phive somewhere on your system changed its name from phars.xml
to registry.xml
. We do have an automatic migration in place that does that for you when phive is started.
If it fails for whatever reason, this error is shown. It looks like we need to make that a bit more verbose though.
In case you can provide some more details on your setup, I might be able to deduct a testcase for it so we can ensure we handle this case better and/or avoid it from happening again after fixing in case it's a bug.
Btw: https://github.com/phar-io/phive/blob/cd99bb032ad80d2c76b4c795fa5cbceedac056ee/src/services/migration/HomePharsXmlMigration.php#L19 here's the line of code for it.
Where is located the phars.xml?
Unless specified otherwise, in ~/.phive
.
Our CI use some runners that run some docker images.
Those docker images mount the ~/.phive
host dir locally to use a shared cache directory.
It seems we had some different version of phive running since this directory was containing both phars.xml
and registry.xml
I removed phars.xml
and it worked correctly.
Could it be possible the issue happens when both files exist?
It certainly will cause inconsistencies if you run different versions of phive as older versions won't know about the new file and later versions won't update the old one.
We do not expose the actual error in the migration but indeed having both files at the same time is bound for trouble.