AlistGo/alist · error

failed to create or access container [%s]: %w

Error message

failed to create or access container [%s]: %w

What it means

Error "failed to create or access container [%s]: %w" thrown in AlistGo/alist.

Source

Thrown at drivers/azure_blob/util.go:231

	}

	_, err = dstBlob.StartCopyFromURL(ctx, srcURL, nil)
	return err

}

// createContainerIfNotExists - Create container if not exists
// Clean up commented code
func (d *AzureBlob) createContainerIfNotExists(ctx context.Context, containerName string) error {
	serviceClient := d.client.ServiceClient()
	containerClient := serviceClient.NewContainerClient(containerName)

	var options = service.CreateContainerOptions{}
	_, err := containerClient.Create(ctx, &options)
	if err != nil {
		var responseErr *azcore.ResponseError
		if errors.As(err, &responseErr) && responseErr.ErrorCode != "ContainerAlreadyExists" {
			return fmt.Errorf("failed to create or access container [%s]: %w", containerName, err)
		}
	}

	d.containerClient = containerClient
	return nil
}

// mkDir creates a virtual directory marker by uploading an empty blob with metadata.
func (d *AzureBlob) mkDir(ctx context.Context, fullDirName string) error {
	dirPath := ensureTrailingSlash(fullDirName)
	blobClient := d.containerClient.NewBlockBlobClient(dirPath)

	// Upload an empty blob with metadata indicating it's a directory
	_, err := blobClient.Upload(ctx, struct {
		*bytes.Reader
		io.Closer
	}{
		Reader: bytes.NewReader([]byte{}),

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry.

When it happens

Trigger: Thrown at drivers/azure_blob/util.go:231 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/bfff534231f7d74a. Report an issue: GitHub.