usebruno/bruno · error · Error

Environment "${name}" already exists

Error message

Environment "${name}" already exists

What it means

Error "Environment "${name}" already exists" thrown in usebruno/bruno.

Source

Thrown at packages/bruno-electron/src/store/workspace-environments.js:138

    }
  }

  async createGlobalEnvironment(workspacePath, { uid, name, variables, color }) {
    try {
      if (!workspacePath) {
        throw new Error('Workspace path is required');
      }

      const environmentsDir = this.getEnvironmentsDir(workspacePath);

      if (!fs.existsSync(environmentsDir)) {
        await createDirectory(environmentsDir);
      }

      const environmentFilePath = this.getEnvironmentFilePath(workspacePath, name);

      if (fs.existsSync(environmentFilePath)) {
        throw new Error(`Environment "${name}" already exists`);
      }

      const environment = {
        name: name,
        variables: variables || [],
        color
      };

      if (this.envHasSecrets(environment)) {
        environmentSecretsStore.storeEnvSecrets(workspacePath, environment);
      }

      const content = await stringifyEnvironment(environment, { format: 'yml' });
      await writeFile(environmentFilePath, content);

      return {
        uid: generateUidBasedOnHash(environmentFilePath),
        name,

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Pick a different environment name.
  2. Delete or rename the existing environment first.

When it happens

Trigger: Thrown at packages/bruno-electron/src/store/workspace-environments.js:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/808d5f30e8bc6d15. Report an issue: GitHub.