{"record":{"id":"697f3b418ffd2659","repo":"OrchardCMS/OrchardCore","slug":"the-configured-identity-column-size-identitycolumnsize-is","errorCode":null,"errorMessage":"The configured identity column size '{identityColumnSize}' is invalid.","messagePattern":"The configured identity column size '(.+?)' is invalid\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/OrchardCore/OrchardCore.Data.Abstractions/ShellSettingsExtensions.cs","lineNumber":85,"sourceCode":"        }\n\n        return tableNameSeparator;\n    }\n\n    public static string GetIdentityColumnSize(this ShellSettings shellSettings)\n    {\n        var identityColumnSize = (!shellSettings.IsInitialized()\n            ? shellSettings[DefaultIdentityColumnSize]\n            : shellSettings[\"IdentityColumnSize\"])\n            ?.Trim();\n\n        if (string.IsNullOrEmpty(identityColumnSize))\n        {\n            identityColumnSize = !shellSettings.IsInitialized() ? nameof(Int64) : nameof(Int32);\n        }\n        else if (!s_identityColumnSizes.Contains(identityColumnSize))\n        {\n            throw new InvalidOperationException($\"The configured identity column size '{identityColumnSize}' is invalid.\");\n        }\n\n        return identityColumnSize;\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":91,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore/OrchardCore.Data.Abstractions/ShellSettingsExtensions.cs#L67-L91","documentation":"GetIdentityColumnSize reads 'IdentityColumnSize' from shell settings and accepts only the strings \"Int64\" or \"Int32\" (defaulting to Int64 for uninitialized default shells, Int32 otherwise). Any other value throws InvalidOperationException because the identity column SQL type cannot be derived from it.","triggerScenarios":"Configuring OrchardCore_Data_TableOptions:DefaultIdentityColumnSize (or per-tenant IdentityColumnSize) with a value outside {\"Int64\",\"Int32\"} — e.g. \"64\", \"BigInt\", \"long\" — then initializing a tenant or calling GetDatabaseTableOptions().","commonSituations":"Assuming the setting takes a numeric size or a SQL type name like BIGINT; case-sensitive mismatch expectations (compare uses exact strings 'Int64'/'Int32'); copy-paste from older docs using different naming.","solutions":["Set the value to exactly \"Int64\" or \"Int32\".","Remove the setting entirely to use the default (Int64 pre-setup, Int32 after).","Fix typos/casing in appsettings.json or the tenant settings file, then restart the tenant."],"exampleFix":"// before (appsettings.json)\n\"OrchardCore_Data_TableOptions\": { \"DefaultIdentityColumnSize\": \"BigInt\" }\n// after\n\"OrchardCore_Data_TableOptions\": { \"DefaultIdentityColumnSize\": \"Int64\" }","handlingStrategy":"validation","validationCode":"var size = config[\"OrchardCore_Data_TableOptions:DefaultIdentityColumnSize\"]?.Trim();\nif (!string.IsNullOrEmpty(size) && size is not (\"Int64\" or \"Int32\"))\n    throw new InvalidOperationException($\"IdentityColumnSize '{size}' invalid; use 'Int64' or 'Int32'.\");","typeGuard":"bool IsValidIdentityColumnSize(string s) { s = s?.Trim(); return string.IsNullOrEmpty(s) || s is \"Int64\" or \"Int32\"; }","tryCatchPattern":"try { var opts = shellSettings.GetDatabaseTableOptions(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"identity column size\")) { _logger.LogCritical(ex, \"Fix IdentityColumnSize in tenant settings\"); throw; }","preventionTips":["Use exactly \"Int64\" or \"Int32\" (C# type names), not SQL names like BIGINT.","Omit the setting to accept defaults unless you need smaller keys.","Add config schema validation to CI for tenant settings files.","Document accepted values in your deployment runbook."],"tags":["configuration","database","identity-column","startup"],"backgroundTag":"invalid-config-value","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}