{"record":{"id":"c49c5d493e30e7c2","repo":"juicedata/juicefs","slug":"unable-to-get-endpoint-of-container-s-w","errorCode":null,"errorMessage":"Unable to get endpoint of container %s: %w","messagePattern":"Unable to get endpoint of container (.+?): %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/azure.go","lineNumber":379,"sourceCode":"\t\tserviceURL := fmt.Sprintf(\"%s://%s.%s\", uri.Scheme, accountName, domain)\n\t\tclient, err := azblob.NewClient(serviceURL, tokenCred, azblobOptions())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Failed to create Azure blob client with token credential: %v\", err)\n\t\t}\n\t\treturn &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName, useTokenAuth: true}, nil\n\t}\n\n\t// Priority 3: Shared key authentication\n\tcredential, err := azblob.NewSharedKeyCredential(accountName, accountKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdomain := domainFromHost(hostParts)\n\tif domain == \"\" {\n\t\tif domain, err = autoWasbEndpoint(accountName, uri.Scheme, func(serviceURL string) (*azblob.Client, error) {\n\t\t\treturn azblob.NewClientWithSharedKeyCredential(serviceURL, credential, nil)\n\t\t}); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Unable to get endpoint of container %s: %w\", containerName, err)\n\t\t}\n\t}\n\tclient, err := azblob.NewClientWithSharedKeyCredential(fmt.Sprintf(\"%s://%s.%s\", uri.Scheme, accountName, domain), credential, azblobOptions())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName}, nil\n}\n\nfunc init() {\n\tRegister(\"wasb\", newWasb)\n}\n","sourceCodeStart":361,"sourceCodeEnd":392,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/azure.go#L361-L392","documentation":"autoWasbEndpoint probe failure on the shared-key branch: probing with azblob.NewClientWithSharedKeyCredential failed, so the storage domain for the account could not be determined. Uses %w so the underlying error is unwrappable.","triggerScenarios":"newWasb with accountName+accountKey and an endpoint host lacking a recognized azure domain; the probe request errors (network, DNS, or signature/permission failure).","commonSituations":"Wrong account key causing 403 on the probe; endpoint host like 'myaccount' with no suffix; account name typo; restricted network egress.","solutions":["Provide the full domain in the endpoint (myaccount.blob.core.windows.net) to skip the probe.","Verify the account key matches the account (a bad key makes the probe fail with auth errors).","Check network/DNS access to the blob endpoint.","Use errors.Is/As on the wrapped error to distinguish network vs auth causes."],"exampleFix":"// before\nazblob://myaccount\n// after\nazblob://myaccount.blob.core.windows.net","handlingStrategy":"validation","validationCode":"u, err := url.Parse(endpoint)\nif err != nil || !strings.Contains(u.Host, \".\") {\n    return errors.New(\"use full domain endpoint to avoid probe: account.blob.core.windows.net\")\n}\nif accountKey == \"\" { return errors.New(\"account key required for shared-key auth\") }","typeGuard":null,"tryCatchPattern":"if domain, err = autoWasbEndpoint(...); err != nil {\n    var respErr *azcore.ResponseError\n    if errors.As(err, &respErr) && respErr.StatusCode == 403 {\n        return fmt.Errorf(\"probe auth failed: check account key for %s\", containerName)\n    }\n    return fmt.Errorf(\"endpoint probe failed: %w\", err)\n}","preventionTips":["Provide the full domain in the endpoint","Double-check the account key matches the account","Ensure egress to *.blob.core.windows.net is allowed"],"tags":["azure","shared-key","endpoint-discovery","network"],"backgroundTag":"endpoint-discovery-failed","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"}