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

Errorexception rename operation not permitted #26462

Closed
AndreaRunner opened this issue Nov 9, 2018 · 14 comments
Closed

Errorexception rename operation not permitted #26462

AndreaRunner opened this issue Nov 9, 2018 · 14 comments

Comments

@AndreaRunner
Copy link

AndreaRunner commented Nov 9, 2018

  • Laravel Version: 5.7.13
  • PHP Version: 7.2.9
  • Database Driver & Version: mysql

Description:

Hi,
after a laravel fresh installation :
composer create-project --prefer-dist laravel/laravel example
and install same packages:
composer require barryvdh/laravel-debugbar
composer require adldap2/adldap2-laravel
...
if i make composer update, i have this error:
ErrorException : rename(/home/vagrant/sites/example/bootstrap/cache/packages.php0xeFNI,/home/vagrant/sites/example/bootstrap/cache/packages.php): Operation not permitted
Exception trace:

1 rename("/home/vagrant/sites/example/bootstrap/cache/packages.php0xeFNI", "/home/vagrant/sites/example/bootstrap/cache/packages.php")
/home/vagrant/sites/example/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:146

2 Illuminate\Filesystem\Filesystem::replace("/home/vagrant/sites/example/bootstrap/cache/packages.php", "<?php return array (
'adldap2/adldap2-laravel' =>
array (
...

@php artisan package:discover works fine without error

How to resolve this issue ?
Andrea

@driesvints
Copy link
Member

Hi there,

Looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs or problems. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

@AndreaRunner
Copy link
Author

I'm a newby, is not a bug this one ?

@mfn
Copy link
Contributor

mfn commented Nov 12, 2018

I believe this is yet another problem with the PackageManifest issue, latest PR which is on 5.7 is #26254

ping @driesvints

@driesvints
Copy link
Member

Heya, sorry. Might have been a bit too quick with thinking this was a mere permission error.

From what I can understand is that the rename fails because of a permission error. This means the update is done with a different user than the user which cloned or installed the app in the first place?

I can't reproduce this locally so it should be something specific to your setup @AndreaRunner? Can you provide more info: is this using Homestead? Where are you running the commands? Inside or outside your Vagrant box?

@driesvints driesvints reopened this Nov 12, 2018
@mfn
Copy link
Contributor

mfn commented Nov 12, 2018

What I also meant/tried to say (but obviously didn't): these permission errors may do surface because of the way the PackageManfist works, by using the new replace method.

It creates a new file and tries to replace the old one.

The old code simply tried to overwrite.

Might be the users problem exists without this, but: the new replace code does manually change the permissions, that's why I'm hinting at it =>

chmod($tempPath, 0777 - umask());

@AndreaRunner
Copy link
Author

AndreaRunner commented Nov 12, 2018

@driesvints
I use Homstead, make vagrant ssh and all commands are issued with vagrant user
remember that @php artisan package:discover works fine without error

One more info if useful, when i do:
vagrant reload --provision
i've this final message:
homestead-7: Running: script: Update Composer
homestead-7: You are running composer as "root", while "/home/vagrant/.composer" is owned by "vagrant"

@driesvints
Copy link
Member

@mfn thanks for looking into that. I'm not sure what the correct solution might be here. Any suggestions? Switch back to overwrite?

@AndreaRunner I see. It's probably indeed because you're using different users. You're probably logging into the vagrant box with the root user instead of the vagrant user.

@AndreaRunner
Copy link
Author

I have homestead on windows10 platform
### I opened gitbash with administration rights
recreated Homestead box
copy previous Homestead.yaml
vagrant ssh
cd in my project
install some packages
composer update have no problem, all works fine !!!

@driesvints
Copy link
Member

Ok well gonna close this then as your problem was resolved.

@AndreaRunner
Copy link
Author

ok thanks !

@kjfdebruin
Copy link

kjfdebruin commented Nov 20, 2018

I got the same error with a fresh install of 5.7.* Laravel.

I'm on Homestead 4.0.0 ( Ubuntu 16.04.3 LTS) on Windows 10.

First few packages installed OK, then this error occurred while installing https://github.com/spatie/laravel-json-api-paginate

vagrant halt followed by vagrant up solved it for me.

Probably a Homestead issue and not a Laravel one. Commenting in case it helps someone else.

@mohammad6006
Copy link

same error but when I close Sublime text 3 problem solved;

I don't know which setting of sublime should I change to solve this problem

@RossTsachev
Copy link

@mohammad6006 I have exactly the same issue with Sublime Text 3, have you found a solution?

@pavlix
Copy link

pavlix commented Nov 18, 2019

Similar issue with Linux kernel build, looks like a bug in vboxsf file system.

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

No branches or pull requests

7 participants