{"record":{"id":"aad6a84bda529651","repo":"usebruno/bruno","slug":"environment-file-not-found-for-uid-environmentu","errorCode":null,"errorMessage":"Environment file not found for uid: ${environmentUid}","messagePattern":"Environment file not found for uid: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/store/workspace-environments.js","lineNumber":174,"sourceCode":"        name,\n        variables,\n        color\n      };\n    } catch (error) {\n      throw error;\n    }\n  }\n\n  async saveGlobalEnvironment(workspacePath, { environmentUid, variables, color }) {\n    try {\n      if (!workspacePath) {\n        throw new Error('Workspace path is required');\n      }\n\n      const envFile = this.findEnvironmentFileByUid(workspacePath, environmentUid);\n\n      if (!envFile) {\n        throw new Error(`Environment file not found for uid: ${environmentUid}`);\n      }\n\n      const environment = {\n        name: envFile.name,\n        variables: variables\n      };\n\n      if (color) {\n        environment.color = color;\n      }\n\n      // Serialize concurrent writes per env file. Two rapid scripted\n      // bru.setGlobalEnvVar() persist calls can otherwise overlap and the\n      // second writer's stringify+write can land before the first, dropping it.\n      await withFileLock(envFile.filePath, async () => {\n        if (this.envHasSecrets(environment)) {\n          environmentSecretsStore.storeEnvSecrets(workspacePath, environment);\n        }","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/store/workspace-environments.js#L156-L192","documentation":"Error \"Environment file not found for uid: ${environmentUid}\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/store/workspace-environments.js:174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reload the workspace; the environment file may have been deleted from disk.","Recreate the environment if its file is missing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}