{"record":{"id":"ff4fcc23046bfd88","repo":"coollabsio/coolify","slug":"server-has-no-private-key-to-export","errorCode":null,"errorMessage":"Server has no private key to export.","messagePattern":"Server has no private key to export\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferExporter.php","lineNumber":86,"sourceCode":"        'additional_servers_count',\n        'additional_networks_count',\n        'server_status',\n    ];\n\n    /**\n     * @return array<string, mixed>\n     */\n    public function export(Server $server, bool $includeSensitive = true): array\n    {\n        if ($server->id === 0) {\n            throw new RuntimeException('The Coolify host (localhost) cannot be transferred between instances.');\n        }\n\n        $server->loadMissing(['settings', 'privateKey', 'standaloneDockers', 'swarmDockers', 'cloudProviderToken', 'sslCertificates']);\n\n        $privateKey = $server->privateKey;\n        if (! $privateKey instanceof PrivateKey) {\n            throw new RuntimeException('Server has no private key to export.');\n        }\n\n        if (! $includeSensitive) {\n            throw new RuntimeException('Server transfer export requires sensitive data access (read:sensitive).');\n        }\n\n        // applications() also includes multi-destination attachments on this server;\n        // unique by id so a multi-dest app is only considered once for validation/export.\n        $applications = $server->applications()->unique('id')->values();\n        $databases = collect($server->databases())->unique(fn ($db) => $db::class.':'.$db->id)->values();\n        $services = $server->services()->get()->unique('id')->values();\n\n        $this->assertNoAdditionalDestinations($server, $applications);\n\n        $projectIds = $this->collectProjectIds($applications, $databases, $services);\n        $projects = Project::query()->whereIn('id', $projectIds)->orderBy('name')->get();\n\n        $destinationUuidByKey = $this->destinationUuidMap($server);","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferExporter.php#L68-L104","documentation":"Error \"Server has no private key to export.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferExporter.php:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}