n00n
n00n

Reputation: 664

chmod(): Operation not permitted

on composer install on my smfony project, I get always this message. Seems that all permissions are well done.

user@ubuntu:/var/www/html/sf-test$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
ocramius/package-versions:  Generating version class...


  [ErrorException]                  
  chmod(): Operation not permitted  


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

The permissions

user@ubuntu:/var/www/html/sf-test$ ls -la
insgesamt 300
drwxrwxr-x 14 www-data www-data   4096 Jul  4 09:53 .
drwxrwxr-x  3 www-data www-data   4096 Jul  4 09:50 ..
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 assets
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 bin
-rwxrwxr-x  1 www-data www-data   2033 Jul  4 09:50 composer.json
-rwxrwxr-x  1 www-data www-data 208091 Jul  4 09:50 composer.lock
drwxrwxr-x  4 www-data www-data   4096 Jul  4 09:50 config
-rwxrwxr-x  1 www-data www-data   1231 Jul  4 09:50 .env
-rwxrwxr-x  1 www-data www-data   1231 Jul  4 09:50 .env.dist
drwxrwxr-x  7 www-data www-data   4096 Jul  4 09:57 .git
-rwxrwxr-x  1 www-data www-data    416 Jul  4 09:50 .gitignore
drwxrwxr-x  3 user      user        4096 Jul  4 09:58 .idea
-rwxrwxr-x  1 www-data www-data    302 Jul  4 09:50 package.json
-rwxrwxr-x  1 www-data www-data   1116 Jul  4 09:50 phpunit.xml.dist
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 public
drwxrwxr-x  6 www-data www-data   4096 Jul  4 09:50 src
-rwxrwxr-x  1 www-data www-data   9881 Jul  4 09:50 symfony.lock
drwxrwxr-x  3 www-data www-data   4096 Jul  4 09:55 templates
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 tests
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 translations
drwxrwxr-x  4 www-data www-data   4096 Jul  4 09:50 var
drwxrwxr-x 20 www-data www-data   4096 Jul  4 09:50 vendor
-rwxrwxr-x  1 www-data www-data    852 Jul  4 09:50 webpack.config.js

And this is my user:

user@ubuntu:/var/www/html/sf-test$ id
uid=1000(user) gid=1000(user) Gruppen=1000(user),0(root),4(adm),24(cdrom),27(sudo),30(dip),33(www-data),46(plugdev),118(lpadmin),128(sambashare)

Has anybody a hint for me, what I am failing with? Regards n00n

Upvotes: 4

Views: 29242

Answers (4)

Elminson De Oleo Baez
Elminson De Oleo Baez

Reputation: 620

For anyone that runs into the same issue, this was AWS LightSail w/ Magento 2.4.2-21

https://community.bitnami.com/t/error-attempting-to-install-magento-2-sample-data/98866

sudo find /bitnami/magento -type d -exec chmod 775 {} \;
sudo find /bitnami/magento -type f -exec chmod 644 {} \;
sudo chmod +x /bitnami/magento/bin/magento-cli
sudo chown -R daemon:daemon /bitnami/magento

Upvotes: 2

Darius Tsafack
Darius Tsafack

Reputation: 269

I have had the same problem, but I solve it by deleting the /vendor folder and then run the composer install.

In your project folder you can run if you use ubuntu or other Linux distribution:

rm -rf vendor && composer install

Upvotes: 15

Konrad Podg&#243;rski
Konrad Podg&#243;rski

Reputation: 2034

Travis chmod Operation not permitted

For error on Travis go to More options -> Caches in the upper right corner and delete whatever cache you have there

Upvotes: 0

chikken001
chikken001

Reputation: 31

Same problem for me.

I fix this by deleting the cache directory of my user (who has to use composer) :

sudo rm -R /home/$USER/.cache/

and the vendor directory of this package :

sudo rm -R /PATH/TO/YOUR_PROJECT/vendor/ocramius

I also use ACL, don't know if its really important.

But after that composer update/install don't throw error anymore.

Upvotes: 3

Related Questions