title: how to fix never ending password request with homebrew
body: <p>I'm trying to run brew upgrade, and when trying to uninstall a jdk package, it keeps asking for my password, taking it, and then asking for it again and again and never making progress.  I am just wondering what's going on here and how to fix it?</p>
  <pre><code>(base) user@computer: ~ $
  &gt; brew upgrade
  ==&gt; Casks with `auto_updates` or `version :latest` will not be upgraded
  ==&gt; Upgrading 1 outdated package:
  adoptopenjdk8 8,242:b08 -&gt; 8,272:b10
  ==&gt; Upgrading adoptopenjdk8
  ==&gt; Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u272-b10/OpenJDK8U-jdk_x64_mac_hotspot_8u272b10.pkg
  Already downloaded: /Users/me/Library/Caches/Homebrew/downloads/91154181533f41bf699ae50474345f17a588dd0524ba21698eed51461b2fdcdb--OpenJDK8U-jdk_x64_mac_hotspot_8u272b10.pkg
  ==&gt; Verifying SHA-256 checksum for Cask 'adoptopenjdk8'.
  ==&gt; Uninstalling packages:
  net.adoptopenjdk.8.jdk
  Password:  # &lt;- I entered my password here
  Password:  # &lt;- and here
  Password:  # &lt;- I tried entering it 10 times, WTF?
  </code></pre>
  <h2>DEBUG OUTPUT</h2>
  <p>after adding the debug options, it looks like a new sudo command is being run at each password request... how many there are I wonder</p>
  <pre><code>&gt; HOMEBREW_DEBUG=1 HOMEBREW_VERBOSE=1 brew upgrade
  ...
  # many preamble lines left out, before ending with this:
  
  ==&gt; Casks with `auto_updates` or `version :latest` will not be upgraded
  ==&gt; Upgrading 1 outdated package:
  adoptopenjdk8 8,242:b08 -&gt; 8,275:b01
  ==&gt; Started upgrade process for Cask adoptopenjdk8
  ==&gt; Upgrading adoptopenjdk8
  ==&gt; Printing caveats
  ==&gt; Cask::Installer#fetch
  ==&gt; Downloading
  ==&gt; Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01/OpenJDK8U-jdk_x64_mac_hotspot_8u275b01.pkg
  /usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.11\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.7\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01/OpenJDK8U-jdk_x64_mac_hotspot_8u275b01.pkg
  Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/85196e84e33d19d6ed7c43cbeae1e3f26bfe061baf02e3f2802deeb1a4a7c8b4--OpenJDK8U-jdk_x64_mac_hotspot_8u275b01.pkg
  ==&gt; Checking quarantine support
  /usr/bin/xattr
  /usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift
  ==&gt; Quarantine is available.
  ==&gt; Verifying Gatekeeper status of /Users/user/Library/Caches/Homebrew/downloads/85196e84e33d19d6ed7c43cbeae1e3f26bfe061baf02e3f2802deeb1a4a7c8b4--OpenJDK8U-jdk_x64_mac_hotspot_8u275b01.pkg
  /usr/bin/xattr -p com.apple.quarantine /Users/user/Library/Caches/Homebrew/downloads/85196e84e33d19d6ed7c43cbeae1e3f26bfe061baf02e3f2802deeb1a4a7c8b4--OpenJDK8U-jdk_x64_mac_hotspot_8u275b01.pkg
  ==&gt; /Users/user/Library/Caches/Homebrew/downloads/85196e84e33d19d6ed7c43cbeae1e3f26bfe061baf02e3f2802deeb1a4a7c8b4--OpenJDK8U-jdk_x64_mac_hotspot_8u275b01.pkg is quarantined
  ==&gt; Downloaded to -&gt; /Users/user/Library/Caches/Homebrew/downloads/85196e84e33d19d6ed7c43cbeae1e3f26bfe061baf02e3f2802deeb1a4a7c8b4--OpenJDK8U-jdk_x64_mac_hotspot_8u275b01.pkg
  ==&gt; Verifying SHA-256 checksum for Cask 'adoptopenjdk8'.
  ==&gt; Uninstalling artifacts
  ==&gt; 2 artifact/s defined
  #&lt;SortedSet: {#&lt;Cask::Artifact::Uninstall:0x00007fa30a2a3780 @cask=#&lt;Cask::Cask:0x00007fa30a29ab08 @token=&quot;adoptopenjdk8&quot;, @sourcefile_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8/.metadata/8,242:b08/20200414143743.728/Casks/adoptopenjdk8.rb&gt;, @tap=nil, @block=#&lt;Proc:0x00007fa30a29aa68@/usr/local/Caskroom/adoptopenjdk8/.metadata/8,242:b08/20200414143743.728/Casks/adoptopenjdk8.rb:1&gt;, @default_config=#&lt;Cask::Config:0x00007fa30a29aa40 @explicit={}&gt;, @caskroom_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8&gt;, @metadata_master_container_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8/.metadata&gt;, @config=#&lt;Cask::Config:0x00007fa30a298e98 @explicit={}, @default={:languages=&gt;[&quot;en-US&quot;], :appdir=&gt;#&lt;Pathname:/Applications&gt;, :colorpickerdir=&gt;#&lt;Pathname:/Users/user/Library/ColorPickers&gt;, :prefpanedir=&gt;#&lt;Pathname:/Users/user/Library/PreferencePanes&gt;, :qlplugindir=&gt;#&lt;Pathname:/Users/user/Library/QuickLook&gt;, :mdimporterdir=&gt;#&lt;Pathname:/Users/user/Library/Spotlight&gt;, :dictionarydir=&gt;#&lt;Pathname:/Users/user/Library/Dictionaries&gt;, :fontdir=&gt;#&lt;Pathname:/Users/user/Library/Fonts&gt;, :servicedir=&gt;#&lt;Pathname:/Users/user/Library/Services&gt;, :input_methoddir=&gt;#&lt;Pathname:/Users/user/Library/Input Methods&gt;, :internet_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Internet Plug-Ins&gt;, :audio_unit_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Audio/Plug-Ins/Components&gt;, :vst_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Audio/Plug-Ins/VST&gt;, :vst3_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Audio/Plug-Ins/VST3&gt;, :screen_saverdir=&gt;#&lt;Pathname:/Users/user/Library/Screen Savers&gt;}, @env={}&gt;, @dsl=#&lt;Cask::DSL:0x00007fa30897e6d8 @cask=#&lt;Cask::Cask:0x00007fa30a29ab08 ...&gt;, @token=&quot;adoptopenjdk8&quot;, @version=&quot;8,242:b08&quot;, @sha256=&quot;b24754532fdefc3ae03c56dce972803fc78fd2243bbab12fb412a93aabf05adc&quot;, @url=#&lt;URL:0x00007fa30897d828 @uri=#&lt;URI::HTTPS https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.pkg&gt;, @using=nil, @tag=nil, @branch=nil, @revisions=nil, @revision=nil, @trust_cert=nil, @cookies=nil, @referer=nil, @header=nil, @user_agent=:default, @data=nil, @specs={:user_agent=&gt;:default}&gt;, @appcast=#&lt;Cask::DSL::Appcast:0x00007fa30897d3a0 @uri=#&lt;URI::HTTPS https://github.com/adoptopenjdk/openjdk8-binaries/releases.atom&gt;, @parameters={}&gt;, @name=[&quot;AdoptOpenJDK 8&quot;], @homepage=&quot;https://adoptopenjdk.net/&quot;, @artifacts=#&lt;SortedSet: {...}&gt;, @staged_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8/8,242:b08&gt;, @language_eval=nil&gt;&gt;, @directives={:pkgutil=&gt;&quot;net.adoptopenjdk.8.jdk&quot;, :signal=&gt;[]}&gt;, #&lt;Cask::Artifact::Pkg:0x00007fa30897c630 @cask=#&lt;Cask::Cask:0x00007fa30a29ab08 @token=&quot;adoptopenjdk8&quot;, @sourcefile_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8/.metadata/8,242:b08/20200414143743.728/Casks/adoptopenjdk8.rb&gt;, @tap=nil, @block=#&lt;Proc:0x00007fa30a29aa68@/usr/local/Caskroom/adoptopenjdk8/.metadata/8,242:b08/20200414143743.728/Casks/adoptopenjdk8.rb:1&gt;, @default_config=#&lt;Cask::Config:0x00007fa30a29aa40 @explicit={}&gt;, @caskroom_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8&gt;, @metadata_master_container_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8/.metadata&gt;, @config=#&lt;Cask::Config:0x00007fa30a298e98 @explicit={}, @default={:languages=&gt;[&quot;en-US&quot;], :appdir=&gt;#&lt;Pathname:/Applications&gt;, :colorpickerdir=&gt;#&lt;Pathname:/Users/user/Library/ColorPickers&gt;, :prefpanedir=&gt;#&lt;Pathname:/Users/user/Library/PreferencePanes&gt;, :qlplugindir=&gt;#&lt;Pathname:/Users/user/Library/QuickLook&gt;, :mdimporterdir=&gt;#&lt;Pathname:/Users/user/Library/Spotlight&gt;, :dictionarydir=&gt;#&lt;Pathname:/Users/user/Library/Dictionaries&gt;, :fontdir=&gt;#&lt;Pathname:/Users/user/Library/Fonts&gt;, :servicedir=&gt;#&lt;Pathname:/Users/user/Library/Services&gt;, :input_methoddir=&gt;#&lt;Pathname:/Users/user/Library/Input Methods&gt;, :internet_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Internet Plug-Ins&gt;, :audio_unit_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Audio/Plug-Ins/Components&gt;, :vst_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Audio/Plug-Ins/VST&gt;, :vst3_plugindir=&gt;#&lt;Pathname:/Users/user/Library/Audio/Plug-Ins/VST3&gt;, :screen_saverdir=&gt;#&lt;Pathname:/Users/user/Library/Screen Savers&gt;}, @env={}&gt;, @dsl=#&lt;Cask::DSL:0x00007fa30897e6d8 @cask=#&lt;Cask::Cask:0x00007fa30a29ab08 ...&gt;, @token=&quot;adoptopenjdk8&quot;, @version=&quot;8,242:b08&quot;, @sha256=&quot;b24754532fdefc3ae03c56dce972803fc78fd2243bbab12fb412a93aabf05adc&quot;, @url=#&lt;URL:0x00007fa30897d828 @uri=#&lt;URI::HTTPS https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.pkg&gt;, @using=nil, @tag=nil, @branch=nil, @revisions=nil, @revision=nil, @trust_cert=nil, @cookies=nil, @referer=nil, @header=nil, @user_agent=:default, @data=nil, @specs={:user_agent=&gt;:default}&gt;, @appcast=#&lt;Cask::DSL::Appcast:0x00007fa30897d3a0 @uri=#&lt;URI::HTTPS https://github.com/adoptopenjdk/openjdk8-binaries/releases.atom&gt;, @parameters={}&gt;, @name=[&quot;AdoptOpenJDK 8&quot;], @homepage=&quot;https://adoptopenjdk.net/&quot;, @artifacts=#&lt;SortedSet: {...}&gt;, @staged_path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8/8,242:b08&gt;, @language_eval=nil&gt;&gt;, @path=#&lt;Pathname:/usr/local/Caskroom/adoptopenjdk8/8,242:b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.pkg&gt;, @stanza_options={}&gt;}&gt;
  ==&gt; Uninstalling artifact of class Cask::Artifact::Uninstall
  ==&gt; Uninstalling packages:
  /usr/sbin/pkgutil --pkgs=net.adoptopenjdk.8.jdk
  net.adoptopenjdk.8.jdk
  /usr/sbin/pkgutil --files net.adoptopenjdk.8.jdk
  /usr/sbin/pkgutil --pkg-info-plist net.adoptopenjdk.8.jdk
  ==&gt; Deleting pkg directories
  /usr/bin/stat -f \%Of -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/jmx/jmx-scandir/test/com/sun
  /usr/bin/sudo -E -- /bin/chmod -- 777 /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/jmx/jmx-scandir/test/com/sun
  Password:
  Sorry, try again.
  Password:
  /usr/bin/sudo -E -- /bin/rmdir -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/jmx/jmx-scandir/test/com/sun
  Password:
  /usr/bin/stat -f \%Of -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/jmx/jmx-scandir/src/com/sun
  /usr/bin/sudo -E -- /bin/chmod -- 777 /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/jmx/jmx-scandir/src/com/sun
  Password:
  Sorry, try again.
  Password:
  /usr/bin/sudo -E -- /bin/rmdir -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/jmx/jmx-scandir/src/com/sun
  Password:
  /usr/bin/stat -f \%Of -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/demo/jpda/com/sun/tools/example
  /usr/bin/sudo -E -- /bin/chmod -- 777 /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/demo/jpda/com/sun/tools/example
  Password:
  /usr/bin/sudo -E -- /bin/rmdir -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/demo/jpda/com/sun/tools/example
  Password:
  /usr/bin/stat -f \%Of -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/annotations/DependencyChecker/Plugins/src/plugins
  /usr/bin/sudo -E -- /bin/chmod -- 777 /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/annotations/DependencyChecker/Plugins/src/plugins
  Password:
  /usr/bin/sudo -E -- /bin/rmdir -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/annotations/DependencyChecker/Plugins/src/plugins
  Password:
  /usr/bin/stat -f \%Of -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/scripting/scriptpad/src/com
  /usr/bin/sudo -E -- /bin/chmod -- 777 /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/scripting/scriptpad/src/com
  Password:
  /usr/bin/sudo -E -- /bin/rmdir -- /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/sample/scripting/scriptpad/src/com
  </code></pre>