{"record":{"id":"39a37f253a62557e","repo":"coollabsio/coolify","slug":"invalid-encrypted-payload","errorCode":null,"errorMessage":"Invalid encrypted payload.","messagePattern":"Invalid encrypted payload\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferBundle.php","lineNumber":137,"sourceCode":"            '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')) {\n            throw new RuntimeException('Bundle is not encrypted.');\n        }\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);","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferBundle.php#L119-L155","documentation":"Error \"Invalid encrypted payload.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferBundle.php:137 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"}