{"record":{"id":"2e872ec8756c1db3","repo":"coollabsio/coolify","slug":"cannot-decrypt-private-key-key-name-uuid","errorCode":null,"errorMessage":"Cannot decrypt private key \"{$key->name}\" (uuid={$key->uuid}). This instance APP_KEY does not match the key that encrypted the data (common after regenerating .dev-instances/*.env). Restore the original APP_KEY or re-save the private key material. Original error: {$e->getMessage()}","messagePattern":"Cannot decrypt private key \"(.+?)\" \\(uuid=(.+?)\\)\\. This instance APP_KEY does not match the key that encrypted the data \\(common after regenerating \\.dev-instances/\\*\\.env\\)\\. Restore the original APP_KEY or re-save the private key material\\. Original error: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferExporter.php","lineNumber":342,"sourceCode":"                .\"({$sourceInstanceUrl}/webhooks/source/gitlab/events — use the new FQDN) and refresh OAuth tokens if needed.\";\n        }\n\n        if ($dependencies['s3_storages']->isNotEmpty()) {\n            $warnings[] = 'S3 storage credentials were exported. Confirm endpoint access from the target instance and that bucket policies still apply.';\n        }\n\n        return $warnings;\n    }\n\n    /**\n     * @return array<string, mixed>\n     */\n    private function exportPrivateKey(PrivateKey $key): array\n    {\n        try {\n            $material = $key->private_key;\n        } catch (\\Throwable $e) {\n            throw new RuntimeException(\n                \"Cannot decrypt private key \\\"{$key->name}\\\" (uuid={$key->uuid}). \"\n                .'This instance APP_KEY does not match the key that encrypted the data '\n                .'(common after regenerating .dev-instances/*.env). '\n                .'Restore the original APP_KEY or re-save the private key material. '\n                .'Original error: '.$e->getMessage(),\n                previous: $e\n            );\n        }\n\n        return [\n            'uuid' => $key->uuid,\n            'name' => $key->name,\n            'description' => $key->description,\n            'private_key' => $material,\n            'is_git_related' => (bool) $key->is_git_related,\n            'fingerprint' => $key->fingerprint,\n        ];\n    }","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferExporter.php#L324-L360","documentation":"Error \"Cannot decrypt private key \"{$key->name}\" (uuid={$key->uuid}). This instance APP_KEY does not match the key that encrypted the data (common after regenerating .dev-instances/*.env). Restore the original APP_KEY or re-save the private key material. Original error: {$e->getMessage()}\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferExporter.php:342 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"}