{"record":{"id":"bed81dc34b2e1c76","repo":"coollabsio/coolify","slug":"failed-to-decrypt-transfer-bundle","errorCode":null,"errorMessage":"Failed to decrypt transfer bundle.","messagePattern":"Failed to decrypt transfer bundle\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferBundle.php","lineNumber":151,"sourceCode":"        }\n\n        $raw = base64_decode((string) data_get($encrypted, 'payload'), true);\n        if ($raw === false || strlen($raw) < 48) {\n            throw new RuntimeException('Invalid encrypted payload.');\n        }\n\n        $key = hash('sha256', $passphrase, true);\n        $iv = substr($raw, 0, 16);\n        $mac = substr($raw, 16, 64);\n        $cipher = substr($raw, 80);\n        $expectedMac = hash_hmac('sha256', $iv.$cipher, $key);\n        if (! hash_equals($expectedMac, $mac)) {\n            throw new RuntimeException('Invalid passphrase or corrupted bundle.');\n        }\n\n        $json = openssl_decrypt($cipher, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);\n        if ($json === false) {\n            throw new RuntimeException('Failed to decrypt transfer bundle.');\n        }\n\n        /** @var array<string, mixed> $bundle */\n        $bundle = json_decode($json, true, 512, JSON_THROW_ON_ERROR);\n\n        return $bundle;\n    }\n\n    /**\n     * Optionally re-seal secrets with Laravel's app key for intermediate storage.\n     * Prefer passphrase encryption for cross-instance transfers.\n     *\n     * @param  array<string, mixed>  $bundle\n     */\n    public static function sealWithAppKey(array $bundle): string\n    {\n        return Crypt::encryptString(json_encode($bundle, JSON_THROW_ON_ERROR));\n    }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferBundle.php#L133-L169","documentation":"Error \"Failed to decrypt transfer bundle.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferBundle.php:151 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"}