{"record":{"id":"42b839b99cb58d25","repo":"coollabsio/coolify","slug":"destination-not-found","errorCode":null,"errorMessage":"Destination not found.","messagePattern":"Destination not found\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Livewire/Project/CloneMe.php","lineNumber":103,"sourceCode":"\n            return;\n        }\n        $this->selectedServer = $server_id;\n        $this->selectedDestination = $destination_uuid;\n        $this->server = $this->servers->where('id', $server_id)->first();\n    }\n\n    public function clone(string $type)\n    {\n        try {\n            $this->authorize('create', Project::class);\n            $this->validate([\n                'selectedDestination' => 'required',\n                'newName' => ValidationPatterns::nameRules(),\n            ]);\n            $selectedDestination = find_resource_destination_for_current_team($this->selectedDestination);\n            if (! $selectedDestination) {\n                throw new \\Exception('Destination not found.');\n            }\n            if ($type === 'project') {\n                $foundProject = Project::where('name', $this->newName)->first();\n                if ($foundProject) {\n                    throw new \\Exception('Project with the same name already exists.');\n                }\n                $project = Project::create([\n                    'name' => $this->newName,\n                    'team_id' => currentTeam()->id,\n                    'description' => $this->project->description.' (clone)',\n                ]);\n                if ($this->environment->name !== 'production') {\n                    $project->environments()->create([\n                        'name' => $this->environment->name,\n                        'uuid' => new_public_id(),\n                    ]);\n                }\n                $environment = $project->environments->where('name', $this->environment->name)->first();","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Livewire/Project/CloneMe.php#L85-L121","documentation":"Before cloning a project or environment, clone() resolves the selected destination UUID via find_resource_destination_for_current_team(). A null result - stale select value, deleted destination, or destination belonging to another team - throws before any resources are copied.","triggerScenarios":"The destination select holds a UUID that no longer resolves for the current team: the destination or its server was deleted since the page loaded, or the selection state is empty/stale despite the required rule.","commonSituations":"Destination removed in another tab while the clone dialog was open; cloning after deleting a server; long-lived modal state on the project page.","solutions":["Reload the clone dialog and pick a destination that still exists","Verify under the team's servers/destinations that the target destination is present","Re-create the destination (network) if it was removed unintentionally"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before clone(), confirm the destination resolves for the team\nif (! find_resource_destination_for_current_team($this->selectedDestination)) {\n    // repopulate the destination select from fresh data and ask the user to re-pick\n}","typeGuard":"function destinationResolvesForTeam(string $uuid): bool\n{\n    return find_resource_destination_for_current_team($uuid) !== null;\n}","tryCatchPattern":null,"preventionTips":["Reload the clone dialog after destination or server deletions elsewhere in the UI","Re-fetch selectable destinations on modal open rather than caching them in component state","Re-check the destination immediately before the copy loop, not only at form render"],"tags":["livewire","clone","destination","stale-state"],"backgroundTag":"resource-not-in-scope","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}