elsa-workflows/elsa-core · error · InvalidOperationException

The adapter type ' ' is not installed or deployment-allowed.

Error message

The adapter type '{adapterType}' is not installed or deployment-allowed.

What it means

AdapterSettingsMigrationService.MigrateAsync validates that the adapter type named in the stored settings exists in the registered adapter registry before running migration steps. If no installed/deployment-allowed adapter matches the type string, migration is aborted with this InvalidOperationException.

Solutions

  1. Install/register the adapter package for that type, or allow-list it for the deployment.
  2. Correct the adapterType string in the stored settings or the request to match a registered adapter.
  3. If the adapter was intentionally removed, delete or archive its stored settings instead of migrating.

Example fix

// before
await migrations.MigrateAsync("oidc-prox", version, settings);
// after
await migrations.MigrateAsync("oidc-proxy", version, settings);
Defensive patterns

Strategy: try-catch

Validate before calling

if (!adapters.TryGet(adapterType, out _))
    throw new InvalidOperationException($"Adapter '{adapterType}' is not registered; install it or fix the type string.");

Try / catch

try { await service.MigrateAsync(type, version, settings); }
catch (InvalidOperationException ex) when (ex.Message.Contains("not installed or deployment-allowed"))
{ /* report missing adapter; skip or quarantine settings */ }

Prevention

When it happens

Trigger: Calling MigrateAsync (or the migration endpoint that surfaces it) with an adapterType that is not registered in the adapter registry — wrong type string, adapter package not installed, or adapter filtered out by deployment allow-listing.

Common situations: Renaming an adapter type without migrating stored settings; deploying a trimmed environment that excludes an adapter whose settings still exist in the database; typo in adapterType.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of elsa-workflows/elsa-core@fe9217bdfa (2026-09-13). Data as JSON: /api/errors/f15222dc5620e8d0. Report an issue: GitHub.

Appendix: source

Thrown at src/modules/Elsa.ExternalAuthentication/Services/AdapterSettingsMigrationService.cs:26

/// Orchestrates adapter-owned, forward-only settings migrations while preserving
/// the protocol-neutral connection envelope.
/// </summary>
public sealed class AdapterSettingsMigrationService(
    IExternalAuthenticationAdapterRegistry adapters,
    IEnumerable<IAdapterSettingsMigration> migrations) : IAdapterSettingsMigrationService
{
    private readonly IReadOnlyDictionary<(string AdapterType, int FromVersion), IAdapterSettingsMigration> _migrations =
        BuildMigrationIndex(migrations);

    public async ValueTask<AdapterSettingsMigrationResult> MigrateAsync(
        string adapterType,
        int settingsVersion,
        JsonElement settings,
        CancellationToken cancellationToken = default)
    {
        cancellationToken.ThrowIfCancellationRequested();
        if (!adapters.TryGet(adapterType, out var adapter))
            throw new InvalidOperationException($"The adapter type '{adapterType}' is not installed or deployment-allowed.");

        var currentVersion = adapter.Describe().SettingsVersion;
        if (settingsVersion <= 0 || settingsVersion > currentVersion)
            throw new InvalidOperationException($"Settings version {settingsVersion} is not compatible with adapter '{adapterType}' version {currentVersion}.");
        if (settingsVersion == currentVersion)
            return new(currentVersion, settings.Clone(), false);

        var migrated = settings.Clone();
        var version = settingsVersion;
        var stepCount = 0;
        while (version < currentVersion)
        {
            if (!_migrations.TryGetValue((adapterType, version), out var migration))
                throw new InvalidOperationException($"Adapter '{adapterType}' does not provide a settings migration from version {version}.");
            if (migration.ToVersion <= version || migration.ToVersion > currentVersion)
                throw new InvalidOperationException($"Adapter '{adapterType}' has an invalid settings migration from version {version} to {migration.ToVersion}.");
            if (++stepCount > 64)
                throw new InvalidOperationException($"Adapter '{adapterType}' settings migration contains a cycle.");

View on GitHub (pinned to fe9217bdfa)