Skip to content

aws lexicon: ecs-update-service / wait-steady-state crash when ECS response has no deployments field (Floci) #937

Closed

Description

@lex00

Found live during loomster#22/#35's real Floci E2E (full 6-component stack, chant run --components all).

ecs-update-service

packages/lexicons/aws/src/components/cloud-executor.ts, realEcs.updateService:

async updateService(args) {
  ...
  const described = JSON.parse(stdout) as { service: { deployments: Array<{ id: string }> } };
  return { deploymentId: described.service.deployments[0]?.id ?? "" };
}

Floci's aws ecs update-service response has a service object with no deployments field at all (confirmed live: service.deployments is undefined, not an empty array). described.service.deployments[0] throws Cannot read properties of undefined (reading '0') — the optional chaining only guards .id, not the [0] index access itself.

wait-steady-state

Same file, realEcs.describeService:

async describeService(cluster, service) {
  ...
  const svc = described.services[0];
  const running = svc?.runningCount ?? 0;
  const desired = svc?.desiredCount ?? 0;
  return { runningCount: running, desiredCount: desired, stable: running === desired && (svc?.deployments.length ?? 0) <= 1 };
}

svc?.deployments.length — svc exists (optional chaining succeeds there), but svc.deployments is itself undefined on Floci, so .length throws Cannot read properties of undefined (reading 'length'). Same root cause as above: ?. only guards the first property access, not the chained one after it.

Impact: both capabilities are unusable against Floci today, for every project that uses them (not loomster-specific) — ecs-update-service and wait-steady-state fail unconditionally, regardless of what the caller passes in.

Suggested fix: default deployments to [] when absent, e.g. described.service.deployments?.[0]?.id ?? "" and (svc?.deployments?.length ?? 0) <= 1.

Workaround in use today (loomster, src/components/loom-frontend.component.ts/loom-backend.component.ts): dropped both steps from the deploy composition entirely (documented in-line) until this is fixed upstream — real AWS presumably always includes deployments, so this is Floci-emulation-fidelity-specific, but it blocks local/CI validation via Floci for any project using these capabilities.

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