Framework: Errorexception rename operation not permitted

Created on 9 Nov 2018  路  14Comments  路  Source: laravel/framework

  • 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", " 'adldap2/adldap2-laravel' =>
array (
...

@php artisan package:discover works fine without error

How to resolve this issue ?
Andrea

needs more info

Most helpful comment

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

All 14 comments

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:

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

I believe this is yet another problem with the PackageManifest issue, latest PR which is on 5.7 is https://github.com/laravel/framework/pull/26254

ping @driesvints

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?

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 => https://github.com/laravel/framework/blob/96d4ece0e2494da90f6ecc338fe4a39f0fe1aa43/src/Illuminate/Filesystem/Filesystem.php#L142

@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"

@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.

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 !!!

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

ok thanks !

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.

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

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

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

Was this page helpful?
0 / 5 - 0 ratings