Skip to content

Bug: variable delete --delete-keys clears ALL variables instead of specified keys only #190

@kaosensei

Description

@kaosensei

Bug Description

When using variable delete --delete-keys <KEY> to delete a specific environment variable, the command clears all variables for the service instead of only the specified key(s).

Steps to Reproduce

# Service has multiple variables (e.g., url, database__client, database__connection__host, etc.)
npx zeabur@latest variable list --id <service-id> -i=false
# Shows 10+ variables

# Attempt to delete only one specific variable
npx zeabur@latest variable delete --id <service-id> --delete-keys url -y -i=false
# Output shows "Successfully deleted variables" with an empty table

# Check variables again
npx zeabur@latest variable list --id <service-id> -i=false
# All variables are gone — only the ones created after the delete remain

Expected Behavior

Only the specified key (url) should be deleted. All other variables should remain intact.

Actual Behavior

All variables are wiped. The command output shows an empty table after deletion, suggesting all variables were removed.

Impact

This is a critical data-loss bug. In my case, it caused a Ghost blog to crash because all database connection variables (database__connection__host, database__connection__user, etc.) were silently deleted. The service went into a crash loop until the variables were manually restored.

Environment

  • CLI version: 0.10.1 (installed via npx zeabur@latest)
  • OS: macOS
  • Command: npx zeabur@latest variable delete --id <service-id> --delete-keys <key> -y -i=false

Workaround

There is currently no safe way to update a single variable via CLI:

  • variable delete clears all variables ❌
  • variable update also has a known bug that may clear all variables ❌
  • variable create fails if the key already exists ❌

Current workaround is to use the Zeabur Dashboard for any variable modifications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions