AlistGo/alist · warning · ErrBaiduYouthEmptyFilesNotAllowed

empty files are not allowed by baidu youth

Error message

empty files are not allowed by baidu youth

What it means

Sentinel error ErrBaiduYouthEmptyFilesNotAllowed declared in drivers/baidu_youth/types.go. The Baidu Youth (青春版) netdisk variant likewise rejects zero-byte files, and the driver surfaces this dedicated error when an empty upload is attempted.

Source

Thrown at drivers/baidu_youth/types.go:14

package baidu_youth

import (
	"errors"
	"path"
	"strconv"
	"time"

	"github.com/alist-org/alist/v3/internal/model"
	"github.com/alist-org/alist/v3/pkg/utils"
)

var (
	ErrBaiduYouthEmptyFilesNotAllowed = errors.New("empty files are not allowed by baidu youth")
)

type File struct {
	Category int   `json:"category"`
	FsId     int64 `json:"fs_id"`
	Thumbs   struct {
		Url3 string `json:"url3"`
	} `json:"thumbs"`
	Size           int64  `json:"size"`
	Path           string `json:"path"`
	ServerFilename string `json:"server_filename"`
	Md5            string `json:"md5"`
	Isdir          int    `json:"isdir"`
	ServerCtime    int64  `json:"server_ctime"`
	ServerMtime    int64  `json:"server_mtime"`
	LocalMtime     int64  `json:"local_mtime"`
	LocalCtime     int64  `json:"local_ctime"`
	Ctime          int64  `json:"ctime"`

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Skip zero-byte files in your upload/sync job targeting Baidu Youth
  2. Write a 1-byte placeholder if an entry must exist
  3. Handle this sentinel (errors.Is) as a skippable condition in batch transfers

Example fix

// before
err := d.Put(ctx, dst, stream)
// after
if stream.GetSize() == 0 {
    return errs.NotImplement // or skip upstream
}
Defensive patterns

Strategy: validation

Validate before calling

if stream.GetSize() == 0 { return nil }

Try / catch

err := d.Put(ctx, dst, stream, up)
if err != nil && errors.Is(err, ErrBaiduYouthEmptyFilesNotAllowed) { return nil }

Prevention

When it happens

Trigger: Calling Put() on a Baidu Youth storage with a model.FileStreamer of size 0; the server-side API refuses empty file creation.

Common situations: Same as the main netdisk driver: syncing placeholder files, .gitkeep markers, or empty logs to a Youth edition account.

Related errors


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