Why can't I connect or authenticate with the Heroku Command Line (CLI)?

Issue

You're trying to use the Heroku Command Line (CLI), but receiving errors like:

! Unable to connect to Heroku API, please check internet connectivity and try again.

or an authentication problem like:

Authentication failed.

Resolution

You can try several things to fix this:

  • Verify that you're on the latest version of the Heroku Command Line by running heroku update.
  • Enable debugging during login. Make sure to redact your password from the output before sending it to support! Enable it by running HEROKU_DEBUG=true HEROKU_DEBUG_HEADERS=1 heroku login on Mac/Linux, or set HEROKU_DEBUG=true; set HEROKU_DEBUG_HEADERS=1; heroku login on Windows.
  • Check which plugins you have installed by running heroku plugins. Some older plugins may have compatibility issues. For example, the heroku-accounts plugin has compatibility issues with 2FA. This plugin is a common cause of the Authentication failed. error. The heroku-two-factor plugin is also deprecated and can cause problems.

If that doesn't help, follow the link below to contact Heroku support.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support