You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GetFSxFilesystem panics on a filesystem that is still CREATING (nil DNSName / MountName) #618
Found while implementing #613's visibility fixes (#617), which had to route around this rather than change shared behaviour.
The bug
(*Client).GetFSxFilesystem (pkg/aws/fsx.go:262) dereferences two fields unconditionally when building its return value:
return&FSxInfo{
FileSystemID: *fs.FileSystemId,
DNSName: *fs.DNSName, // nil while CREATINGMountName: *fs.LustreConfiguration.MountName, // nil while CREATINGStorageCapacity: *fs.StorageCapacity,
...
}, nil
A filesystem in CREATING has neither a DNSName nor a LustreConfiguration — both are populated when it becomes AVAILABLE. So calling this against a filesystem that is still provisioning is a nil-pointer dereference, not an error return.
*fs.StorageCapacity is unguarded too, though in practice FSx sets it at create time.
Why it matters
CREATING is not a rare state — it is the state #613 actually hit. FSx Lustre takes minutes to provision, and #613's reporter terminated the instance while the filesystem was still CREATING. Any code path that reaches this function during that window crashes the CLI rather than reporting something useful.
Both callers are reachable in that window:
cmd/launch_single.go:540 — resolving an existing filesystem by id during launch
cmd/task.go:966 — the task path's FSx lookup
A panic here is worse than the missing data: the user gets a stack trace instead of "filesystem fs-… is still provisioning", on a code path that is otherwise about to do real work.
Suggested fix
Make the derefs nil-safe and let the zero value mean "not ready yet" — FSxInfo.DNSName/MountName empty is already meaningful, since a mount can't be constructed without them. Callers that genuinely require a mountable filesystem should check for that explicitly and say so.
FSxBrief / DescribeFSxBrief (added in #617, same file) is the nil-safe shape and can be the model, but the fix here is to stop GetFSxFilesystem panicking — #617 deliberately left it alone to avoid changing behaviour shared by the launch and task paths.
Test: a DescribeFileSystems response with LifecycleStatus: CREATING, nil DNSName and nil LustreConfiguration must return a usable FSxInfo (or a clear error), and must not panic. That test fails against current main.
The mapping is extracted as a pure fsxInfoFrom(types.FileSystem) so it can be exercised against any lifecycle state without AWS. Verified by reintroducing the old unguarded derefs and running the new test:
With the fix it passes. A CREATING filesystem now yields empty DNSName/MountName and zero StorageCapacity — meaningful values, since a mount cannot be constructed without them — rather than crashing the CLI.
The tag scan had the same unconditional-deref shape (Tag.Key/Tag.Value are both optional) and is fixed alongside, with its own test.
Activity
fix(fsx): stop panicking on a CREATING filesystem; quote the PERSISTE…
scttfrdmn commentedon Oct 1, 2026
Fixed in #627 (merged as
52ea114).The mapping is extracted as a pure
fsxInfoFrom(types.FileSystem)so it can be exercised against any lifecycle state without AWS. Verified by reintroducing the old unguarded derefs and running the new test:With the fix it passes. A
CREATINGfilesystem now yields emptyDNSName/MountNameand zeroStorageCapacity— meaningful values, since a mount cannot be constructed without them — rather than crashing the CLI.The tag scan had the same unconditional-deref shape (
Tag.Key/Tag.Valueare both optional) and is fixed alongside, with its own test.chore(release): v0.112.1