ipfs/kubo · error

record is empty

Error message

record is empty

What it means

Validation in `ipfs name publish --file` (record import path): after reading the supplied record file/stdin (capped at 1 MiB), zero bytes were read, so there is no IPNS record to publish. The input was empty — a missing file, an empty pipe, or a wrong argument order.

Source

Thrown at core/commands/name/name.go:489

		name, err := ipns.NameFromString(namePart)
		if err != nil {
			return fmt.Errorf("invalid IPNS name: %w", err)
		}

		// Read raw record bytes from file/stdin
		file, err := cmdenv.GetFileArg(req.Files.Entries())
		if err != nil {
			return err
		}
		defer file.Close()

		// Read record data (limit to 1 MiB for memory safety)
		data, err := io.ReadAll(io.LimitReader(file, 1<<20))
		if err != nil {
			return fmt.Errorf("failed to read record: %w", err)
		}
		if len(data) == 0 {
			return errors.New("record is empty")
		}

		// Validate unless --force
		if !force {
			// Check size limit per IPNS spec
			if len(data) > maxIPNSRecordSize {
				return fmt.Errorf("record exceeds maximum size of %d bytes, use --force to skip size check", maxIPNSRecordSize)
			}
			rec, err := ipns.UnmarshalRecord(data)
			if err != nil {
				return fmt.Errorf("invalid IPNS record: %w", err)
			}

			// Validate signature against provided name
			err = ipns.ValidateWithName(rec, name)
			if err != nil {
				return fmt.Errorf("record validation failed: %w", err)
			}

View on GitHub (pinned to 329838acdf)

Solutions

  1. Pass a non-empty record file: ipfs name publish --file=record.bin <name>
  2. Verify the producing command (e.g. ipfs name record get) actually wrote output
  3. Check argument order — the file argument must contain record bytes
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/commands/name/name.go:489 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/2d72604005a9164f. Report an issue: GitHub.