coollabsio/coolify · error · RuntimeException

Failed to decrypt transfer bundle.

Error message

Failed to decrypt transfer bundle.

What it means

Error "Failed to decrypt transfer bundle." thrown in coollabsio/coolify.

Source

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

        }

        $raw = base64_decode((string) data_get($encrypted, 'payload'), true);
        if ($raw === false || strlen($raw) < 48) {
            throw new RuntimeException('Invalid encrypted payload.');
        }

        $key = hash('sha256', $passphrase, true);
        $iv = substr($raw, 0, 16);
        $mac = substr($raw, 16, 64);
        $cipher = substr($raw, 80);
        $expectedMac = hash_hmac('sha256', $iv.$cipher, $key);
        if (! hash_equals($expectedMac, $mac)) {
            throw new RuntimeException('Invalid passphrase or corrupted bundle.');
        }

        $json = openssl_decrypt($cipher, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);
        if ($json === false) {
            throw new RuntimeException('Failed to decrypt transfer bundle.');
        }

        /** @var array<string, mixed> $bundle */
        $bundle = json_decode($json, true, 512, JSON_THROW_ON_ERROR);

        return $bundle;
    }

    /**
     * Optionally re-seal secrets with Laravel's app key for intermediate storage.
     * Prefer passphrase encryption for cross-instance transfers.
     *
     * @param  array<string, mixed>  $bundle
     */
    public static function sealWithAppKey(array $bundle): string
    {
        return Crypt::encryptString(json_encode($bundle, JSON_THROW_ON_ERROR));
    }

View on GitHub (pinned to 70b9acc424)

When it happens

Trigger: Thrown at app/Services/ServerTransfer/ServerTransferBundle.php:151 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/bed81dc34b2e1c76. Report an issue: GitHub.