{"record":{"id":"f106255bf749c208","repo":"juicedata/juicefs","slug":"unable-to-get-endpoint-of-container-s-s","errorCode":null,"errorMessage":"Unable to get endpoint of container %s: %s","messagePattern":"Unable to get endpoint of container (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/azure.go","lineNumber":339,"sourceCode":"\t\tif client, err = azblob.NewClientFromConnectionString(connString, azblobOptions()); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName, useTokenAuth: false}, nil\n\t}\n\n\t// Priority 2: No account key — use SAS token or managed identity\n\tif accountKey == \"\" {\n\t\tdomain := domainFromHost(hostParts)\n\n\t\tnormalized := normalizeSASToken(token)\n\n\t\tif normalized != \"\" {\n\t\t\tif domain == \"\" {\n\t\t\t\tvar err error\n\t\t\t\tif domain, err = autoWasbEndpoint(accountName, uri.Scheme, func(serviceURL string) (*azblob.Client, error) {\n\t\t\t\t\treturn azblob.NewClientWithNoCredential(serviceURL+\"?\"+normalized, nil)\n\t\t\t\t}); err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"Unable to get endpoint of container %s: %s\", containerName, err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tsasURL := fmt.Sprintf(\"%s://%s.%s?%s\", uri.Scheme, accountName, domain, normalized)\n\t\t\tclient, err := azblob.NewClientWithNoCredential(sasURL, azblobOptions())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Failed to create Azure blob client with SAS token: %v\", err)\n\t\t\t}\n\t\t\treturn &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName, useTokenAuth: true}, nil\n\t\t}\n\n\t\ttokenCred, err := createAzureCredential()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Failed to create Azure credential (managed identity/Azure CLI): %v\", err)\n\t\t}\n\t\tif domain == \"\" {\n\t\t\tif domain, err = autoWasbEndpoint(accountName, uri.Scheme, func(serviceURL string) (*azblob.Client, error) {\n\t\t\t\treturn azblob.NewClient(serviceURL, tokenCred, nil)\n\t\t\t}); err != nil {","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/azure.go#L321-L357","documentation":"Thrown by newWasb in pkg/object/azure.go when SAS-token authentication is configured (account name + SAS token, no domain in endpoint) and autoWasbEndpoint fails to discover the storage endpoint domain by probing the container with the SAS client. The wrapped err carries the underlying probe failure (typically a network or auth error against <scheme>://<account>.<core-domain>).","triggerScenarios":"Calling newWasb (juicefs azblob:// endpoint) with a SAS token and an endpoint whose host lacks a recognizable azure domain suffix, when the probe request via azblob.NewClientWithNoCredential(serviceURL+\"?\"+sasToken) fails.","commonSituations":"Mistyped account name; wrong endpoint scheme (http vs https); SAS token expired or malformed; network/firewall blocking the Azure blob endpoint; private-DNS environments where the default *.blob.core.windows.net probe cannot resolve.","solutions":["Verify the account name and endpoint URL are correct and reachable (curl the blob service URL).","Check the SAS token is valid and not expired; regenerate it with adequate permissions.","Explicitly include the full domain in the endpoint (e.g. account.blob.core.windows.net) so autoWasbEndpoint is skipped entirely.","Check network/DNS connectivity and proxy/firewall settings blocking Azure endpoints."],"exampleFix":"// before\nazblob://myaccount?token=sv=2020-02-10&ss=b   (probe fails)\n// after\nazblob://myaccount.blob.core.windows.net?token=sv=2020-02-10&ss=b  (domain explicit, probe skipped)","handlingStrategy":"validation","validationCode":"u, err := url.Parse(endpoint)\nif err != nil || u.Host == \"\" { return fmt.Errorf(\"invalid azblob endpoint %q\", endpoint) }\nif !strings.Contains(u.Host, \".\") { return errors.New(\"endpoint host should include full domain, e.g. account.blob.core.windows.net\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the full domain in the endpoint to skip endpoint auto-discovery","Verify SAS token freshness before mounting","Test DNS/network reachability of the blob endpoint in the deploy environment"],"tags":["azure","object-storage","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"}