juicedata/juicefs · error

Unable to get endpoint of container %s: %s

Error message

Unable to get endpoint of container %s: %s

What it means

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>).

Source

Thrown at pkg/object/azure.go:339

		if client, err = azblob.NewClientFromConnectionString(connString, azblobOptions()); err != nil {
			return nil, err
		}
		return &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName, useTokenAuth: false}, nil
	}

	// Priority 2: No account key — use SAS token or managed identity
	if accountKey == "" {
		domain := domainFromHost(hostParts)

		normalized := normalizeSASToken(token)

		if normalized != "" {
			if domain == "" {
				var err error
				if domain, err = autoWasbEndpoint(accountName, uri.Scheme, func(serviceURL string) (*azblob.Client, error) {
					return azblob.NewClientWithNoCredential(serviceURL+"?"+normalized, nil)
				}); err != nil {
					return nil, fmt.Errorf("Unable to get endpoint of container %s: %s", containerName, err)
				}
			}
			sasURL := fmt.Sprintf("%s://%s.%s?%s", uri.Scheme, accountName, domain, normalized)
			client, err := azblob.NewClientWithNoCredential(sasURL, azblobOptions())
			if err != nil {
				return nil, fmt.Errorf("Failed to create Azure blob client with SAS token: %v", err)
			}
			return &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName, useTokenAuth: true}, nil
		}

		tokenCred, err := createAzureCredential()
		if err != nil {
			return nil, fmt.Errorf("Failed to create Azure credential (managed identity/Azure CLI): %v", err)
		}
		if domain == "" {
			if domain, err = autoWasbEndpoint(accountName, uri.Scheme, func(serviceURL string) (*azblob.Client, error) {
				return azblob.NewClient(serviceURL, tokenCred, nil)
			}); err != nil {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Verify the account name and endpoint URL are correct and reachable (curl the blob service URL).
  2. Check the SAS token is valid and not expired; regenerate it with adequate permissions.
  3. Explicitly include the full domain in the endpoint (e.g. account.blob.core.windows.net) so autoWasbEndpoint is skipped entirely.
  4. Check network/DNS connectivity and proxy/firewall settings blocking Azure endpoints.

Example fix

// before
azblob://myaccount?token=sv=2020-02-10&ss=b   (probe fails)
// after
azblob://myaccount.blob.core.windows.net?token=sv=2020-02-10&ss=b  (domain explicit, probe skipped)
Defensive patterns

Strategy: validation

Validate before calling

u, err := url.Parse(endpoint)
if err != nil || u.Host == "" { return fmt.Errorf("invalid azblob endpoint %q", endpoint) }
if !strings.Contains(u.Host, ".") { return errors.New("endpoint host should include full domain, e.g. account.blob.core.windows.net") }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/f106255bf749c208. Report an issue: GitHub.