AlistGo/alist · error

failed to list directory: %w

Error message

failed to list directory: %w

What it means

Error "failed to list directory: %w" thrown in AlistGo/alist.

Source

Thrown at drivers/proton_drive/driver.go:221

}

func (d *ProtonDrive) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
	var linkID string

	if dir.GetPath() == "/" {
		linkID = d.protonDrive.RootLink.LinkID
	} else {

		link, err := d.searchByPath(ctx, dir.GetPath(), true)
		if err != nil {
			return nil, err
		}
		linkID = link.LinkID
	}

	entries, err := d.protonDrive.ListDirectory(ctx, linkID)
	if err != nil {
		return nil, fmt.Errorf("failed to list directory: %w", err)
	}

	//fmt.Printf("Found %d entries for path %s\n", len(entries), dir.GetPath())
	//fmt.Printf("Found %d entries\n", len(entries))

	if len(entries) == 0 {
		emptySlice := []model.Obj{}

		//fmt.Printf("Returning empty slice (entries): %+v\n", emptySlice)

		return emptySlice, nil
	}

	var objects []model.Obj
	for _, entry := range entries {
		obj := &model.Object{
			Name:     entry.Name,
			Size:     entry.Link.Size,

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/proton_drive/driver.go:221 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/3bb53df527112160. Report an issue: GitHub.