{"record":{"id":"8a9a18fc76784b8f","repo":"coollabsio/coolify","slug":"passphrase-must-not-be-empty","errorCode":null,"errorMessage":"Passphrase must not be empty.","messagePattern":"Passphrase must not be empty\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferBundle.php","lineNumber":105,"sourceCode":"    {\n        $result = self::validate($bundle);\n        if (! $result['valid']) {\n            throw ValidationException::withMessages([\n                'bundle' => $result['errors'],\n            ]);\n        }\n    }\n\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    }","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferBundle.php#L87-L123","documentation":"Error \"Passphrase must not be empty.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferBundle.php:105 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"}