iflytek/astron-agent · error
TENANT_ID must remain
Error message
TENANT_ID must remain %s because persisted bootstrap data refers to it
What it means
TenantBootstrapCredentials.Validate enforces that TenantID equals the hard-coded BootstrapTenantID ("680ab54f"), because persisted bootstrap data in MySQL references that tenant ID. Setting any other TENANT_ID would orphan existing bootstrap rows, so Validate deliberately rejects it with this message.
Solutions
- Remove the TENANT_ID environment variable so LoadTenantBootstrapCredentials defaults it to BootstrapTenantID ("680ab54f").
- If it must be set explicitly, set it to exactly "680ab54f".
- Do not attempt to change BootstrapTenantID unless you also migrate persisted bootstrap data referencing the old ID.
- Search deployment manifests (Helm values, docker-compose, k8s Secrets) for TENANT_ID and align them.
Example fix
// before (env) TENANT_ID=my-custom-tenant // after # TENANT_ID removed; defaults to 680ab54f
Defensive patterns
Strategy: validation
Validate before calling
const BootstrapTenantID = "680ab54f"
if v := os.Getenv("TENANT_ID"); v != "" && v != BootstrapTenantID {
log.Fatalf("TENANT_ID must be %s or unset", BootstrapTenantID)
} Prevention
- Never set TENANT_ID in deployment manifests; rely on the default.
- Grep manifests for TENANT_ID in CI to catch accidental overrides.
- Treat BootstrapTenantID as immutable infrastructure, like a database name.
When it happens
Trigger: LoadTenantBootstrapCredentials or reconcileTenantBootstrap(Transaction) or parseMysqlConfig calls Validate with credentials.TenantID != "680ab54f" — e.g. the TENANT_ID env var is set to a custom value (even after trimming whitespace).
Common situations: Operator sets TENANT_ID to their own tenant identifier assuming it is configurable; multi-tenant deployments reuse a shared manifest with a different TENANT_ID; a stale env var from another environment leaks into the tenant service.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- TENANT_KEY and TENANT_SECRET must be distinct values
- load tenant bootstrap credentials failed
- or is required
- must contain 32-50 valid UTF-8 characters
- must not contain control characters
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/e180a24303f9ce82.
Report an issue: GitHub.
Appendix: source
Thrown at core/tenant/config/bootstrap_credentials.go:64
return TenantBootstrapCredentials{}, err
}
credentials := TenantBootstrapCredentials{
TenantID: tenantID,
APIKey: apiKey,
Secret: secret,
}
if err := credentials.Validate(); err != nil {
return TenantBootstrapCredentials{}, err
}
return credentials, nil
}
// Validate enforces the storage and HTTP-header constraints shared by every
// bootstrap credential consumer.
func (credentials TenantBootstrapCredentials) Validate() error {
if credentials.TenantID != BootstrapTenantID {
return fmt.Errorf(
"TENANT_ID must remain %s because persisted bootstrap data refers to it",
BootstrapTenantID,
)
}
if err := validateCredential("TENANT_KEY", credentials.APIKey); err != nil {
return err
}
if err := validateCredential("TENANT_SECRET", credentials.Secret); err != nil {
return err
}
if credentials.APIKey == credentials.Secret {
return errors.New("TENANT_KEY and TENANT_SECRET must be distinct values")
}
if credentials.APIKey == LegacyTenantKey || credentials.Secret == LegacyTenantSecret {
return errors.New("published legacy tenant credentials cannot be used")
}
return nil
}View on GitHub (pinned to 5e758547a8)