{"record":{"id":"651753633f351b19","repo":"coollabsio/coolify","slug":"server-not-found-651753","errorCode":null,"errorMessage":"Server not found.","messagePattern":"Server not found\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Livewire/Destination/New/Docker.php","lineNumber":51,"sourceCode":"    public bool $isSwarm = false;\n\n    public function mount(?string $server_id = null): void\n    {\n        $this->network = new_public_id();\n        $this->servers = Server::isUsable()->get();\n\n        if (filled($server_id)) {\n            $this->selectedServer = Server::ownedByCurrentTeam()->whereKey($server_id)->firstOrFail();\n\n            if (! $this->servers->contains('id', $this->selectedServer->id)) {\n                $this->servers->push($this->selectedServer);\n            }\n\n            $this->serverId = (string) $this->selectedServer->id;\n        } else {\n            $foundServer = $this->servers->first();\n            if (! $foundServer) {\n                throw new \\Exception('Server not found.');\n            }\n            $this->selectedServer = $foundServer;\n            $this->serverId = (string) $this->selectedServer->id;\n        }\n        $this->generateName();\n    }\n\n    public function updatedServerId(): void\n    {\n        $this->selectedServer = $this->servers->find($this->serverId);\n        if (! $this->selectedServer) {\n            throw new \\Exception('Server not found.');\n        }\n        $this->generateName();\n    }\n\n    public function generateName(): void\n    {","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Livewire/Destination/New/Docker.php#L33-L69","documentation":"The 'new Docker destination' component loads the current team's servers (Server::ownedByCurrentTeam). When no server_id parameter is supplied and the collection is empty, it throws instead of rendering a picker with no options.","triggerScenarios":"Opening destination creation before the team has registered any server; all team servers deleted; the servers collection filtered to nothing.","commonSituations":"Fresh Coolify install where onboarding was skipped; a second team without servers; deep link to the destination page after the last server was removed.","solutions":["Register a server first (Servers > Add new server), then create the Docker network destination","If a server should be visible, verify it belongs to the current team and was not deleted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// guard before rendering the destination form\nif (Server::ownedByCurrentTeam()->doesntExist()) {\n    return redirect()->route('server.create')\n        ->with('message', 'Add a server before creating a destination.');\n}","typeGuard":"function teamHasServers(): bool\n{\n    return Server::ownedByCurrentTeam()->exists();\n}","tryCatchPattern":null,"preventionTips":["Complete onboarding (or add at least one server) before creating Docker network destinations","When a team shows no servers, verify team membership before assuming a bug"],"tags":["livewire","destination","server","onboarding","empty-collection"],"backgroundTag":"resource-not-in-scope","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}