{"record":{"id":"5924d7f3e29f867f","repo":"dotnet/orleans","slug":"value-cannot-be-null-parameter-tablename","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'TableName')","messagePattern":"Value cannot be null\\. \\(Parameter 'TableName'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Azure/Shared/Storage/AzureTableDataManager.cs","lineNumber":65,"sourceCode":"\n        /// <summary> Logger for this table manager instance. </summary>\n        protected internal ILogger Logger { get; }\n\n        public AzureStoragePolicyOptions StoragePolicyOptions { get; }\n\n        public TableClient Table { get; private set; } = null!;\n\n        /// <summary>\n        /// Creates a new <see cref=\"AzureTableDataManager{T}\"/> instance.\n        /// </summary>\n        /// <param name=\"options\">Storage configuration.</param>\n        /// <param name=\"logger\">Logger to use.</param>\n        public AzureTableDataManager(AzureStorageOperationOptions options, ILogger logger)\n        {\n            this.options = options ?? throw new ArgumentNullException(nameof(options));\n\n            Logger = logger ?? throw new ArgumentNullException(nameof(logger));\n            TableName = options.TableName ?? throw new ArgumentNullException(nameof(options.TableName));\n            StoragePolicyOptions = options.StoragePolicyOptions ?? throw new ArgumentNullException(nameof(options.StoragePolicyOptions));\n\n            AzureTableUtils.ValidateTableName(TableName);\n        }\n\n        /// <summary>\n        /// Connects to, or creates and initializes a new Azure table if it does not already exist.\n        /// </summary>\n        /// <returns>Completion promise for this operation.</returns>\n        public async Task InitTableAsync()\n        {\n            const string operation = \"InitTable\";\n            var startTime = DateTime.UtcNow;\n\n            try\n            {\n                TableServiceClient tableCreationClient = await GetCloudTableCreationClientAsync();\n                var table = tableCreationClient.GetTableClient(TableName);","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureTableDataManager.cs#L47-L83","documentation":"Thrown by the AzureTableDataManager<T> constructor when options.TableName is null. The manager reads TableName from the options during construction and stores it; a null table name would break every subsequent table operation, so it is rejected here. (After this check the name is also validated against Azure table naming rules.)","triggerScenarios":"Constructing the manager with an AzureStorageOperationOptions whose TableName was never set.","commonSituations":"Forgetting to set TableName in the storage/clustering/reminders configuration callback; binding options from config that lacks the TableName key.","solutions":["Set options.TableName to a valid Azure table name before constructing/initializing the provider.","Bind TableName from configuration and validate its presence at startup.","Use the storage builder callback to assign TableName explicitly."],"exampleFix":"// before\nsilo.AddAzureTableGrainStorage(\"Default\", o => { o.TableServiceClient = client; /* no TableName */ });\n// after\nsilo.AddAzureTableGrainStorage(\"Default\", o =>\n{\n    o.TableServiceClient = client;\n    o.TableName = \"grainstate\";\n});","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(options.TableName)) throw new InvalidOperationException(\"TableName must be set\");","typeGuard":"static bool HasTableName(AzureStorageOperationOptions o) => !string.IsNullOrWhiteSpace(o.TableName);","tryCatchPattern":"catch (ArgumentNullException ex) when (ex.ParamName == \"options.TableName\") { /* set options.TableName before constructing */ }","preventionTips":["Always assign TableName in the storage builder callback.","Bind TableName from config and validate presence at startup."],"tags":["orleans","azure-storage","azure-table","configuration","argument"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}