dotnet/orleans · error · OrleansException

Unable to create or connect to the Azure table in {StoragePo

Error message

Unable to create or connect to the Azure table in {StoragePolicyOptions.CreationTimeout}

What it means

Thrown by AzureTableDataManager.InitTableAsync when creating/connecting to the Azure table times out, i.e. the underlying CreateIfNotExistsAsync raises a TimeoutException within StoragePolicyOptions.CreationTimeout. The original TimeoutException is wrapped in an OrleansException whose message echoes the configured CreationTimeout. This blocks table initialization and therefore grain activation for that storage.

Source

Thrown at src/Azure/Shared/Storage/AzureTableDataManager.cs:93

        public async Task InitTableAsync()
        {
            const string operation = "InitTable";
            var startTime = DateTime.UtcNow;

            try
            {
                TableServiceClient tableCreationClient = await GetCloudTableCreationClientAsync();
                var table = tableCreationClient.GetTableClient(TableName);
                var response = await table.CreateIfNotExistsAsync();
                var alreadyExisted = response.GetRawResponse().Status == (int)HttpStatusCode.Conflict;

                LogInfoTableCreation(Logger, alreadyExisted ? "Attached to" : "Created", TableName);
                Table = table;
            }
            catch (TimeoutException te)
            {
                LogErrorTableCreationInTimeout(Logger, te, StoragePolicyOptions.CreationTimeout);
                throw new OrleansException($"Unable to create or connect to the Azure table in {StoragePolicyOptions.CreationTimeout}", te);
            }
            catch (Exception exc)
            {
                LogErrorTableCreation(Logger, exc, TableName);
                throw;
            }
            finally
            {
                CheckAlertSlowAccess(startTime, operation);
            }
        }

        /// <summary>
        /// Deletes the Azure table.
        /// </summary>
        /// <returns>Completion promise for this operation.</returns>
        public async Task DeleteTableAsync()
        {

View on GitHub (pinned to fca799fa70)

Solutions

  1. Increase StoragePolicyOptions.CreationTimeout to allow for slow first-time table creation.
  2. Verify connectivity, endpoint URL, credentials, and that the storage account is reachable from the host.
  3. Pre-create the table out-of-band so InitTable only attaches, and check for throttling/network restrictions.
  4. Retry startup after confirming DNS/firewall allow egress to table.core.windows.net.

Example fix

// before
builder.AddAzureTableGrainStorage("Default", o =>
{
    o.TableServiceClient = client;
    o.TableName = "grainstate";
    // CreationTimeout left very small / network slow
});
// after
builder.AddAzureTableGrainStorage("Default", o =>
{
    o.TableServiceClient = client;
    o.TableName = "grainstate";
    o.StoragePolicyOptions.CreationTimeout = TimeSpan.FromMinutes(2);
});
Defensive patterns

Strategy: retry

Validate before calling

if (options.StoragePolicyOptions.CreationTimeout < TimeSpan.FromSeconds(30))
    options.StoragePolicyOptions.CreationTimeout = TimeSpan.FromMinutes(2);

Type guard

static bool EndpointReachable(Uri u) => /* quick TCP/DNS probe */ true;

Try / catch

catch (OrleansException ex) when (ex.InnerException is TimeoutException) { /* raise CreationTimeout, verify connectivity/credentials, then retry startup */ }

Prevention

When it happens

Trigger: Slow or unreachable Azure Table endpoint; throttling; network/DNS latency exceeding CreationTimeout; misconfigured endpoint; table create racing against throttling. The catch specifically matches TimeoutException and re-throws as OrleansException.

Common situations: Local dev pointing at a wrong/non-existent account; network egress restrictions; CreationTimeout too small for cold-start table creation; Azure-side throttling during heavy parallel init.

Understand the failure class

Related errors


AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13). Data as JSON: /api/errors/2a39db6e0dea22db. Report an issue: GitHub.