** (RuntimeError) environment variable SECRET_KEY_BASE is missing.

Even after generating secret using mix phx.gen.secret and then setting that as the secret with the fly command, I keep getting this error. Any ideas to fix?

When are you seeing that error? It looks like the app on your account hasn’t been deployed yet.

After running flyctl launch from within app repo. Should fly deploy be run first?

When running fly deploy, there is an error executing lifecycle: io: read/write on closed pipe when Downloading from https://cnb-shim.herokuapp.com/v1/hashnuke/elixir

Secrets are injected at runtime so they aren’t available during the build. You don’t need the real secret for the build anyway, so you can pass it a placeholder for the build and it’ll be overwritten once deployed:

flyctl deploy --build-arg SECRET_KET_BASE=placeholder

That io: read/write error looks like a network issue while downloading the buildpack. It should work if you try again.

https://cnb-shim.herokuapp.com/v1/hashnuke/elixir

1.89 MB/-1 B

It’s getting hung up on this URL. I don’t know if it’s down or if it requires a different link, but my download never seems to go beyond this point…

Can you try replacing the buildpack url with this one? https://cnb-shim.fly.dev/v1/hashnuke/elixir

Apologies if this is an amateur’s question, but how to replace the buildpack URL when it is automatically pulling that link in terminal?

No worries! Is the Buildpack url set in your fly.toml file?

Using this command flyctl deploy --build-arg SECRET_KET_BASE=placeholder and changing the URL, I was able to get past the hang up in downloading. Still, I’m running into the [** (RuntimeError) environment variable SECRET_KEY_BASE is missing.] error.

Downloading from https://cnb-shim.fly.dev/v1/hashnuke/elixir

Still getting hung up at this part…

Hey - sorry for all the trouble!

Since there isn’t a buildpack targetting Phoenix specifically, we’re leaning towards a Dockerfile-based deployment, now that Phoenix will support it internally from v1.6.3 onwards. This approach also happens to lead to much faster deploy times on Fly today.

If you’d like to try this out, you can follow the instructions on the Phoenix site, or take a look at our example app running on Phoenix 1.6.0.