Error permission denied apply2files usr local lib docker cli plugins

are reporting a bug others will be able to reproduce and not asking a question or requesting software. If you're not sure or want to ask a question do so on our Discourse: https://discourse.bre...

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


Closed

phdoerfler opened this issue

Oct 8, 2019

· 34 comments

Comments

@phdoerfler

  • are reporting a bug others will be able to reproduce and not asking a question or requesting software. If you’re not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh. To get software added or changed in Homebrew please file a Pull Request
  • have a problem with brew install (or upgrade, reinstall) a single, Homebrew/homebrew-core formula (not cask) on macOS? If it’s a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it’s a Linux problem please file this issue at https://github.com/Homebrew/linuxbrew-core/issues/new/choose. If it’s a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it’s a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn’t work: ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • What you were trying to do (and why)

brew cleanup

  • What happened (include command output)
/* Many many lines by TapLoader and FormulaLoader skipped */
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/Formula/qhull.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/qhull.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/handbrake.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/railwaycat/homebrew-emacsmacport/Formula/emacs-mac.rb
Error: Permission denied @ apply2files - /usr/local/lib/python3.5/site-packages/sphinx/locale/.DS_Store
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:388:in `unlink'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:388:in `unlink'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:388:in `each'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:388:in `rm_ds_store'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:177:in `clean!'
/usr/local/Homebrew/Library/Homebrew/cmd/cleanup.rb:42:in `cleanup'
/usr/local/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'
  • What you expected to happen

The command completing successfully

  • Step-by-step reproduction instructions (by running brew install commands)

brew cleanup or brew cleanup -d -v

jxmorris12, derwaldgeist, ramasubbaiya, bradparks, gordinmitya, paulfioravanti, corysimmons, samuela, attila226, ctepeo, and 16 more reacted with thumbs up emoji

@SMillerDev

Could you fill out the issue template please? It’s pretty essential in debugging issues. This issue can be reopened once we have all the information needed to start debugging.

@phdoerfler

@SMillerDev Yes of course. Sorry for the mess, I accidentally hit the enter key in the title and that submitted this form before I had a chance to fill it out

@phdoerfler

I noticed brew doctor complaining about the ruby version installed being way newer than what homebrew supports so this will be my working theory for now. We can keep this issue closed until I confirm otherwise I suppose.

Warning: Ruby version 2.6.3 is unsupported on 10.15. Homebrew
is developed and tested on Ruby 2.3.7, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.

@phdoerfler

OK now that I had my coffee I see that of course this is likely unrelated to the ruby version mismatch. My apologies. I would like to reopen the issue again so we can discuss if this permission issue is something brew should even address or if this is a fix on a case-by-case basis type of problem.

@phdoerfler
phdoerfler

changed the title
brew cleanup

brew cleanup: Error: Permission denied @ apply2files

Oct 8, 2019

@SMillerDev

What does brew doctor tell you?

@phdoerfler

Quite a lot I’m afraid. I’m chewing down on these items as we speak:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /usr/local/miniconda3/bin/python3.7-config
  /usr/local/miniconda3/bin/python3.7m-config
  /usr/local/miniconda3/bin/python3-config
  /usr/local/miniconda3/bin/ncursesw6-config

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  ghc@8.0
  ponysay-tool
  ponythink
  suite-sparse421
  qt@5.7
  gnupg

Warning: Some installed formulae are not readable:
  ghc@8.0: unknown version :lion

  qt@5.7: unknown version :mountain_lion

Warning: Ruby version 2.6.3 is unsupported on 10.15. Homebrew
is developed and tested on Ruby 2.3.7, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.

Warning: Your Xcode (11.0) is outdated.
Please update to Xcode 11.1 (or delete it).
Xcode can be updated from the App Store.

The Xcode update is downloading right now but it’s taking its sweet little time. I’ll report back once it’s done.

@SMillerDev

You also seem to have a very old homebrew formula version that it’s refering to :lion.

This doesn’t say anything about permission issues though, which is good. What does ls -ld /usr/local/lib/python* say?

@phdoerfler

$ unalias ls
$ ls -ld /usr/local/lib/python*
drwxr-xr-x@ 3 phi  admin  96 20 Oct  2014 /usr/local/lib/python2.7
drwxr-xr-x@ 3 phi  admin  96 21 Oct  2014 /usr/local/lib/python3.4
drwxr-xr-x@ 3 phi  admin  96 14 Oct  2015 /usr/local/lib/python3.5
drwxr-xr-x@ 3 phi  admin  96 30 Dec  2016 /usr/local/lib/python3.6
drwxr-xr-x  3 phi  admin  96 20 Aug  2018 /usr/local/lib/python3.7

@michaelwalkerfl

I encountered this same error after upgrading to Catalina. I solved by uninstalling xcode and reinstalling from app store. Then deleted Library/Caches/Homebrew/.cleaned, afterwards brew behaves as expected for brew cleanup

@phdoerfler

I got brew doctor down to this now:

brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /usr/local/miniconda3/bin/python3.7-config
  /usr/local/miniconda3/bin/python3.7m-config
  /usr/local/miniconda3/bin/python3-config
  /usr/local/miniconda3/bin/ncursesw6-config

The issue persists.

And don’t quite know how to best fix that last warning of brew doctor. I use miniconda and don’t want to mess with it really.

I tried @michaelwalkerfl’s suggestion but Xcode takes hours and hours to download (no idea why) and still has not finished and whilst I deleted aforementioned .cleaned file after I had uninstalled it this was not sufficient for brew cleanup to work. But, again, Xcode hasn’t finished downloading yet so hopefully tomorrow I can tell more.

@phdoerfler

Xcode has since completed installation. The .cleaned file is still removed and whilst brew seems to be able to clean up some packages, it eventually still fails:

brew cleanup
Alias tip: brewc
Removing: /Users/phi/Library/Caches/Homebrew/pandoc--2.7.3.mojave.bottle.tar.gz... (13.7MB)
Removing: /Users/phi/Library/Caches/Homebrew/pstoedit--3.74.mojave.bottle.tar.gz... (797.9KB)
Removing: /Users/phi/Library/Caches/Homebrew/source-highlight--3.1.8_12.mojave.bottle.tar.gz... (2MB)
Error: Permission denied @ apply2files - /usr/local/lib/python3.5/site-packages/sphinx/locale/.DS_Store

Unfortunately the workaround presented by @michaelwalkerfl does not seem to solve the issue in my case.

@anasAlsalol

megusta420, MeghanGH, sleepless000, mosheavni, herman-rogers, nspool, shinyamagami, ediardo, duannx, stefanantic7, and 29 more reacted with thumbs up emoji
rocketspacer, gabriela-sartori, mietlinski-nc, camilopayan, JCBlondel, jinmiaoluo, yuamera, macavilla, SHZhao74, mauliksoneji, and 4 more reacted with thumbs down emoji
ToBePlus, bsalex, and sequinstandards reacted with laugh emoji
rocketspacer, gabriela-sartori, camilopayan, createdbyken, jinmiaoluo, FRVisser, amagrabi, BLiu1, zydeico, mauliksoneji, and 2 more reacted with confused emoji
sequinstandards reacted with heart emoji

@doublesharp

@anasAlsalol Want to add that when you uninstall/reinstall it will also remove all of the packages installed by brew.

@phdoerfler I was able to fix this on my machine (OSX Mojave 10.14.6) by resetting the permissions in /usr/local:

sudo chown -R $(whoami):admin /usr/local/* 
&& sudo chmod -R g+rwx /usr/local/*

Once brew was running again I reinstalled all the packages with brew list | xargs brew reinstall. Seems to be working so far…

FWIW I mapped the Ruby 2.3 headers to get docker-sync running, from this post: castwide/vscode-solargraph#78 (comment)

ahmagdy, quinlanj, shogochiai, Marco-FI-SEI, DavidKHahn, juanes30, jwiem, ediardo, xyzkevin, xylix, and 159 more reacted with thumbs up emoji
mgroth0, cmusam, NeilGraham, EchoEsprit, yuamera, arsenijesavic, sauravexodus, harrison-broadbent, kaushik-hr, salsadeanguila, and 15 more reacted with laugh emoji
Royedc4, SebastianZimmer, ceyhunkeklik, chaidas, julioxavierr, rubyandcoffee, EmilioPelaez, chundurusrinivas, goestav, aliniacb, and 38 more reacted with hooray emoji
chrisnovak, DavidKHahn, juanes30, xylix, Bygonaut, PratikRJoshi, ovilla7, M-Davies, SebastianZimmer, chaidas, and 39 more reacted with heart emoji
DavidKHahn, juanes30, Bygonaut, PratikRJoshi, SebastianZimmer, julioxavierr, rubyandcoffee, chundurusrinivas, aliniacb, BrandonShega, and 28 more reacted with rocket emoji
cmusam, NeilGraham, sauravexodus, harrison-broadbent, guigons, jorgegonzalez, tall15421542, danrevah, aram17, and ybroze reacted with eyes emoji

@derwaldgeist

Same problem here, always related to the same file:

Error: Permission denied @ apply2files - /usr/local/share/Library/Caches/Yarn/v1/npm-micromatch-3.1.5-d05e168c206472dfbca985bfef4f57797b4cd4ba/lib/.DS_Store

I chmod’ed it to a+rwx, but still the problem persisted. Once I removed the file, the same problem appeared with another .DS_Store file in the Yarn caches folder. I was able to resolve this by removing the whole Yarn cache, i.e.

sudo rm -r /usr/local/share/Library/Caches/Yarn/v1/

Not sure if this causes unwanted side-effects, though.

flibustier, siamak, khoahuynhdev, Lorezz, samgomena, gphfour, rey-wright, shijinliang, DeividVeloso, bgrabow, and 10 more reacted with thumbs up emoji
Lorezz and shijinliang reacted with hooray emoji
saulwiggin reacted with heart emoji

@doublesharp

@derwaldgeist you might have needed to change the ownership as well, but deleting that folder should be fine since it it will be rebuilt when you run yarn.

@mrshannonyoung

This worked for me:


sudo yarn cache clean
brew cleanup

mattpfeffer, react-native-engineer, colbyfayock, arunmenon1975, shaodahong, bechico, dlewis2017, Pei116, nerdmax, raulcontrerasrubio, and 79 more reacted with thumbs up emoji
ellenwyllie, sharkdeng, danpalmieri, CarliBotes, joey-barbier, MalekBouba, otaro808, mgroth0, mzvast, coreice, and 7 more reacted with thumbs down emoji
mindtonic, colbyfayock, thamaraiselvam, mfarmer, freakyfriday, dlewis2017, doudidas, 349989153, izuolan, bhornsby, and 16 more reacted with hooray emoji
ivankoop, KelvinCampelo, ottigerb, faradaytrs, unamaria, firofame, robertu7, mattpfeffer, react-native-engineer, mindtonic, and 24 more reacted with heart emoji
Asrover, abykal, andrewmahoneyf, and JeHwanYoo reacted with rocket emoji

@bradparks

The only thing that worked for me was to chmod the folder of the offending program so it could be deleted, so I dont think this was a brew issue, but a permissions issue I probably caused in some other way …

e.g.

$ sudo chmod -R 777 /usr/local/lib/python3.6/site-packages/openpyxl-2.5.1.dist-info

@phdoerfler

I ended up with

sudo chown -R $(whoami):wheel /usr/local/lib/python3.5/site-packages/sphinx

which did the trick. Is there any chance of brew becoming smart enough to do on its own?

@SMillerDev

It does that on install. And at no other point will brew ever have the right to change permissions so it can’t.

@rsclarke-vgw

Similar problem;

==> `brew cleanup` has not been run in 30 days, running now...
Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins

Which was a symlink pointing to a non existent folder at /Applications/Docker.app/Contents/Resources/cli-plugins.

mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
brew cleanup

All good :)

aseggemu-fyber, hemangsk, CakeSpork, zeljkofilipin, joony-wie, shanehandley, mimccio, Flirre, panther99, jgoz, and 75 more reacted with thumbs up emoji
Bmorrical, LeSchlongLong, LewisYearsley, HerrPfister, Rajkumarsb3, and alexstojda reacted with laugh emoji
rrust, HerrPfister, winfried-van-loon, Rajkumarsb3, dwisetiyadi, and alexstojda reacted with hooray emoji
mark-b-kauffman, Necromant1k, bookofdom, LeSchlongLong, myhd, LewisYearsley, dsh, isorensen, HerrPfister, thubamamba, and 3 more reacted with heart emoji
mark-b-kauffman, Necromant1k, bookofdom, LeSchlongLong, isorensen, HerrPfister, Rajkumarsb3, alexstojda, PsKs, and cipy reacted with rocket emoji

@archmagees

This fix the bug:

sudo chown -R "$(whoami)":admin /usr/local/lib

If you are fish shell, this works

sudo chown -R (whoami):admin /usr/local/lib

First answer in stackoverflow is valid.

nyameteor, pezholio, xap5xap, mzvast, fatihonur, yayanartha, marionava, peterwooley, maxcnunes, vaibhavatul47, and 15 more reacted with thumbs up emoji

@jimtje

I ran into the issue except it turned out that it’s a nonexistent file.

Running:

touch /usr/local/lib/node_modules/node-red/node_modules/@node-red/nodes/.DS_Store

fixed it for me

@adamtheadmin

sudo chown -R $(whoami) $(brew --prefix)/*

HassanChmsdn, mobec, kylefloros, mjstelly, lvsijian8, ovisirius, shevagit, ch4053n61n3, devhero, attenzione, and jfeliweb reacted with thumbs up emoji

@SMillerDev

All these posted fixes are also documented in docs.brew.sh. Gonna close this since we don’t need more copies

@Mattia541993

@MichelBras

@rsclarke-vgw

Similar problem;

==> `brew cleanup` has not been run in 30 days, running now...
Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins

Which was a symlink pointing to a non existent folder at /Applications/Docker.app/Contents/Resources/cli-plugins.

mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
brew cleanup

All good :)

Did the job for me! thanks

@nickycutesc

@rsclarke-vgw I’m getting this problem:

Error: Permission denied @ apply2files — /usr/local/lib/ruby/gems/2.6.0/gems/fastlane-2.123.0/spaceship/lib/spaceship/connect_api/.DS_Store

  1. How did you know that the symlink was pointing to a non-existent folder?
  2. You are working with Docker, an application. My problem is with Ruby, not an application. Would I just create a folder within the /usr/local/lib/ruby directory?

@doublesharp

@nickycutesc see my post above to reset the permissions, or you can just delete that file and try it again —

sudo rm /usr/local/lib/ruby/gems/2.6.0/gems/fastlane-2.123.0/spaceship/lib/spaceship/connect_api/.DS_Store

@nickycutesc

@imeuro

chown, chmod and mkdir -p didn’t do it for me, i aggressively ended up with a sudo rm -rf the whole /usr/local/lib/docker/cli-plugins directory…
hope i didn’t break anything else…

@mgifford

If this is a symbolic link, the challenge could be with the destination directory:
/usr/local/lib/docker/cli-plugins -> /Applications/Docker.app/Contents/Resources/cli-plugins

@thubamamba

Similar problem;

==> `brew cleanup` has not been run in 30 days, running now...
Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins

Which was a symlink pointing to a non existent folder at /Applications/Docker.app/Contents/Resources/cli-plugins.

mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
brew cleanup

All good :)

Worked for me. Thank you.

@yabetsu93

this command works for me

sudo chmod -R g+rwx /usr/local/*

all upgrade install smoothly, be careful when deleting the path where you found denied on brew.

@rob3c

@SMillerDev These fixes may be buried in docs.brew.sh somewhere, but this is where google is clearly sending people like me. The brew docs don’t even make first page results for the keywords that got me here (and likely others, too). I certainly appreciate the redundant copies here, so thanks everyone!

@Homebrew
Homebrew

locked as resolved and limited conversation to collaborators

Feb 26, 2020

In this article we will show how to fix permission denied @ apply2files error. Sometimes you get the error when brew upgrade node and brew clean up.

Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins

You can correct it by running on OSX:

mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
brew cleanup

Or more generally :

permission denied @ apply2files - How to fix it ?

Error: Permission denied @ apply2files - ...
mkdir -p ...
brew cleanup

What is a data ? A data-oriented system that provides a good understanding of the underlying data structures, their properties, and their use cases. The following examples illustrate this very principle. A traditional way to define a data model takes into account the data in the models in hand, and the data itself. For example, when an object of data is queried on a database such as N.com , data is used, the query will give the user the appropriate data for that database. Therefore, one can ask the user for a sample of n.com , and their responses will be obtained from the sample database.

Also, the data object also contains a description of the data within the data. So simply put, you could try to imagine how a relational database can be applied to the N.com model. And, described earlier, a data model is a powerful way of looking at data that should be well represented. So, data models are also powerful for identifying the state of a data resource and the structure in which its state is displayed.

For instance, a data-oriented database for data storage, and also for handling data transfer between data models, could be integrated with data model systems or frameworks that utilize data formats as well. Then, Data objects, which are data models to which a data source or data source’s state is dynamically attached, can also provide other data-oriented features in the data world.

Algorithme de Prim et implémentation en Python

dataframe to csv – How to export pandas dataframe

https://www.python.org/

За последние 24 часа нас посетили 11542 программиста и 1156 роботов. Сейчас ищут 376 программистов …


  1. Prankanyl

    С нами с:
    5 мар 2021
    Сообщения:
    1
    Симпатии:
    0

    Подскажите как решить проблему. Устанавливаю php на MacBook через консоль:
    brew install php@7.2

    Все проходит нормально, но в конце получаю ошибку:
    Error: Permission denied @ apply2files — /usr/local/lib/docker/cli-plugins

    Проверяю brew services list, пишет php@7.2 stopped

    В чем может быть проблема??


  2. DmitriyP

    С нами с:
    7 апр 2021
    Сообщения:
    11
    Симпатии:
    0

    Попробуйте перейти в папку /usr/local/lib/node_modules/@vue/cli/node_modules/extglob/lib/ и там уже вручную удалить файл .DS_Store.
    Правда, что бы это сделать, предварительно в Finder включите показ скрытых файлов.


  3. artoodetoo

    Команда форума
    Модератор

    С нами с:
    11 июн 2010
    Сообщения:
    10.827
    Симпатии:
    1.174
    Адрес:
    там-сям

    @Prankanyl а после той строчки нет инструкции как вручную поправить проблему через sudo? Я припоминаю что такое было.
    Что происходит припопытке запустить остановленный сервис ?
    — Добавлено —
    Проблема определенно в доступе. Варианты: права на файл админские, а плпытка перезаписать от простого пользователя. Или файл занят каким-то процессом. Соостветственно можно поправить права/удалить от админа или остановить службу и повторить.


  4. boss1

    С нами с:
    18 фев 2021
    Сообщения:
    70
    Симпатии:
    0

Понравилась статья? Поделить с друзьями:
  • Error penumerator getdefaultaudioendpoint
  • Error outputting keys and certificates openssl
  • Error output so disabling automatic redirect
  • Error output processing capture one
  • Error out of video memory trying to allocate a texture pubg