Member-only story

The Unseen Deployment Puzzle: Why Heroku Won’t Deploy When Config Variables Are Involved

Have you ever encountered a situation where Heroku won’t deploy your application, even though everything seems to be in place? If yes, then this article is for you. I’ll unravel the mystery behind this deployment conundrum and provide a simple solution that works like a charm. ✨

2d vector illustration, a chicken on a nest of eggs, with some technology-like lines leading from it, in front of a lavender background. Header text: The Unseen Deployment Puzzle on Heroku, generated using stable-diffusion-xl on InvokeAI.

The Problem

It’s a chicken 🐔 and egg 🍳 problem:

  1. You can’t deploy a Heroku project because you’ve set the environment variables incorrectly.
  2. You can’t set the correct environment variables because the build fails.

I found this problem out when I was deploying a project for a client. I had set a stripe API key…or so I thought…

$ heroku config:set STRIPE_API_KEY=my_new_api_key
Setting STRIPE_API_KEY and restarting ⬢ my_app... done, v194
STRIPE_API_KEY: my_old_api_key

Oh, psssh. Heroku’s just messing with me. Of course the variable was set!

$ heroku config:get STRIPE_API_KEY
my_old_api_key

--

--

Jordan H (Principal, Damn Good Tech) #openforwork
Jordan H (Principal, Damn Good Tech) #openforwork

Written by Jordan H (Principal, Damn Good Tech) #openforwork

Full Stack Tech Creation Lead and Application Developer - Open for Work

No responses yet