Skip to content

spored install races with user-data execution — "Text file busy" error #27

Closed

Description

@scttfrdmn

Summary

When spawn launch --user-data-file is used, spored's own install script races with the user-data execution. The result: spored fails to install with "Text file busy", and cloud-init marks the entire user-data script as failed.

Log evidence

From /var/log/cloud-init-output.log on a freshly launched instance:

Warning: Failed to open the file /usr/local/bin/spored: Text file busy
curl: (23) client returned ERROR on write of 16384 bytes
Failed to download spored binary
cc_scripts_user[WARNING]: Failed to run module scripts-user

Root cause

spawn installs spored as part of its bootstrap process, which runs concurrently with cloud-init's execution of user-data scripts. When the bootstrap tries to write the new spored binary to /usr/local/bin/spored, the old spored binary is already executing (installed from a previous run or baked into the AMI), causing the "Text file busy" error.

Expected behaviour

spawn's bootstrap should complete before user-data scripts are allowed to run, or at minimum should not fail when spored is already installed and running.

Workaround

Add a sleep 30 at the top of user-data scripts to let the bootstrap settle. This is fragile and adds unnecessary latency.

Context

https://github.com/scttfrdmn/aws-microbiome-demo — the Nextflow head node script fails to execute because cloud-init marks it as failed due to this race.

Activity

  1. added
    bug
    on May 31, 2026
  2. added a commit that references this issue on May 31, 2026
  3. scttfrdmn commented on May 31, 2026

    @scttfrdmn
    ContributorAuthor

    Fixed in #28 (merged to main): spored now installs via temp-file + atomic mv (no ETXTBSY over a running binary), and custom user-data runs under set +e so a bootstrap warning no longer fails the whole cloud-init script. Ships in the next release.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions