{"record":{"id":"074e18743d1e2fe1","repo":"coollabsio/coolify","slug":"failed-to-encrypt-transfer-bundle","errorCode":null,"errorMessage":"Failed to encrypt transfer bundle.","messagePattern":"Failed to encrypt transfer bundle\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferBundle.php","lineNumber":113,"sourceCode":"\n    /**\n     * Encrypt an entire bundle for mailbox/API transport with a user passphrase.\n     *\n     * @param  array<string, mixed>  $bundle\n     * @return array{encrypted: true, schema_version: int, payload: string}\n     */\n    public static function encryptWithPassphrase(array $bundle, string $passphrase): array\n    {\n        if ($passphrase === '') {\n            throw new RuntimeException('Passphrase must not be empty.');\n        }\n\n        $json = json_encode($bundle, JSON_THROW_ON_ERROR);\n        $key = hash('sha256', $passphrase, true);\n        $iv = random_bytes(16);\n        $cipher = openssl_encrypt($json, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);\n        if ($cipher === false) {\n            throw new RuntimeException('Failed to encrypt transfer bundle.');\n        }\n\n        $mac = hash_hmac('sha256', $iv.$cipher, $key);\n\n        return [\n            'encrypted' => true,\n            'schema_version' => self::SCHEMA_VERSION,\n            'payload' => base64_encode($iv.$mac.$cipher),\n        ];\n    }\n\n    /**\n     * @param  array<string, mixed>  $encrypted\n     * @return array<string, mixed>\n     */\n    public static function decryptWithPassphrase(array $encrypted, string $passphrase): array\n    {\n        if (! data_get($encrypted, 'encrypted')) {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferBundle.php#L95-L131","documentation":"Error \"Failed to encrypt transfer bundle.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferBundle.php:113 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"}