phive icon indicating copy to clipboard operation
phive copied to clipboard

Cryptic error "Change the name of the list of all installed Phars file."

Open romainneutron opened this issue 4 years ago • 6 comments

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?

romainneutron avatar May 18 '20 16:05 romainneutron

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.

theseer avatar May 18 '20 17:05 theseer

Btw: https://github.com/phar-io/phive/blob/cd99bb032ad80d2c76b4c795fa5cbceedac056ee/src/services/migration/HomePharsXmlMigration.php#L19 here's the line of code for it.

theseer avatar May 18 '20 17:05 theseer

Where is located the phars.xml?

romainneutron avatar May 18 '20 19:05 romainneutron

Unless specified otherwise, in ~/.phive.

theseer avatar May 18 '20 20:05 theseer

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?

romainneutron avatar May 18 '20 20:05 romainneutron

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.

theseer avatar May 18 '20 22:05 theseer