Skip to content

[Bug] msb: empty files[] payload fails the drop and aborts the kit's environment and commands #561

Open

Description

@basiliskus

_acq_msb_copy_file_verified (acq.backends/msb.sh) confirms each drop with test -s, so a zero-byte payload (a bare .gitkeep, an empty __init__.py) never counts as placed, even though msb copy succeeded. _acq_msb_apply_kit_dir then prints could not place kit file at <name>:<path> and returns 1 before it records the kit's environment in /var/lib/acq/kit-env and before it runs the kit's commands[]. Files placed before the failure stay.

Repro at v4.0.1 on msb 0.7.7: a mixin with one empty files[] payload, one environment entry, and one startup command.

files:
  - path: /home/agent/ek/empty
    mode: "0644"
    source: files/home/ek/empty      # zero bytes
commands:
  - phase: startup
    user: "1000"
    command:
      - touch
      - /home/agent/ek-startup-ran
environment:
  EK_ENV: "1"

acq kit validate reports OK. ACQ_EXTRA_KITS=<kit> acq create shell … exits 0 and prints:

acq(msb): warning: ek-repro:/home/agent/ek/empty not observable after copy (19 checks); retrying copy once.
acq(msb): error: could not place kit file at ek-repro:/home/agent/ek/empty
acq(msb): warning: kit did not fully apply: <kit path>

In the guest, the file IS there (zero bytes, owned by root, since the chown step after the check never ran), EK_ENV is unset, and the startup command never ran.

Related: #517 (another files[] delivery gap on msb, symlinked sources).

Expected: verify a drop with test -f plus a size or checksum match against the source (so an empty source is fine), and do not let one file failure skip the kit's environment and commands without failing the create, or at least fail acq kit validate on an empty files[] source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions