Environment variable section disappeared from the settings?

Note: this is account wide for me, but for the sake of debugging let’s use cedblog.netlify.app

I can’t seem to be able to find anymore the environment variable settings: when I click on the Environment variables section in the site settings I can only see Shared Environment Variables (which is disabled as I’m on a starter kit plan).

My builds work as expected, so the variables are still there, but I can’t change the existing or add new ones via the UI

2 Likes

Seeing this on our account and all of our Clients’ as well.

Same here. Very inconvenient as I was just about to add a new environment variable to my site. Pretty much P0 blocker

Same here. I think someone shipped a bug which is rendering the “shared environment variables” component in the “site environment variables” section of the app. Please let us know when this can be fixed. I need to update an environment variable for my client. Thanks!

As a workaround, we’ve been using the CLI:

2 Likes

To get this working quickly, you can use the steps below, some have dialogue options. This assumes you aren’t using separate contexts – see the CLI documentation for more info on setting context values.

EDIT: --replace-existing will replace all of your .env vars, so be sure to put all of them in the .env.netlify file.

NOTE: The steps below will create a backup of your env vars locally, so if you have anything sensitive in your env vars, be sure to 1) not to commit to a repo and 2) remove the file or backup securely as needed.

  1. Create a .env.netlify file with all of your env vars you want present on your netlify instance. You can base this off your backup from step 5. For example:
SOME_VAR="some value"
ANOTHER_VAR="anotherValue"
  1. install cli
npm i -g netlify-cli
  1. login to netlify
netlify login
  1. Link the repo – you have several options here.
netlify link
  1. Optional – create a local backup of your env vars
netlify env:list --plain > .env.netlify.backup
  1. Upload your new env vars from .env.netlify.
netlify env:import .env.netlify --replace-existing

Thanks for the heads up. Will try now but this is a pretty bad bug. Whoever shipped this needs to stay away from shipping production code.

Whoever shipped this needs to stay away from shipping production code.

As much as I appreciate this issue could be frustrating, could you please avoid blaming folks? it’s not helpful, and since it’s my post to begin with, I’d rather keep a positive attitude towards a service that is fantastic (and, in the starter kit tier, also free)

2 Likes

But, if we’re on free plan we can’t complain… although there are other free options out there like vercel, fly, etc. Just happens I like Netlify as it’s fast and easy to configure…

This worked great, thanks!

But one note, if you use --replace-existing then you will lose existing env vars if you had some. So it seems best if adding vars, to include in your .env.netlify file all your existing vars if you do use --replace-existing so they are preserved as-is.

1 Like

Hi all! We’re looking into fixing this urgently, we’ll update here once we have more to share.

3 Likes

Ah, did not realize, that, I’ll update! Thanks!

If you need to update just one var as I did you can simply just execute either of the following from netlify env:set --help:

$ netlify env:set VAR_NAME value # set in all contexts and scopes
$ netlify env:set VAR_NAME value --context production # one environment
$ netlify env:set VAR_NAME value --context production deploy-preview # multiple environments 
2 Likes

it seems to be working for me now

A fix has just been released to address this issue, it should be resolved now. Thanks for your patience here!

1 Like