Can't install heroku-accounts plugin in heroku cli - heroku

I'm trying to install heroku-accounts using this command:
$ heroku plugins:install heroku-accounts
but instead I got this:
heroku-cli: Updating plugins... !
/Users/hit/Library/Caches/heroku/update.lock is locked with a reader active: 17964
I try rm the update.lock but it still get same result

I solve the problem by updating Heroku (I use homebrew install heroku)
heroku update
brew upgrade heroku

None of the above answers seem to work for me. The issue happened when I updated my heroku-cli via brew to version heroku-cli/6.13.8 (darwin-x64) node-v8.2.1 .
Although Error was very explicit that one more process is running, ps | grep showed no such process.
The only solution was to Restart System Once.

There is another copy of the heroku CLI running with the PID 17964
You can find it by doing something like this:
ps | grep 17964
Once you stop that process try your install again.

Related

Heroku CLI unresponsive on Ubuntu 16.04

I'm trying to get heroku cli installed on Ubuntu 16.04, following the documentation here: Heroku CLI Documentation and while my system appears to install it correctly, whenever I try any Heroku commands like heroku login the terminal hangs, and becomes unresponsive. I'm not getting any error codes.
Here's what I've tried:
I've tried installing heroku via the following methods:
wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
That didn't work, I uninstalled and tried this:
sudo snap install heroku --classic
That did't work, I uninstalled and tried this:
wget https://cli-assets.heroku.com/heroku-cli/channels/stable/heroku-cli-linux-x64.tar.gz -O heroku.tar.gz
tar -xvzf heroku.tar.gz
mkdir -p /usr/local/lib /usr/local/bin
mv heroku-cli-v6.16.12-04b3626-linux-x64 /usr/local/lib/heroku
ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
And got the same result.
The one command that does seem to work is heroku --version, but only after about 3 minutes does it return heroku-cli/6.16.12-04b3626 (linux-x64) node-v9.11.1
. I don't know if there is something going on with my os, but everything else on my system seems to be working fine.
Any help would be greatly appreciated.
The problem was my ~/.netrc file. I had somehow gotten the same entry into it over 12,000 times. After clearing that file heroku works.

Heroku CLI Error: create is not a heroku command

I have created heroku applications from the terminal before, but for some reason, this is not working for me:
$ heroku create my-app
I get the following result
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
▸ create is not a heroku command.
▸ Perhaps you meant update
▸ Run heroku help for a list of available commands.
I updated my brew to have the latest version of heroku. When I run heroku -v I get:
heroku-cli/6.15.11 (darwin-x64) node-v9.3.0
I'm also pretty sure it is installed correctly. When I run which heroku I get:
/usr/local/bin/heroku
One weird clue seems to be that heroku help gives me the following:
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
Usage: heroku COMMAND
Help topics, type heroku help TOPIC for more details:
auth
plugins add/remove CLI plugins
Which seems like it clearly does not include create as one of the commands, so do I need to add create somehow? I know that create is shorthand for apps:create so I tried both and got the same result.
I'm not sure if it's relevant, but I recently updated to Mac OS High Sierra.
I hit the same problem. The only solution I found was to uninstall from homebrew, and then manually install the heroku-cli package from here https://cli-assets.heroku.com/heroku-cli/channels/stable/heroku-cli.pkg
I only experienced this after upgrading to High Sierra.
Please, make sure your path variable are setup correctly
Please, make sure that you are logged in to your account.
You can login using following command from command line:
$ heroku login
Email: <your email>
Password: <your password>
navigate to the root folder in your system where you want to host application locally and try with your command.
This ended up being a bigger issue than originally expected. Today (after trying the suggestion in the comments), I realized I was also having issues with node (I was unable to npm init anywhere). I ended up completely reinstalling macOS.
When that didn't work, I erased and reinstalled macOS completely. After reinstalling node and heroku through brew, it did work.
I know erasing and reinstalling macOS is a pretty drastic option, but it didn't seem like anything else was working. I'm hoping there's a better answer out there, but I just wanted to include this in case someone else stumbled upon this question.

Windows bash 'Cannot create property 'exitCode' on string 'autoupdate:' Installing Heroku CLI/Toolbelt

