Skip to main content

Boot failure: An item with the same key has already been added. Key: System.Type

Why an Umbraco 17 site fails to boot with a duplicate System.Type Swagger mapping after Umbraco Deploy 17.3.0 or later is installed alongside Umbraco Automate 17.2.x or earlier, and how upgrading Umbraco Automate fixes it.

Written by Joana Knobbe

Type: Known Issue
​Category: Umbraco Cloud > Monitor & Troubleshoot
​Tags: boot failed, ArgumentException, An item with the same key has already been added, System.Type, Swagger, SwaggerGenOptions, MapType, Umbraco Deploy, Umbraco Automate, Umbraco.AI, auto-upgrade, site down, HTTP 500.30

Product: Umbraco Deploy, Umbraco Automate, Umbraco Cloud
​Version: Umbraco 17 (Deploy 17.3.0 and later, Automate 17.2.x and earlier)


Summary

If your Umbraco 17 site stopped starting after Umbraco Deploy was upgraded to 17.3.0 or later, and the log shows An item with the same key has already been added. Key: System.Type, you are most likely running an older version of Umbraco Automate. Upgrading Umbraco Automate to 17.3.0 or later fixes it.

Status: Resolved. Fixed in Umbraco Deploy 17.3.1 and Umbraco Automate 17.3.0.

Symptoms

  • The site fails to boot and returns an error on every request, front end and backoffice. On Umbraco Cloud this can show up as HTTP 500.30.

  • It started right after Umbraco Deploy was upgraded to 17.3.0 or later, for example during an Umbraco Cloud auto-upgrade.

  • The log file contains this exception:

ArgumentException: An item with the same key has already been added. Key: System.Type
System.Collections.Generic.Dictionary<TKey, TValue>.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
System.Collections.Generic.Dictionary<TKey, TValue>.Add(TKey key, TValue value)
Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(SwaggerGenOptions swaggerGenOptions, Type type, Func<IOpenApiSchema> schemaFactory)

If you only see a generic Boot failed page, see Boot failure shows no error details when debug mode is off to find the full exception.

Cause

Umbraco Deploy 17.3.0 added its APIs to the Swagger UI. As part of that, it tells Swagger how to describe the System.Type type. Umbraco Automate 17.2.x and earlier does the same. Swagger only accepts one mapping per type, so when the second package tries to add it, startup throws the exception above and the site never boots.

Both packages now check whether the mapping already exists before adding it:

  • Umbraco Deploy 17.3.1 skips the mapping if another package (such as Umbraco Automate or Umbraco.AI) has already added it.

  • Umbraco Automate 17.3.0 does the same on its side.

Because the packages can register in either order, you need both fixes. A site on Deploy 17.3.1 with Automate 17.2.x or earlier can still fail to boot.

Solution

Upgrade Umbraco Automate to 17.3.0 or later

We recommend the latest 17.x version.

  1. In your local copy of the project, update the Umbraco.Automate NuGet package, along with any other Umbraco.Automate.* add-on packages you use.

  2. Run the site locally and check that it boots.

  3. Commit and push the change. On Umbraco Cloud, deploy it through your environments to the affected environment.

On a self-hosted site, also check your Deploy version

If you are on Umbraco Deploy 17.3.0, upgrade to 17.3.1 or later as well. On Umbraco Cloud, Deploy is upgraded for you.

Still having issues?

If the site still fails to boot after upgrading, or the exception names a different type than System.Type, open a support ticket and include the full exception from the log file, the affected environment, and your CMS, Deploy, Automate and Umbraco.AI versions.

Recommended documentation


AI + Humans generated. Last updated on October 20, 2026

Did this answer your question?