Skip to content

EFS mount is attempted once: a transient DNS failure at boot permanently fails the mount, though the mount-target IP works #704

Closed

Description

@scttfrdmn

Found by the storage leg added to make smoke while verifying #680. The quoting work was fine; this is the failure it surfaced underneath.

Observed

A t4g.small launched with --efs-id in the default VPC, with the mount target available in the same subnet before the launch started:

mount.nfs4: Failed to resolve server fs-0bc771ea6abff6cec.efs.us-east-1.amazonaws.com: Name or service not known

and the mount never happened. Diagnosed on the instance:

check result
/etc/resolv.conf nameserver 172.31.0.2 (the VPC resolver), correct
general DNS (getent hosts s3.amazonaws.com) works
EFS DNS (getent hosts fs-….efs.us-east-1.amazonaws.com) fails, still failing many minutes later
VPC enableDnsSupport / enableDnsHostnames both True
mount target available, same subnet, IP 172.31.1.24
mount by IP with the same options succeeds

So the filesystem was reachable the whole time. Only the DNS name was not resolving. (The same account, region and subnet resolved EFS DNS correctly earlier the same day, so this is intermittent rather than a permanent account property.)

The gap

pkg/userdata/storage.go issues the mount once:

mount -t nfs4 -o '<opts>' '<fs>.efs.<region>.amazonaws.com':/ '<mountpoint>'

A single transient DNS failure at boot therefore fails the mount permanently, even though:

  • the mount target's IP is known to spawn at launch time — it is what aws efs describe-mount-targets returns, and the FSx path already resolves a subnet for co-location, so the control plane has this information;
  • the filesystem becomes reachable seconds later, and nothing retries;
  • /etc/fstab gets the line regardless, so a later mount -a or reboot would succeed — the failure is specific to the boot attempt.

The consequence is not subtle. With #668's readiness barrier in place, a failed mount now correctly fails the workload rather than running it against a missing directory — so one DNS blip turns into a launch that boots, bills, and runs nothing. That is the right behaviour given the mount failed, but the mount should not have failed.

Suggested fix

In order of preference:

  1. Retry the mount with backoff — say 6 attempts over ~60s. EFS DNS can lag mount-target creation, and this is the smallest change that fixes the common case. nfs-utils is already installed by then.
  2. Fall back to the mount target IP after the DNS attempts fail. spawn can pass the IP in at render time; mounting by IP is what I used to confirm the filesystem was reachable, and it worked first try with the identical options. The trade-off is that an IP in /etc/fstab does not survive a mount-target replacement, so the IP should be the fallback and the DNS name the fstab entry.
  3. Use the efs-utils helper (mount -t efs) where available, which handles resolution and TLS itself — a larger change, and it adds a package dependency on a path that currently needs only nfs-utils.

(1) alone would have made this launch succeed.

Related

Activity

  1. added
    bug
    on Oct 5, 2026
  2. scttfrdmn commented on Oct 5, 2026

    @scttfrdmn
    ContributorAuthor

    Closed by #712, but with one verification gap I want on the record rather than buried in a merged PR.

    What is verified on hardware

    The reported symptom — the mount attempted exactly once — is fixed and confirmed by a real run. The storage smoke leg now passes 4/4, with /run/spawn/storage-ready reading ok, /efs present in /proc/mounts, and $EFS_MOUNT=/efs after sourcing the generated profile.

    What is not

    The mount-target IP fallback has never actually run on an instance. In the green run, DNS resolved on the first attempt, so the fallback was never reached — no attempt N/6 failed lines and no mounting by mount-target IP instead in cloud-init-output.log. It is verified only by an executable shell test that stubs mount to fail for the DNS name and succeed for the IP.

    That is a direct consequence of the failure being intermittent, which also corrects something I asserted mid-investigation. Three runs:

    run DNS result
    1 failed — all six attempts over ~60s
    2 failed — all six attempts over ~60s
    3 succeeded on attempt 1

    I had claimed, after run 2, that EFS DNS propagation "outlasts any retry budget worth spending" — i.e. that it was reliably broken for new mount targets. Run 3 shows that was over-stated: it is unreliable, not broken. Your original "intermittent rather than a permanent account property" framing was closer than my correction to it.

    What survives unchanged is the operational conclusion, and it is the reason the fallback went in: when DNS fails it fails for the entire 60-second budget. Two runs out of three would have left a workload with no data. A retry that recovers in neither failing case is not a fix.

    The awkward part

    Because the failure is intermittent, a green smoke is not evidence the fallback works — only a run that happens to hit the DNS failure exercises it, and that cannot be scheduled. So the hardware-sensitivity manifest flagging pkg/userdata/ will keep demanding a smoke for this path, and a passing smoke will keep not answering the question.

    The honest way to close that gap is one run with a deliberately unresolvable DNS name injected into the template, so the fallback is forced. I have not done it: it means shipping a knowingly-broken value to an instance, which is worth agreeing before doing rather than slipping into a test run.

    Reopen if you would rather that proof existed before this counts as closed.

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