coollabsio/coolify · error · RuntimeException

Cannot decrypt private key "{$key->name}" (uuid={$key->uuid}

Error message

Cannot decrypt private key "{$key->name}" (uuid={$key->uuid}). This instance APP_KEY does not match the key that encrypted the data (common after regenerating .dev-instances/*.env). Restore the original APP_KEY or re-save the private key material. Original error: {$e->getMessage()}

What it means

Error "Cannot decrypt private key "{$key->name}" (uuid={$key->uuid}). This instance APP_KEY does not match the key that encrypted the data (common after regenerating .dev-instances/*.env). Restore the original APP_KEY or re-save the private key material. Original error: {$e->getMessage()}" thrown in coollabsio/coolify.

Source

Thrown at app/Services/ServerTransfer/ServerTransferExporter.php:342

                ."({$sourceInstanceUrl}/webhooks/source/gitlab/events — use the new FQDN) and refresh OAuth tokens if needed.";
        }

        if ($dependencies['s3_storages']->isNotEmpty()) {
            $warnings[] = 'S3 storage credentials were exported. Confirm endpoint access from the target instance and that bucket policies still apply.';
        }

        return $warnings;
    }

    /**
     * @return array<string, mixed>
     */
    private function exportPrivateKey(PrivateKey $key): array
    {
        try {
            $material = $key->private_key;
        } catch (\Throwable $e) {
            throw new RuntimeException(
                "Cannot decrypt private key \"{$key->name}\" (uuid={$key->uuid}). "
                .'This instance APP_KEY does not match the key that encrypted the data '
                .'(common after regenerating .dev-instances/*.env). '
                .'Restore the original APP_KEY or re-save the private key material. '
                .'Original error: '.$e->getMessage(),
                previous: $e
            );
        }

        return [
            'uuid' => $key->uuid,
            'name' => $key->name,
            'description' => $key->description,
            'private_key' => $material,
            'is_git_related' => (bool) $key->is_git_related,
            'fingerprint' => $key->fingerprint,
        ];
    }

View on GitHub (pinned to 70b9acc424)

When it happens

Trigger: Thrown at app/Services/ServerTransfer/ServerTransferExporter.php:342 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/2e872ec8756c1db3. Report an issue: GitHub.