coollabsio/coolify · error · Exception

Cannot create predefined variable.

Error message

Cannot create predefined variable.

What it means

Error "Cannot create predefined variable." thrown in coollabsio/coolify.

Source

Thrown at app/Livewire/SharedVariables/Server/Show.php:28

class Show extends Component
{
    use AuthorizesRequests;

    public Server $server;

    public string $view = 'normal';

    public ?string $variables = null;

    protected $listeners = ['refreshEnvs' => 'refreshEnvs', 'saveKey' => 'saveKey', 'environmentVariableDeleted' => 'refreshEnvs'];

    public function saveKey($data)
    {
        try {
            $this->authorize('update', $this->server);

            if (in_array($data['key'], ['COOLIFY_SERVER_UUID', 'COOLIFY_SERVER_NAME'])) {
                throw new \Exception('Cannot create predefined variable.');
            }

            $found = $this->server->environment_variables()->where('key', $data['key'])->first();
            if ($found) {
                throw new \Exception('Variable already exists.');
            }
            $this->server->environment_variables()->create([
                'key' => $data['key'],
                'value' => $data['value'],
                'is_multiline' => $data['is_multiline'],
                'is_literal' => $data['is_literal'],
                'comment' => $data['comment'] ?? null,
                'type' => 'server',
                'team_id' => currentTeam()->id,
            ]);
            $this->server->refresh();
            $this->getDevView();
        } catch (\Throwable $e) {

View on GitHub (pinned to 70b9acc424)

When it happens

Trigger: Thrown at app/Livewire/SharedVariables/Server/Show.php:28 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of coollabsio/coolify@70b9acc424 (2026-08-17). Data as JSON: /api/errors/00a9026ff775eafa. Report an issue: GitHub.