coollabsio/coolify · error · Exception
Variable already exists.
Error message
Variable already exists.
What it means
Error "Variable already exists." thrown in coollabsio/coolify.
Source
Thrown at app/Livewire/SharedVariables/Environment/Show.php:36
public $environment;
public array $parameters;
public string $view = 'normal';
public ?string $variables = null;
protected $listeners = ['refreshEnvs' => 'refreshEnvs', 'saveKey', 'environmentVariableDeleted' => 'refreshEnvs'];
public function saveKey($data)
{
try {
$this->authorize('update', $this->environment);
$found = $this->environment->environment_variables()->where('key', $data['key'])->first();
if ($found) {
throw new \Exception('Variable already exists.');
}
$this->environment->environment_variables()->create([
'key' => $data['key'],
'value' => $data['value'],
'is_multiline' => $data['is_multiline'],
'is_literal' => $data['is_literal'],
'comment' => $data['comment'] ?? null,
'type' => 'environment',
'team_id' => currentTeam()->id,
]);
$this->environment->refresh();
$this->getDevView();
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
public function mount(?string $project_uuid = null, ?string $environment_uuid = null)View on GitHub (pinned to 70b9acc424)
When it happens
Trigger: Thrown at app/Livewire/SharedVariables/Environment/Show.php:36 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/3090958d3f5e002c.
Report an issue: GitHub.