coollabsio/coolify · warning · Exception

Project with the same name already exists.

Error message

Project with the same name already exists.

What it means

When cloning as a new project, Coolify runs Project::where('name', $newName)->first() and refuses if any project with that name exists. Note from the source that the check is global - it is not scoped to the current team - so a name used by any project on the instance (including another team's) also triggers it.

Source

Thrown at app/Livewire/Project/CloneMe.php:108

        $this->server = $this->servers->where('id', $server_id)->first();
    }

    public function clone(string $type)
    {
        try {
            $this->authorize('create', Project::class);
            $this->validate([
                'selectedDestination' => 'required',
                'newName' => ValidationPatterns::nameRules(),
            ]);
            $selectedDestination = find_resource_destination_for_current_team($this->selectedDestination);
            if (! $selectedDestination) {
                throw new \Exception('Destination not found.');
            }
            if ($type === 'project') {
                $foundProject = Project::where('name', $this->newName)->first();
                if ($foundProject) {
                    throw new \Exception('Project with the same name already exists.');
                }
                $project = Project::create([
                    'name' => $this->newName,
                    'team_id' => currentTeam()->id,
                    'description' => $this->project->description.' (clone)',
                ]);
                if ($this->environment->name !== 'production') {
                    $project->environments()->create([
                        'name' => $this->environment->name,
                        'uuid' => new_public_id(),
                    ]);
                }
                $environment = $project->environments->where('name', $this->environment->name)->first();
            } else {
                $foundEnv = $this->project->environments()->where('name', $this->newName)->first();
                if ($foundEnv) {
                    throw new \Exception('Environment with the same name already exists.');
                }

View on GitHub (pinned to 70b9acc424)

Solutions

  1. Choose a different, more specific name for the clone
  2. If the collision is with an old copy, delete or rename that project first, then retry the clone

Example fix

// before - global uniqueness check
$foundProject = Project::where('name', $this->newName)->first();
// after - scope the check to the current team, matching how projects are listed
$foundProject = Project::ownedByCurrentTeam()->where('name', $this->newName)->first();
Defensive patterns

Strategy: validation

Validate before calling

// check names up front so the user gets inline feedback
$taken = Project::where('name', $newName)->exists(); // note: global, not team-scoped
if ($taken) {
    // suggest an available name like $newName.'-clone'

Type guard

function projectNameIsAvailable(string $name): bool
{
    return Project::where('name', $name)->doesntExist();
}

Prevention

When it happens

Trigger: Entering a clone name identical to an existing project's name anywhere on the instance; cloning twice with the same suggested name.

Common situations: Repeated clones colliding with earlier copies; multi-tenant instances where another team already took the name; default names like 'my-project-1' being common.

Related errors


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