heroku / legacy-cli

Heroku CLI
https://cli.heroku.com
MIT License
1.37k stars 380 forks source link

Installing Heroku Toolbeit v4 - Permission Denied #1920

Open jijo1994 opened 8 years ago

jijo1994 commented 8 years ago

After not having accessed heroku for a while I tried to change the running dynos of my app using 'heroku ps:scale' but I got this error Permission denied: @ rb_sysopen - C:\Username\AppData\Local/heroku/heroku-cli.exe (Errno:EACCES)

Gabri3l commented 8 years ago

I am having the same issue, what OS are you using ?

ransombriggs commented 8 years ago

@jijo1994 What is the output of icacls C:\Username\AppData\Local/heroku? It appears that the toolbelt was able to create a directory for the updated executable but was not able to actually create the executable. This could be due to either a permissions problem, or possibly a restriction on you %LOCALAPPDATA% directory. Do you know if your sysadmin has any such restrictions?

vickytnz commented 8 years ago

I've been having the same issue - I had heroku installed but uninstalled it (maybe was the outage) and now can't install it again :( Think it's a repetition of #1922 - incredibly annoying. File doesn't even exist in Appdata. I changed the permissions on the director (or tried), uninstalled/reinstalled ... no avail. Again, had it working last week!

Microsoft Windows [Version 10.0.10586]

icacls "C:[user]\AppData\Local/heroku"
NT AUTHORITY\SYSTEM:(OI)(CI)(F)
BUILTIN\Administrators:(OI)(CI)(F)
[user]:(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files
Gabri3l commented 8 years ago

Same as @vickytnz exactly.

ransombriggs commented 8 years ago

@jijo1994 @Gabri3l @vickytnz Are any of you running anti-virus software? I had another user with the exact same issue point out that his anti-virus software quarantined C:\Username\AppData\Local/heroku/heroku-cli.exe. I have tested with my version of Norton Security but could not replicate. If you are running something else, I would like to try and replicate and then take the appropriate actions. Norton found nothing wrong with this executable, which makes me think this is a false positive, but want to go through the steps of having this trusted with other antivirus software.

ransombriggs commented 8 years ago

Adding full debugging output to this issue as well, for future people who may encounter this error.

heroku-cli: Installing Toolbelt v4... ! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       Permission denied @ rb_sysopen - C:\Users\{{UserName}}\AppData\Local/heroku/heroku-cli.exe (Errno::EACCES)
Command:     heroku
Version:     heroku/toolbelt/3.42.45 (i386-mingw32) ruby/2.1.7
ransombriggs commented 8 years ago

The other ticket I am working on has Bit Defender installed which I am installing now to try and replicate.

ransombriggs commented 8 years ago

I was able to replicate, contacting Bit Defender to determine the reason this is flagged.

Gabri3l commented 8 years ago

Oh sorry I am the same guy from the other ticket =D. Thanks for taking the time to look into this!

I can't seem to be able to fix this manually, every time I tell BitDefender to recover the file that has been processed as "infected" it will remove it again.

ransombriggs commented 8 years ago

I submitted the executable for analysis and the response email said it could take up to 72 hours to be included, will look into manual exclusion instructions for those who want them.

ransombriggs commented 8 years ago

I was able to make things run by creating an exclusion for C:\Users\{{UserName}}\AppData\Local\heroku\ using the instructions here http://www.bitdefender.com/support/how-to-add-exclusions-(exceptions)-in-bitdefender-2016-1467.html and then restarting and trying again. I know this is not a good solution, just offering in case someone needs to do something critical right now and needs an immediate workaround. I will update once I have verified that BitDefender trusts our application for those who would rather not use an exclusion.

Gabri3l commented 8 years ago

It's not giving me any error now! I am currently updating so hopefully everything will work just fine. Thanks again, I added an exception for the time being because I had a critical deadline.

Thanks for helping out @ransombriggs

EDIT: Update everything works like a charm!

jijo1994 commented 8 years ago

@ransombriggs I am using Windows 7 with BitDefender as an Antivirus but I managed to find workaround for this issue by modifying the jsplugin.rb in the Heroku installation folder. Basically what I did is change the output folder for the new version that is downloaded, then moving the file to it's default location (AppData/heroku) and running it, which install all the necessary files. The last thing is only to change in jsplugin.rb the name of the executable to whatever to set it when changing the download output folder. However, adding an exception to the antivirus seems a much better option.

jinshiq commented 8 years ago

I have the same issue on my windows 7 PC. I don't use bitdefender. I also notice that there is no such file C:\Users\Owner\AppData\Local/heroku/heroku-cli.exe.

Does anyone know how to fix this issue?

Please see the error details as below.

$ heroku version Heroku CLI submits usage information back to Heroku. If you would like to disabl e this, set skip_analytics: true in c:/Users/Owner/.heroku/config.json heroku-cli: Installing Toolbelt v4... ! Heroku client internal error. ! Search for help at: https://help.heroku.com ! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       Permission denied @ rb_sysopen - C:\Users\Owner\AppData\Local/h

eroku/heroku-cli.exe (Errno::EACCES) Command: heroku version Version: heroku-gem/3.42.47 (i386-mingw32) ruby/2.2.4 Error ID: 24b13d8b728e4a1087164fce3be77a78

More information in c:/Users/Owner/.heroku/error.log
Gabri3l commented 8 years ago

@jinshiq It seems that this problem is still related to some antivirus blocking, it might not be applicable to just Bitdefender. So you might wanna check if your antivirus is blocking Heroku access to that folder.

grobertson commented 8 years ago

Here's how to add heroku-cli.exe to the exclusions list in BitDefender. This fixed the issue on my own machine running Windows 10 Build 14316.

  1. Open Bitdefender from the start menu or the system tray.
  2. Click "Modules" at the bottom
  3. Under "Protection" click the gear icon next to the heading "Antivirus"
  4. Select "Exclusions"
  5. Click "Excluded files and folders"
  6. Click "Add"
  7. Fill in the exact path to the downloaded toolbelt. i.e. "c:\Users\USERNAME\AppData\Local\heroku\heroku-cli.exe"
  8. Select the radio button labeled "Both"
  9. Click "Ok" then close the Bitdefender window.
xni88 commented 8 years ago

heroku-cli: Installing Toolbelt v4... ! Heroku client internal error. ! Search for help at: https://help.heroku.com ! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       Permission denied @ rb_sysopen - C:\Users\Shelly\AppData\Local/heroku/heroku-cli.exe (Errno::EACCES)
Command:     heroku login
Version:     heroku/toolbelt/3.42.45 (i386-mingw32) ruby/2.1.7
Error ID:    32357fb6341c42e8b5ccb82b9e6a97d1

I have the above issue, and have been trying everything, but still does not help. Any clue?

jdx commented 8 years ago

@xni88 did you try @grobertson's steps? Are you using BitDefender?

jinshiq commented 8 years ago

@Gabri3l You are correct. That is an issue related to some antivirus blocking. I am using another antivirus tool, not Bitdefender. After I added Heroku as trusted application, the error disappeared and all heroku command worked.

ransombriggs commented 8 years ago

@jinshiq What antivirus software are you using?

jinshiq commented 8 years ago

@ransombriggs The antivirus software is called 360.

xni88 commented 8 years ago

mine is 360 too.

Date: Mon, 18 Apr 2016 15:39:21 -0700 From: notifications@github.com To: heroku@noreply.github.com CC: xnglnni@hotmail.com Subject: Re: [heroku/heroku] Installing Heroku Toolbeit v4 - Permission Denied (#1920)

@ransombriggs The antivirus software is called 360.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

ransombriggs commented 8 years ago

@jinshiq @xni88 thanks for your responses, I was able to replicate the issue you encountered with 360. If you wanted a temporary fix workaround you can add the heroku folder to your Trust List. If you open up 360, there is a three line icon in the menubar that you can click on and under that follow Settings and Trust List. Then add AppData\Local\heroku as a trusted directory and things will start working. In order to add that directory you will have to enable hidden files so that AppData can be drilled down into. I will continue working on getting this to no longer be flagged as a virus, will let you know when this happens.

cmbishop commented 8 years ago

I'm encountering the same issue: Permission denied @ rb_sysopen - C:\Users\OfficeMax\AppData\Local/heroku/heroku-cli.exe and I'm pretty sure Ad-Aware is causing it, like some of the other antivirus software. Any workaround that anyone knows about? I poked around the settings but couldn't find one.

calebissharp commented 8 years ago

I'm getting this issue using Vipre Internet Security 2016 on Windows 10. Vipre thinks it is a virus and then goes on to quarantine it.

    Error:       Permission denied - C:\Users\****\AppData\Local/heroku/heroku-cli.exe (Errno::EACCES)
    Command:     heroku version
    Version:     heroku/toolbelt/3.43.0 (i386-mingw32) ruby/1.9.3
    Error ID:    bf885bc52004480d9041849ccac96799
alirezacom81 commented 8 years ago

Hi,

I have a problem with running the heroku-cli.exe, I get the below error upon running heroku --version or heroku login:

C:\WINDOWS\system32>heroku --version heroku-cli: Installing Toolbelt v4... ! Heroku client internal error. ! Search for help at: https://help.heroku.com ! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       Permission denied @ rb_sysopen - C:\Users\{USERNAME}\AppData\Local/heroku/heroku-cli.exe (Errno::EACCES)
Command:     heroku --version
Version:     heroku/toolbelt/3.42.45 (i386-mingw32) ruby/2.1.7
Error ID:    7b26b4e897784faabc48d52ff56c4433

More information in C:/Users/{USERS}/.heroku/error.log

The log file:

Heroku client internal error. Permission denied @ rb_sysopen - C:\Users{USERNAME}\AppData\Local/heroku/heroku-cli.exe C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:140:in initialize' C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:140:inopen' C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:140:in setup' C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:27:instart' C:/Program Files (x86)/Heroku/bin/heroku:29:in `

'

Adding the heroku-cli.exe path to the list of my Anti virus (Bitdefender) trusted files and folders, as instructed above, did not help, heroku-cli.exe is not added at all to the "C:\Users{USERNAME}\AppData\Local/heroku/" path.. Would you please share your opinion about this?

Thanks

KochetkovVictor commented 8 years ago

Hello! Trying to use heroku on my PC, which is AD domain member. Starting any from AppData\Local is blocking by domain policy. Is there any hint to replace heroku directrory to directory place and start heroku.exe from that directory? Thank you!

jdx commented 8 years ago

@KochetkovVictor change %LOCALAPPDATA% to something else

KochetkovVictor commented 8 years ago

@dickeyxxx sure it's the best way! but how?

lambainsaan commented 8 years ago

Getting this issue on Fedora,. ` Installing Heroku Toolbelt v4... ! Heroku client internal error. ! Search for help at: https://help.heroku.com ! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       No such file or directory @ rb_sysopen - /usr/share/gems/gems/heroku-3.41.3/data/cacert.pem (Errno::ENOENT)
Command:     heroku git:remote -a pure-gorge-58501
Version:     heroku-gem/3.41.3 (x86_64-linux) ruby/2.2.5
Error ID:    55b20d4f9c134cd2a44d88e66c32bb97

`

Here is the error log file.

Heroku client internal error. No such file or directory @ rb_sysopen - /usr/share/gems/gems/heroku-3.41.3/data/cacert.pem /usr/share/ruby/fileutils.rb:1391:in initialize' /usr/share/ruby/fileutils.rb:1391:inopen' /usr/share/ruby/fileutils.rb:1391:in copy_file' /usr/share/ruby/fileutils.rb:485:incopy_file' /usr/share/ruby/fileutils.rb:402:in block in cp' /usr/share/ruby/fileutils.rb:1570:inblock in fu_each_src_dest' /usr/share/ruby/fileutils.rb:1586:in fu_each_src_dest0' /usr/share/ruby/fileutils.rb:1568:infu_each_src_dest' /usr/share/ruby/fileutils.rb:401:in cp' /usr/share/gems/gems/heroku-3.41.3/lib/heroku/jsplugin.rb:135:incopy_ca_cert' /usr/share/gems/gems/heroku-3.41.3/lib/heroku/jsplugin.rb:117:in setup' /usr/share/gems/gems/heroku-3.41.3/lib/heroku/jsplugin.rb:88:ininstall' /usr/share/gems/gems/heroku-3.41.3/lib/heroku/command/git.rb:48:in remote' /usr/share/gems/gems/heroku-3.41.3/lib/heroku/command.rb:212:inrun' /usr/share/gems/gems/heroku-3.41.3/lib/heroku/cli.rb:27:in start' /usr/share/gems/gems/heroku-3.41.3/bin/heroku:17:in<top (required)>' /usr/bin/heroku:23:in load' /usr/bin/heroku:23:in

'

maxxkrakoa commented 8 years ago

@lambainsaan I added this bug to Fedora https://bugzilla.redhat.com/show_bug.cgi?id=1354126

I am guessing it's a packaging error.

You might want to try installing the latest version as ruby gem heroku toolbelt directly from the heroku descriptions and see if that works

ghost commented 8 years ago

@lambainsaan @maxxkrakoa I was getting the same error.

Removing rubygem-heroku via dnf on Fedora 24 with Rawhide nodebug and installing the standalone version fixes the error for me.

TWiStErRob commented 7 years ago

I have Windows Defender and Avira Antivirus, both of them are turned off (Windows 10 Security Center confirmed they're in Snoozed state), but the problem still appears.

It was trying to update 3.42.39 to 3.99.2 via heroku update, in the end I just uninstalled my old installation and Ruby 1.9.2 it had inside, and installed the new version (5.8.1) from https://devcenter.heroku.com/articles/heroku-cli

When I see problems like this it's usually because a file descriptor is not closed by the program that opens the file. In this case the decompression might still be in progress, or finished but not closed, when the updater tries to clean up.