{"record":{"id":"00a9026ff775eafa","repo":"coollabsio/coolify","slug":"cannot-create-predefined-variable","errorCode":null,"errorMessage":"Cannot create predefined variable.","messagePattern":"Cannot create predefined variable\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Livewire/SharedVariables/Server/Show.php","lineNumber":28,"sourceCode":"class Show extends Component\n{\n    use AuthorizesRequests;\n\n    public Server $server;\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->server);\n\n            if (in_array($data['key'], ['COOLIFY_SERVER_UUID', 'COOLIFY_SERVER_NAME'])) {\n                throw new \\Exception('Cannot create predefined variable.');\n            }\n\n            $found = $this->server->environment_variables()->where('key', $data['key'])->first();\n            if ($found) {\n                throw new \\Exception('Variable already exists.');\n            }\n            $this->server->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' => 'server',\n                'team_id' => currentTeam()->id,\n            ]);\n            $this->server->refresh();\n            $this->getDevView();\n        } catch (\\Throwable $e) {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Livewire/SharedVariables/Server/Show.php#L10-L46","documentation":"Error \"Cannot create predefined variable.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Livewire/SharedVariables/Server/Show.php:28 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"}