Deprecated Heroku CLI

I’m currently getting the following error on CircleCI when deploying code to our production environment on Heroku:

    heroku scale worker=1 --app app-name
 ▸    heroku-cli: This CLI is deprecated. Please reinstall from
 ▸    https://cli.heroku.com
 ▸    Cannot read property 'reduce' of undefined
 !    error getting commands pid 17379 exit 1

heroku scale worker=1 --app app-name returned exit code 1

Action failed: heroku scale worker=1 --app app-name

How do I update the Herkou CLI used on my CircleCI box?

1 Like

We’re having the same issue. Tried to manually upgrade heroku-cli, to no avail. Might not have done it correctly, but either way, haven’t made progress.

Having the same issue right now.

We are aware of this issue and will be updating the Heroku CLI in the next Ubuntu 14.04 build image update we do. For now, you can run this command to install their newer CLI (which was rewritten which is why this one is deprecated):

wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

This command was obtained from the official Heroku docs.

Update: If you are using the 12.04 image, I’d switch over to 14.04 and then follow my solution. This is because Ubuntu 12.04 has been EOL’d by Canonical as well as us.

I’m not super familiar with Circle CI. Do we need to run a build “with ssh” and then run the wget command from the ssh prompt? Or is there a better way to get the Heroku CLI installed?

Where do we run this command?

To those searching here’s how I fixed it for us:

  1. run the failed build via ssh
  2. connect to the ssh connection in your terminal
  3. run the command above wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
  4. close the ssh connection exit
  5. cancel the build on circleci
  6. rerun the build normally

You can run that command anytime during your build. If you are using the CLI command manually in the deployment section, then you’d want to use it before that. Otherwise, you could run it after tests.

deployment:
  prod:
    branch: master
    commands:
      - wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
      - heroku --version #whatever command you want

or

test:
  post:
    - wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

wget -qO- http://cli-assets.heroku.com/install-ubuntu.sh | sh

I dont know how this command is working for you guys.
For me I am getting this error.

It is nightmare to work with circleci and heroku, there is not much good help, especially incase of circleci.

+ SUDO=
+ id -u
+ [ 0 != 0 ]
+ sh
+ dpkg -s apt-transport-https
sh: can't create /etc/apt/sources.list.d/heroku.list: nonexistent directory
+ echo 
sh: can't create /etc/apt/sources.list.d/heroku.list: nonexistent directory
+ echo deb https://cli-assets.heroku.com/branches/stable/apt ./

Can someone please help here.