coollabsio/coolify · error · RuntimeException

Passphrase must not be empty.

Error message

Passphrase must not be empty.

What it means

Error "Passphrase must not be empty." thrown in coollabsio/coolify.

Source

Thrown at app/Services/ServerTransfer/ServerTransferBundle.php:105

    {
        $result = self::validate($bundle);
        if (! $result['valid']) {
            throw ValidationException::withMessages([
                'bundle' => $result['errors'],
            ]);
        }
    }

    /**
     * Encrypt an entire bundle for mailbox/API transport with a user passphrase.
     *
     * @param  array<string, mixed>  $bundle
     * @return array{encrypted: true, schema_version: int, payload: string}
     */
    public static function encryptWithPassphrase(array $bundle, string $passphrase): array
    {
        if ($passphrase === '') {
            throw new RuntimeException('Passphrase must not be empty.');
        }

        $json = json_encode($bundle, JSON_THROW_ON_ERROR);
        $key = hash('sha256', $passphrase, true);
        $iv = random_bytes(16);
        $cipher = openssl_encrypt($json, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);
        if ($cipher === false) {
            throw new RuntimeException('Failed to encrypt transfer bundle.');
        }

        $mac = hash_hmac('sha256', $iv.$cipher, $key);

        return [
            'encrypted' => true,
            'schema_version' => self::SCHEMA_VERSION,
            'payload' => base64_encode($iv.$mac.$cipher),
        ];
    }

View on GitHub (pinned to 70b9acc424)

When it happens

Trigger: Thrown at app/Services/ServerTransfer/ServerTransferBundle.php:105 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of coollabsio/coolify@70b9acc424 (2026-08-17). Data as JSON: /api/errors/8a9a18fc76784b8f. Report an issue: GitHub.