n8n - 💡(How to fix) Fix $env still errors out despite being unblocked [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
n8n-io/n8n#29603Fetched 2026-05-01 05:52:20
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×1mentioned ×1subscribed ×1

Error Message

Despite N8N_BLOCK_ENV_ACCESS_IN_NODE being set to false, the UI still errors out with [ERROR: access to env vars denied]. This makes it hard to actually know that it is proper without doing a runtime test.

  • error: all
RAW_BUFFERClick to expand / collapse

Bug Description

Despite N8N_BLOCK_ENV_ACCESS_IN_NODE being set to false, the UI still errors out with [ERROR: access to env vars denied]. This makes it hard to actually know that it is proper without doing a runtime test.

To Reproduce

This is particular for the self-hosted version and not cloud.

  1. Set env N8N_BLOCK_ENV_ACCESS_IN_NODE=false (either in .env docker-compose, or the docker run command)
  2. Restart N8N (docker compose down if using docker compose, or completely stop and destroy container if just plain docker)
  3. Using a code node for test (or some other node), add return [{ json: { test: $env.YOUR_VAR }] and execute. OR
  4. {{ $env.YOUR_VAR }} as an expression.

Expected behavior

When envs are unblocked, $env should become visible and act like setting any other value. It should not give a continuous warning.

Debug Info

Debug info

core

  • n8nVersion: 2.18.5
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.14.1
  • nodeEnv: production
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: 46deb8e2-f9ef-4a8b-a927-f1f278954bd3

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/147.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2026-04-30T19:25:40.300Z

Operating System

Kubuntu 25.10

n8n Version

2.18.5

Node.js Version

24.13.0

Database

SQLite (default)

Execution mode

main (default)

Hosting

self hosted

extent analysis

TL;DR

The issue might be resolved by checking the environment variable configuration and ensuring that N8N_BLOCK_ENV_ACCESS_IN_NODE is correctly set to false in the self-hosted N8N setup.

Guidance

  • Verify that the N8N_BLOCK_ENV_ACCESS_IN_NODE environment variable is correctly set to false in the .env file or the docker run command.
  • Check the Docker configuration to ensure that the environment variable is being passed to the N8N container.
  • Test the environment variable configuration by running a simple node with a return statement that accesses an environment variable, such as return [{ json: { test: $env.YOUR_VAR }].
  • Review the N8N documentation to ensure that the environment variable configuration is correct for the self-hosted version.

Example

No code example is provided as it is not necessary for this issue.

Notes

The issue seems to be specific to the self-hosted version of N8N, and the provided debug information suggests that the environment variable configuration might be the cause of the problem.

Recommendation

Apply workaround: Check and correct the environment variable configuration to ensure that N8N_BLOCK_ENV_ACCESS_IN_NODE is set to false. This should allow access to environment variables in the N8N UI.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When envs are unblocked, $env should become visible and act like setting any other value. It should not give a continuous warning.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

n8n - 💡(How to fix) Fix $env still errors out despite being unblocked [1 comments, 2 participants]