I am attempting to install the Heroku CLI/Toolbelt on an bash shell version 4.3.48(1) (x86_64-pc-linux-gnu) running on Windows 10. I'm entering wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh in the command line, and after the packages download I'm getting the below:
Preparing to unpack .../heroku_6.14.24-1_amd64.deb ...
Unpacking heroku (6.14.24-1) ...
Setting up heroku (6.14.24-1) ...
+ which heroku
+ LOCATION=/usr/bin/heroku
+ echo heroku cli installed to /usr/bin/heroku
heroku cli installed to /usr/bin/heroku
+ heroku version
▸ Cannot create property 'exitCode' on string 'autoupdate:'
And then it just takes me back to the command line. If I try heroku --v or any other heroku CLI command I get this same error
▸ Cannot create property 'exitCode' on string 'autoupdate:'
I can't find any record of this error code anywhere online. Any thoughts? I really do not know where to start here, usually a good search at least sets me on the path but I have crickets here. Let me know if any further details are required. FWIW the toolbelt was working as of a few days ago, I just had to uninstall and reinstall my bash shell due to an unfortunate incident with Linuxbrew so am rebuilding everything from scratch.
this is fixed but the CLI might have trouble updating. Delete ~/.local/share/heroku and run heroku update and it should be fixed.

MODULE_NOT_FOUND in heroku pg:backups

I've got problem with heroku pg:backups capture --app myapp command.
Heroku CLI submits usage information back to Heroku. If you would like to disable this, set `skip_analytics: true` in /home/ubuntu/.heroku/config.json
heroku-cli: Updating to 4.99.0-e5f5ef4... done
heroku-cli: Updating CLI...heroku-cli: Updating to 5.11.8-f58f4fa... done
Starting backup of postgresql-spherical-5948... done
Use Ctrl-C at any time to stop monitoring progress; the backup will continue running.
Use heroku pg:backups:info to check progress.
Stop a running backup with heroku pg:backups:cancel.
Backing up DATABASE to b598... pending
Backing up DATABASE to b598... !
▸ MODULE_NOT_FOUND: Cannot find module 'bytes'
Does anybody have similar problem? This command is launched with deploy on CircleCI.
I started running into the same problem yesterday and was finally able to come up with a solution that is working for me.
For starters, it looks like bytes is a dependency of heroku-pg, which is the part of Heroku CLI that is being used for the backups command. It seems like the dependency is not being included or installed with the version of heroku-cli that is being used to run the backup command.
I tried CircleCI’s “Rebuild with SSH” to troubleshoot the issue, and encountered similar error messages when attempting the backup command there. While trying to reinstall heroku-cli using npm, I found that the npm and node versions were way behind what heroku-cli wanted, so maybe that is part of the problem? Anyway, reinstalling with npm only produced an even more broken Heroku CLI.
Finally I checked the build environment and it was set to Ubuntu 12.04 (Precise) which probably explains the way out of date npm/node packages. I changed it to Ubuntu 14.04 (Trusty) and pushed a new commit to CircleCI (A rebuild alone is not sufficient to change OS versions) and was able to successfully run the backup command that had been failing!
Solution: Set CircleCI build environment to Ubuntu 14.04

Killing abandoned process on Heroku

I killed an IRB prompt in a not-so-graceful manner (started with heroku run irb), and now I've got a zombie process which I can't seem to kill:
Process State Command
------------ ------------------ ------------------------------
run.3 up for 2h irb -r ./init.rb
web.1 up for 0s thin -p $PORT -e $RACK_ENV -R $HER..
I've tried:
heroku restart
heroku ps:scale run=0
heroku ps:restart run.3
Anyone know how I can force quit it?
I noticed a new ps:stop command added to the Heroku command line client a few days ago:
https://github.com/heroku/heroku/commit/a6d9eb7f314bf2c5f162a508e8d764286fb577bb
I'm not sure if that change made it into version 2.9.0 but it would be worth a try.
Update
This is now in the Heroku Toolbelt. Just run:
heroku ps:stop <process id from heroku ps>
Example:
heroku ps:stop run.8729
Thanks James!! I needed to update my Heroku client first, and it worked like a charm.
$ sudo gem install heroku
$ heroku ps #to view processes
$ heroku stop <process name here>
edit: they've fixed this issue
Heroku doesn't have a way to kill abandoned run.x processes.
But it will be killed automatically after 24 hours.
If anyone else is struggling with killing using something like:
heroku run ps:stop run.789
Killing by id worked for me:
heroku ps:kill 61ff0687-eaf4-4299-9c65-f0b22af7ec67
I got the id using the platform api list dynos - https://devcenter.heroku.com/articles/platform-api-reference#dyno-list
Worked for a detached one-off that was abandoned.

Resources