AlistGo/alist · error

nil file

Error message

nil file

What it means

Put was called with a nil FileStreamer, so the driver cannot read any content and aborts before touching the API. Fires when callers pass a nil file (e.g. an empty upload handle) instead of a zero-size reader.

Solutions

  1. Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at drivers/doubao_new/driver.go:219 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/1db18065d9d8f563. Report an issue: GitHub.

Appendix: source

Thrown at drivers/doubao_new/driver.go:219

func (d *DoubaoNew) Remove(ctx context.Context, obj model.Obj) error {
	if obj == nil {
		return errors.New("nil object")
	}
	token := obj.GetID()
	if token == "" {
		if o, ok := obj.(*Object); ok {
			token = o.ObjToken
		}
	}
	if token == "" {
		return errors.New("missing object token")
	}
	return d.removeObj(ctx, []string{token})
}

func (d *DoubaoNew) Put(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) (model.Obj, error) {
	if file == nil {
		return nil, errors.New("nil file")
	}
	if file.GetSize() <= 0 {
		return nil, errors.New("invalid file size")
	}

	uploadPrep, err := d.prepareUpload(ctx, file.GetName(), file.GetSize(), dstDir.GetID())
	if err != nil {
		return nil, err
	}
	if uploadPrep.BlockSize <= 0 {
		return nil, errors.New("invalid block size from prepare")
	}

	tmpFile, err := file.CacheFullInTempFile()
	if err != nil {
		return nil, err
	}
	defer tmpFile.Close()

View on GitHub (pinned to 843d9dc814)