juicedata/juicefs · error

Unable to get endpoint of container %s: %w

Error message

Unable to get endpoint of container %s: %w

What it means

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.

Source

Thrown at pkg/object/azure.go:379

		serviceURL := fmt.Sprintf("%s://%s.%s", uri.Scheme, accountName, domain)
		client, err := azblob.NewClient(serviceURL, tokenCred, azblobOptions())
		if err != nil {
			return nil, fmt.Errorf("Failed to create Azure blob client with token credential: %v", err)
		}
		return &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName, useTokenAuth: true}, nil
	}

	// Priority 3: Shared key authentication
	credential, err := azblob.NewSharedKeyCredential(accountName, accountKey)
	if err != nil {
		return nil, err
	}
	domain := domainFromHost(hostParts)
	if domain == "" {
		if domain, err = autoWasbEndpoint(accountName, uri.Scheme, func(serviceURL string) (*azblob.Client, error) {
			return azblob.NewClientWithSharedKeyCredential(serviceURL, credential, nil)
		}); err != nil {
			return nil, fmt.Errorf("Unable to get endpoint of container %s: %w", containerName, err)
		}
	}
	client, err := azblob.NewClientWithSharedKeyCredential(fmt.Sprintf("%s://%s.%s", uri.Scheme, accountName, domain), credential, azblobOptions())
	if err != nil {
		return nil, err
	}
	return &wasb{container: client.ServiceClient().NewContainerClient(containerName), azblobCli: client, cName: containerName}, nil
}

func init() {
	Register("wasb", newWasb)
}

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Provide the full domain in the endpoint (myaccount.blob.core.windows.net) to skip the probe.
  2. Verify the account key matches the account (a bad key makes the probe fail with auth errors).
  3. Check network/DNS access to the blob endpoint.
  4. Use errors.Is/As on the wrapped error to distinguish network vs auth causes.

Example fix

// before
azblob://myaccount
// after
azblob://myaccount.blob.core.windows.net
Defensive patterns

Strategy: validation

Validate before calling

u, err := url.Parse(endpoint)
if err != nil || !strings.Contains(u.Host, ".") {
    return errors.New("use full domain endpoint to avoid probe: account.blob.core.windows.net")
}
if accountKey == "" { return errors.New("account key required for shared-key auth") }

Try / catch

if domain, err = autoWasbEndpoint(...); err != nil {
    var respErr *azcore.ResponseError
    if errors.As(err, &respErr) && respErr.StatusCode == 403 {
        return fmt.Errorf("probe auth failed: check account key for %s", containerName)
    }
    return fmt.Errorf("endpoint probe failed: %w", err)
}

Prevention

When it happens

Trigger: newWasb with accountName+accountKey and an endpoint host lacking a recognized azure domain; the probe request errors (network, DNS, or signature/permission failure).

Common situations: Wrong account key causing 403 on the probe; endpoint host like 'myaccount' with no suffix; account name typo; restricted network egress.

Related errors


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