{"record":{"id":"f15222dc5620e8d0","repo":"elsa-workflows/elsa-core","slug":"the-adapter-type-adaptertype-is-not-installed-or-deployment","errorCode":null,"errorMessage":"The adapter type '{adapterType}' is not installed or deployment-allowed.","messagePattern":"The adapter type '(.+?)' is not installed or deployment-allowed\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.ExternalAuthentication/Services/AdapterSettingsMigrationService.cs","lineNumber":26,"sourceCode":"/// Orchestrates adapter-owned, forward-only settings migrations while preserving\n/// the protocol-neutral connection envelope.\n/// </summary>\npublic sealed class AdapterSettingsMigrationService(\n    IExternalAuthenticationAdapterRegistry adapters,\n    IEnumerable<IAdapterSettingsMigration> migrations) : IAdapterSettingsMigrationService\n{\n    private readonly IReadOnlyDictionary<(string AdapterType, int FromVersion), IAdapterSettingsMigration> _migrations =\n        BuildMigrationIndex(migrations);\n\n    public async ValueTask<AdapterSettingsMigrationResult> MigrateAsync(\n        string adapterType,\n        int settingsVersion,\n        JsonElement settings,\n        CancellationToken cancellationToken = default)\n    {\n        cancellationToken.ThrowIfCancellationRequested();\n        if (!adapters.TryGet(adapterType, out var adapter))\n            throw new InvalidOperationException($\"The adapter type '{adapterType}' is not installed or deployment-allowed.\");\n\n        var currentVersion = adapter.Describe().SettingsVersion;\n        if (settingsVersion <= 0 || settingsVersion > currentVersion)\n            throw new InvalidOperationException($\"Settings version {settingsVersion} is not compatible with adapter '{adapterType}' version {currentVersion}.\");\n        if (settingsVersion == currentVersion)\n            return new(currentVersion, settings.Clone(), false);\n\n        var migrated = settings.Clone();\n        var version = settingsVersion;\n        var stepCount = 0;\n        while (version < currentVersion)\n        {\n            if (!_migrations.TryGetValue((adapterType, version), out var migration))\n                throw new InvalidOperationException($\"Adapter '{adapterType}' does not provide a settings migration from version {version}.\");\n            if (migration.ToVersion <= version || migration.ToVersion > currentVersion)\n                throw new InvalidOperationException($\"Adapter '{adapterType}' has an invalid settings migration from version {version} to {migration.ToVersion}.\");\n            if (++stepCount > 64)\n                throw new InvalidOperationException($\"Adapter '{adapterType}' settings migration contains a cycle.\");","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.ExternalAuthentication/Services/AdapterSettingsMigrationService.cs#L8-L44","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install/register the adapter package for that type, or allow-list it for the deployment.","Correct the adapterType string in the stored settings or the request to match a registered adapter.","If the adapter was intentionally removed, delete or archive its stored settings instead of migrating."],"exampleFix":"// before\nawait migrations.MigrateAsync(\"oidc-prox\", version, settings);\n// after\nawait migrations.MigrateAsync(\"oidc-proxy\", version, settings);","handlingStrategy":"try-catch","validationCode":"if (!adapters.TryGet(adapterType, out _))\n    throw new InvalidOperationException($\"Adapter '{adapterType}' is not registered; install it or fix the type string.\");","typeGuard":null,"tryCatchPattern":"try { await service.MigrateAsync(type, version, settings); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"not installed or deployment-allowed\"))\n{ /* report missing adapter; skip or quarantine settings */ }","preventionTips":["Keep adapter type strings in a shared constants class","Ensure adapter packages are in the deployment manifest","Don't delete stored settings' adapter types when removing packages"],"tags":["configuration","migration","adapter"],"backgroundTag":"resource-not-found","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}