temporalio/temporal · error
unable to get namespace details: %w
Error message
unable to get namespace details: %w
What it means
GenerateDeletedNamespaceNameActivity generates a new name for a namespace being deleted and confirms uniqueness via GetNamespace. On any error other than NamespaceNotFound or AlreadyExists-style collision handling, it logs and wraps the failure with this error, returning an empty namespace name. NamespaceNotFound is the expected success signal (name is free).
Source
Thrown at service/worker/deletenamespace/activities.go:206
suffix := fmt.Sprintf("-deleted-%s", nsID.String()[:suffixLength])
if strings.HasSuffix(nsName.String(), suffix) {
logger.Info("Namespace is already renamed for deletion")
return nsName, nil
}
newName := fmt.Sprintf("%s%s", nsName, suffix)
_, err := a.metadataManager.GetNamespace(ctx, &persistence.GetNamespaceRequest{
Name: newName,
})
switch err.(type) {
case nil:
logger.Warn("Regenerate namespace name due to collision.", tag.String("wf-new-namespace", newName))
case *serviceerror.NamespaceNotFound:
logger.Info("Generated new name for deleted namespace.", tag.String("wf-new-namespace", newName))
return namespace.Name(newName), nil
default:
logger.Error("Unable to get namespace details.", tag.Error(err))
return namespace.EmptyName, fmt.Errorf("unable to get namespace details: %w", err)
}
}
// Should never get here because namespace ID is guaranteed to be unique.
return namespace.EmptyName, fmt.Errorf("unable to generate new name for deleted namespace %s. ID %q is not unique", nsName, nsID)
}
func (a *localActivities) RenameNamespaceActivity(ctx context.Context, nsID namespace.ID, previousName namespace.Name, newName namespace.Name) error {
if newName == previousName {
return nil
}
ctx = headers.SetCallerName(ctx, previousName.String())
renameNamespaceRequest := &persistence.RenameNamespaceRequest{
PreviousName: previousName.String(),
NewName: newName.String(),
}View on GitHub (pinned to bde624efd1)
Solutions
- Retry the delete-namespace workflow once the underlying GetNamespace/persistence failure is resolved — the generation loop is idempotent.
- Inspect the wrapped error (and the logged tag.Error) to determine whether it's a persistence, timeout, or frontend lookup failure.
- Verify the frontend/namespace service is reachable from the worker executing this activity.
- Add a retry policy on this activity so transient lookups failures don't fail namespace deletion outright.
Example fix
// before
name, err := activities.GenerateDeletedNamespaceNameActivity(ctx, nsName, nsID) // transient GetNamespace error aborts
if err != nil {
return err
}
// after
err = workflow.ExecuteActivity(ctx, a.GenerateDeletedNamespaceNameActivity, nsName, nsID).Get(ctx, &name) // with RetryPolicy in ActivityOptions
if err != nil {
logger.Warn("namespace rename pending; will retry", tag.Error(err))
return err // workflow retry policy retries
} Defensive patterns
Strategy: retry
Validate before calling
// verify namespace frontend availability before the rename step
if _, err := frontendClient.GetNamespace(ctx, &frontendservice.GetNamespaceRequest{Namespace: nsName.String()}); err != nil {
var nf *serviceerror.NamespaceNotFound
if !errors.As(err, &nf) {
return fmt.Errorf("namespace lookup unhealthy; postpone deletion: %w", err)
}
} Try / catch
err := workflow.ExecuteActivity(ctx, a.GenerateDeletedNamespaceNameActivity, nsName, nsID).Get(ctx, &newName)
if err != nil {
if strings.Contains(err.Error(), "unable to get namespace details") {
logger.Warn("transient namespace lookup failure during rename; will retry", tag.Error(err))
return err // workflow-level retry
}
return err
} Prevention
- Use a retry policy on GenerateDeletedNamespaceNameActivity for transient lookup failures.
- Treat NamespaceNotFound as success (name is available) — only retry other error types.
- Check frontend service health before executing the delete-namespace workflow.
- Monitor GetNamespace latency/errors from the worker service.
When it happens
Trigger: The GetNamespace lookup performed inside the uniqueness-check loop returns an unexpected error — persistence failure, timeout, or any non-NamespaceNotFound service error — during deleted-namespace name generation.
Common situations: Frontend/persistence outage while running the delete-namespace workflow; namespace cache/persistence inconsistency; transient DB errors during the rename step of namespace deletion.
Related errors
- corrupted history event batch, wrong version and IDs
- corrupted history event batch, empty events
- page size to read history tasks must be positive
- history task from queue has nil blob
- enqueue task request task is nil
AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01).
Data as JSON: /api/errors/c5fcf435f6794841.
Report an issue: GitHub.