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

Error when "composer install" (initial project statamic/statamic) #5

Open
felixstoessel opened this issue Dec 5, 2020 · 18 comments
Open

Comments

@felixstoessel
Copy link

Hello,

I am using a Statamic project (from the statamic/statamic repo). When deleting the vendor/ and composer.lock and trying to do a composer install, I get following error:

error

I am using Composer version 1.10.19 and also tested with Composer 2. I am on Homestead and macOS.

@jasonvarga
Copy link
Member

Try a composer clear-cache and try again. If you've deleted vendor, I don't think it's an issue with this plugin.

@felixstoessel
Copy link
Author

I tried this, didn't work. I also tried composer install --no-cache and deleting some funny ~/.cache/composer and ~/.composer/cache files.

@jasonvarga
Copy link
Member

Is the path that you've blurred out definitely correct? Does that directory that it couldn't exist actually exist?

What version of PHP are you using?

@felixstoessel
Copy link
Author

Yeah, does exists. PHP 7.4 in use.

@jasonvarga
Copy link
Member

I'm out of ideas. I wonder if it's something specific to Homestead. I'll try spinning one up when I have a chance. Do you have the ability to try installing this outside of Homestead?

@nimiboid
Copy link

I'm experiencing the issue as well - homestead (vbox) on win10. Tried as well in elevated user mode to bring vagrant up; tried as well sudo composer; tried both composer 1 and 2. Same issue. The interesting part - file is there:
image

@jasonvarga
Copy link
Member

When did you create your homestead box? Can you upgrade?

This sounds the same as the thread here, specifically this comment telling you that upgrading your box should fix it.
laravel/homestead#1240 (comment)

There's also the suggestion that running composer install --prefer-source may work.
laravel/homestead#1240 (comment)

@nimiboid
Copy link

@jasonvarga actually I did try to update homestead yesterday, from 9.6 to 10.x but for some weird reason I couldn't. I did even a full reinstall of homestead but vagrant kept on insisting to use 9.6 .... weird.

I will try to update homestead to latest tomorrow and will post back here the results.

Thank you for the support.

@nimiboid
Copy link

@jasonvarga turns out I was using the latest homestead, however latest in the 9.x settler branch which is based on ubuntu 18.04.

I did try today a clean install of the latest homestead in the 10.x settler version based on ubuntu 20.04. Same error:
Plugin installation failed (include(/home/vagrant/mz2s/mz2s/vendor/pixelfear/composer-dist-plugin/src/Plugin.php): failed to open stream: No such file or directory), rolling back but file is actually there and permissions are correct.

I'm open for suggestions to try out.

@nimiboid
Copy link

Happy to report that I've come around this issue.

@jasonvarga thank you for pointing me in the direction of laravel/homestead#1240
It is a long but very interesting read.

It turns out the issue has nothing to do with pixelfear's composer-dist-plugin, nor with composer, even less with homestead or settler for that matter. It is a problem with vboxsf of VirtualBox which - it turns out - is slow for composer.

I successfully tried both workarounds:
a) install statamic via composer using --prefer-source
b) rebuild vagrant box with mount type smb for the shared folder and then use the statamic installer

Even though I'm not the original author of the issue I think it is fair to say that it can be closed as it has nothing to do with composer-dist-plugin.

@felixstoessel
Copy link
Author

@nimiboid But why does this issue appear for different user and the same issue appears? Random or some specific code logic that triggers that issue?

@nimiboid
Copy link

@felixstoessel
It seems that the issues is connected with a following setup: windows host and vagrant with virtualbox provider. Why does it happen exactly on the same composer package for both of us is unclear to me. But I think it is safe bet it is not connected with the package itself but rather with virtualbox as proven by the switch ceterus paribus from vboxfs to smb.

@felixstoessel
Copy link
Author

Hmm. I am on a macOS host (Mojave 10.15.7). I just wonder why this only happen with my Statamic projects and not with non-Statamic. Everything on Laravel Homestead and VirtualBox, but different outcomes depending on the PHP project. So I assume it has to do with this plugin.

@nimiboid
Copy link

@felixstoessel my bad, I was under the impression you're running windows host as well. Those are valid questions.

Are your running vagrant with the virtualbox provider? If yes, maybe you could try out the parallels provider.

@jasonvarga
Copy link
Member

If you're saying its because it's too slow - it could be that Statamic projects will use this Composer plugin, and Composer plugins are installed before everything else. Maybe it happens early enough for the slowness to be a problem, and you just don't see it in non-Statamic projects because they don't use Composer plugins.

Really just completely guessing here though.

@felixstoessel
Copy link
Author

All my non-statamic projects use Composer plugins.

It is just interesting, because the bug appears always with this particular Composer plugin.

@jasonvarga
Copy link
Member

What other Composer plugins are you using in your other projects?

@elliottregan
Copy link

I hit this same issue using a custom Vagrant box, not Homestead. Installing statamic via composer using --prefer-source worked for me.

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

No branches or pull requests

4 participants