{"record":{"id":"50bbe49040ae69df","repo":"coollabsio/coolify","slug":"variable-already-exists-50bbe4","errorCode":null,"errorMessage":"Variable already exists.","messagePattern":"Variable already exists\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Livewire/SharedVariables/Project/Show.php","lineNumber":29,"sourceCode":"{\n    use AuthorizesRequests;\n\n    public Project $project;\n\n    public string $view = 'normal';\n\n    public ?string $variables = null;\n\n    protected $listeners = ['refreshEnvs' => 'refreshEnvs', 'saveKey' => 'saveKey', 'environmentVariableDeleted' => 'refreshEnvs'];\n\n    public function saveKey($data)\n    {\n        try {\n            $this->authorize('update', $this->project);\n\n            $found = $this->project->environment_variables()->where('key', $data['key'])->first();\n            if ($found) {\n                throw new \\Exception('Variable already exists.');\n            }\n            $this->project->environment_variables()->create([\n                'key' => $data['key'],\n                'value' => $data['value'],\n                'is_multiline' => $data['is_multiline'],\n                'is_literal' => $data['is_literal'],\n                'comment' => $data['comment'] ?? null,\n                'type' => 'project',\n                'team_id' => currentTeam()->id,\n            ]);\n            $this->project->refresh();\n            $this->getDevView();\n        } catch (\\Throwable $e) {\n            return handleError($e, $this);\n        }\n    }\n\n    public function mount(?string $project_uuid = null)","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Livewire/SharedVariables/Project/Show.php#L11-L47","documentation":"Error \"Variable already exists.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Livewire/SharedVariables/Project/Show.php:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}