{"record":{"id":"03847c433bf69d6c","repo":"juicedata/juicefs","slug":"tierid-d-not-found-for-s","errorCode":null,"errorMessage":"tierID:%d not found for %s","messagePattern":"tierID:(.+?) not found for (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/azure.go","lineNumber":136,"sourceCode":"\t\tparts := strings.SplitN(t.Tag, \"=\", 2)\n\t\toptions.Tags = map[string]string{parts[0]: parts[1]}\n\t}\n\tresp, err := b.azblobCli.UploadStream(ctx, b.cName, key, data, &options)\n\tattrs := ApplyGetters(getters...)\n\tattrs.SetRequestID(aws.ToString(resp.RequestID)).SetStorageClass(t.Sc)\n\treturn err\n}\n\nfunc (b *wasb) Copy(ctx context.Context, dst, src string) error {\n\t// If a tier ID is provided in the context and the source and destination are the same,\n\t// we interpret this as a request to change the storage class (tier) of the existing blob without copying.\n\t// In this case, we call SetTier on the blob client instead of performing a copy operation.\n\tif id, ok := ctx.Value(TierKey{}).(uint8); ok && src == dst {\n\t\tblobClient := b.azblobCli.ServiceClient().NewContainerClient(b.cName).NewBlobClient(src)\n\t\tif t, ok := b.tiers[id]; ok {\n\t\t\ttier := str2Tier(t.Sc)\n\t\t\tif tier == nil {\n\t\t\t\treturn fmt.Errorf(\"tierID:%d not found for %s\", id, src)\n\t\t\t}\n\t\t\tif _, err := blobClient.SetTier(ctx, *tier, &blob2.SetTierOptions{}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif t.Tag != \"\" && ValidateTag(t.Tag) {\n\t\t\t\tparts := strings.SplitN(t.Tag, \"=\", 2)\n\t\t\t\tif len(parts) == 2 {\n\t\t\t\t\tif _, err := blobClient.SetTags(ctx, map[string]string{parts[0]: parts[1]}, nil); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"invalid tier id: %d\", id)\n\t\t}\n\t\treturn nil\n\t}\n\tdstCli := b.container.NewBlobClient(dst)","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/azure.go#L118-L154","documentation":"In azure.go Copy(), when the request context carries a TierKey and src == dst, the code performs a SetTier operation on the blob instead of a copy. The target access tier is looked up in the configured b.tiers map by tier id; this error is returned when str2Tier cannot map the configured storage-class string to an azblob access tier, meaning the tier entry is invalid for Azure.","triggerScenarios":"A write/context request sets a tier id whose b.tiers entry has a storage class string not recognized by str2Tier (e.g. an S3-style class like STANDARD_IA configured on an Azure backend).","commonSituations":"Configuring a JuiceFS volume's storage-class/tier list with class names copied from an S3 backend and reusing it against Azure Blob Storage; typo'd or localized tier names in the tiers config.","solutions":["Fix the storage class string for that tier id to a valid Azure access tier (Hot, Cool, Cold, Archive)","Review the tiers configuration passed to newAzureBlob / the volume format --storage-class values","Check str2Tier in pkg/object/azure.go for the accepted class names and align your config","If the tier is intentionally unsupported, remove that tier id from the config rather than referencing it"],"exampleFix":"// before (S3-style class on Azure)\ntiers: {2: {Sc: \"STANDARD_IA\"}}\n// after\ntiers: {2: {Sc: \"Cool\"}}","handlingStrategy":"validation","validationCode":"for id, t := range cfg.Tiers {\n  if str2Tier(t.Sc) == nil { return fmt.Errorf(\"tier %d has unsupported Azure class %q\", id, t.Sc) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only Azure access tier names (Hot, Cool, Cold, Archive) for Azure backends","Don't copy S3 storage-class configs onto Azure volumes","Validate tier configs at volume format time"],"tags":["azure","blob-storage","tiering","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}