hashicorp/terraform · error

populating details for %s: `model.Properties.PrimaryEndpoint

Error message

populating details for %s: `model.Properties.PrimaryEndpoints` was nil

What it means

Even when Properties is present, PrimaryEndpoints may be nil. populateAccountDetails (storage_client_helpers.go:127) needs it to build blob/dfs/etc. endpoints, so a nil value is fatal.

Source

Thrown at internal/backend/remote-state/azure/storage_client_helpers.go:127

	}

	if baseUri == nil {
		return nil, fmt.Errorf("determining %s endpoint for %s: missing primary endpoint", endpointType, ad.StorageAccountId)
	}
	return baseUri, nil
}

func populateAccountDetails(accountId commonids.StorageAccountId, account storageaccounts.StorageAccount) (*AccountDetails, error) {
	out := AccountDetails{
		Kind:             pointer.From(account.Kind),
		StorageAccountId: accountId,
	}

	if account.Properties == nil {
		return nil, fmt.Errorf("populating details for %s: `model.Properties` was nil", accountId)
	}
	if account.Properties.PrimaryEndpoints == nil {
		return nil, fmt.Errorf("populating details for %s: `model.Properties.PrimaryEndpoints` was nil", accountId)
	}

	props := *account.Properties
	out.IsHnsEnabled = pointer.From(props.IsHnsEnabled)

	endpoints := *props.PrimaryEndpoints
	if endpoints.Blob != nil {
		endpoint := strings.TrimSuffix(*endpoints.Blob, "/")
		out.primaryBlobEndpoint = pointer.To(endpoint)
	}
	if endpoints.Dfs != nil {
		endpoint := strings.TrimSuffix(*endpoints.Dfs, "/")
		out.primaryDfsEndpoint = pointer.To(endpoint)
	}
	if endpoints.File != nil {
		endpoint := strings.TrimSuffix(*endpoints.File, "/")
		out.primaryFileEndpoint = pointer.To(endpoint)
	}

View on GitHub (pinned to c9def3e214)

Solutions

  1. Wait for the storage account to finish provisioning and retry.
  2. Verify the account provisioning state is Succeeded.
  3. On sovereign clouds, confirm the environment metadata is correct and complete.
Defensive patterns

Strategy: validation

Validate before calling

# confirm PrimaryEndpoints is populated before running
az storage account show --name <acct> --resource-group <rg> \
  --query "primaryEndpoints" --output tsv | grep -q '.' \
  || echo "WARN: storage account PrimaryEndpoints is empty"

Type guard

// guard populateAccountDetails against nil PrimaryEndpoints
func hasPrimaryEndpoints(a storageaccounts.StorageAccount) bool {
    return a.Properties != nil && a.Properties.PrimaryEndpoints != nil
}

Prevention

When it happens

Trigger: ARM returns Properties but no PrimaryEndpoints object, so populateAccountDetails cannot derive the data-plane endpoints.

Common situations: Provisioning race (account created but endpoints not yet populated); AzureStack/sovereign cloud returning a reduced shape; account in a failed provisioning state.

Related errors


AI-assisted analysis of hashicorp/terraform@c9def3e214 (2026-08-07). Data as JSON: /api/errors/2ae8af439a3acbf9. Report an issue: GitHub.