Budibase/budibase · error
User does not have access to environment variables feature.
Error message
User does not have access to environment variables feature.
What it means
Environment variables are a licensed Budibase Pro feature. changeValues loads the tenant's cached license and throws if the license does not include Feature.ENVIRONMENT_VARIABLES before it will apply any mutation to the variable map. Reads are allowed, but updates/removals are blocked without the entitlement.
Source
Thrown at packages/pro/src/sdk/environmentVariables/environmentVariables.ts:40
for (let [key, value] of Object.entries(decrypted)) {
switch (environment) {
case Environment.DEVELOPMENT:
output[key] = value.development
break
case Environment.PRODUCTION:
default:
output[key] = value.production
break
}
}
return output
}
async function changeValues(cb: (values: VariableMap) => VariableMap) {
// only block access when updating values, let users fetch
const license = await licensing.cache.getCachedLicense()
if (!license.features.includes(Feature.ENVIRONMENT_VARIABLES)) {
throw new Error(
"User does not have access to environment variables feature."
)
}
const doc = await environmentVariables.get()
doc.variables = cb(doc.variables)
await environmentVariables.update(doc)
}
export async function update(varName: string, value: EnvironmentVariableValue) {
const checkName = isValid(varName)
if (checkName) {
await changeValues(values => {
values[varName] = value
return values
})
} else {
throw new Error("Variable name has characters that are not allowed")
}View on GitHub (pinned to a81a902e9a)
Solutions
- Upgrade the tenant to a license that includes the environment variables feature (Pro/Enterprise) or start a trial.
- Apply/refresh the license key so licensing.cache picks up the feature, then clear/renew the cached license.
- If you believe the license includes the feature, force a license re-fetch to fix a stale cache and retry.
- Restructure the workflow to avoid environment variables if staying on an unlicensed plan.
Example fix
// before
await environmentVariables.update("API_KEY", "secret") // throws on free plan
// after
const license = await licensing.cache.getCachedLicense()
if (license.features.includes(Feature.ENVIRONMENT_VARIABLES)) {
await environmentVariables.update("API_KEY", "secret")
} Defensive patterns
Strategy: try-catch
Validate before calling
const license = await licensing.cache.getCachedLicense() const canUseEnvVars = license.features.includes(Feature.ENVIRONMENT_VARIABLES)
Type guard
function hasEnvVarFeature(license: License): boolean {
return license.features.includes(Feature.ENVIRONMENT_VARIABLES)
} Try / catch
try {
await environmentVariables.update(name, value)
} catch (err) {
if (err.message.includes("environment variables feature")) {
// show plan-upgrade prompt or disable the feature
} else throw err
} Prevention
- Check license features in the UI before exposing env-var editing
- Ensure the license key is applied and the license cache is refreshed after upgrades
- Gate writes behind a feature check; leave reads unguarded like the SDK does
When it happens
Trigger: Calling update() or remove() (both of which call changeValues) when the tenant's cached license from licensing.cache.getCachedLicense() does not list Feature.ENVIRONMENT_VARIABLES in its features array.
Common situations: Running on the free/open-source plan without a Pro license or trial; a self-hosted activation where the license key was not applied to the tenant; a stale license cache after downgrading the plan.
Related errors
- FEATURE_DISABLED
- Unable to assign roles - license required.
- Unable to un-assign roles - license required.
- Audit logs not available - license required.
- Variable name has characters that are not allowed
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/62761af130b49508.
Report an issue: GitHub.