AlistGo/alist · error

%s

Error message

%s

What it means

Raised by KodBox driver MakeDir after the POST to /?explorer/index/mkdir succeeded at HTTP level but the API's application-level Code flag came back false. KodBox's CommonResp.Code is an any (bool on success); when false, Data carries a human-readable server message which is passed through verbatim as the error text.

Source

Thrown at drivers/kodbox/driver.go:105

			path,
			d.authorization)}, nil
}

func (d *KodBox) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error) {
	var resp *CommonResp
	newDirPath := filepath.Join(parentDir.GetPath(), dirName)

	_, err := d.request(http.MethodPost, "/?explorer/index/mkdir", func(req *resty.Request) {
		req.SetResult(&resp).SetFormData(map[string]string{
			"path": newDirPath,
		})
	})
	if err != nil {
		return nil, err
	}
	code := resp.Code.(bool)
	if !code {
		return nil, fmt.Errorf("%s", resp.Data)
	}

	return &model.ObjThumb{
		Object: model.Object{
			Path:     resp.Info.(string),
			Name:     dirName,
			IsFolder: true,
			Modified: time.Now(),
			Ctime:    time.Now(),
		},
	}, nil
}

func (d *KodBox) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error) {
	var resp *CommonResp
	_, err := d.request(http.MethodPost, "/?explorer/index/pathCuteTo", func(req *resty.Request) {
		req.SetResult(&resp).SetFormData(map[string]string{
			"dataArr": fmt.Sprintf("[{\"path\": \"%s\", \"name\": \"%s\"}]",

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Check the message in resp.Data (surfaced as the error text) — it is the KodBox server's own reason (e.g. 'already exists', 'no permission')
  2. Verify the parent path exists and the configured KodBox user can create folders there via the KodBox web UI
  3. Re-login / refresh credentials: force re-auth by reloading the storage so getToken() runs again
Defensive patterns

Strategy: try-catch

Try / catch

if err := d.MakeDir(ctx, parent, name); err != nil {
    if strings.Contains(err.Error(), "exist") { // server passthrough text
        // treat as idempotent success: fetch existing dir
    }
    return err
}

Prevention

When it happens

Trigger: Creating a directory via MakeDir where the KodBox server rejects it: newDirPath already exists, parent path invalid, insufficient permission, or session/token issues that were not the specific '10001' re-auth case.

Common situations: Duplicate folder names, wrong root path in the mount config, KodBox user lacking write permission on the target folder, or an expired accessToken whose failure code is not handled by the token-refresh branch.

Related errors


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