Skip to content

spored-instance-role lacks ECR pull perms → spawn app launch can't pull its container image #588

Closed

Description

@scttfrdmn

Summary

spawn app launch <container-app> cannot pull its image: the spored-instance-role that SetupSporedIAMRole provisions (pkg/aws/iam.go, inline policy spored-policy = sporedDCVRolePolicy) grants no ECR actions at all. The docker login step succeeds (because ecr:GetAuthorizationToken happens to be granted account-wide by some other policy on the shared role), but the actual pull is denied:

Error response from daemon: pull access denied for 942542972736.dkr.ecr.us-east-1.amazonaws.com/paraview,
... User: arn:aws:sts::942542972736:assumed-role/spored-instance-role/i-... is not authorized to perform:
ecr:BatchGetImage on resource: arn:aws:ecr:us-east-1:942542972736:repository/paraview
because no identity-based policy allows the ecr:BatchGetImage action

Result: the container never starts → the DCV session --init fails → no spawn:ready-url tag → the CLI times out waiting for the session. The #290 container-catalog launch path is unusable out of the box for any image, public or private.

Root cause

sporedDCVRolePolicy (pkg/aws/iam.go) grants EC2 (describe/tag/stop/terminate), FSx, lambda:InvokeFunctionUrl, and S3 (certs / dcv-license.* / schedules) — but no ecr:*. There is already an unused ecr:ReadOnly policy block in the same file with exactly the right actions (GetAuthorizationToken, BatchCheckLayerAvailability, GetDownloadUrlForLayer, BatchGetImage); it just isn't part of the spored role.

PutRolePolicy overwrites spored-policy on every launch, so the role only ever has ECR access if another, unrelated inline policy happens to grant it. On the 942 build account the role had accumulated microbiome-demo-ecr / omics-demo-ecr policies (scoped to those repos), which is why GetAuthorizationToken worked but pulling paraview didn't — and why an earlier (June) manual test appeared to pull fine.

Fix

Add an ECR-pull statement to sporedDCVRolePolicy:

{
  "Effect": "Allow",
  "Action": [
    "ecr:GetAuthorizationToken",
    "ecr:BatchCheckLayerAvailability",
    "ecr:GetDownloadUrlForLayer",
    "ecr:BatchGetImage"
  ],
  "Resource": "*"
}

GetAuthorizationToken requires Resource: "*". The three pull actions on * are read-only and cross-account pulls remain gated by the target repo's own repository policy, so this does not over-grant. This mirrors the existing ecr:ReadOnly block. (Public-ECR images pull anonymously and don't need this, but private/own-account images — the common BYO case — do.)

Discovered by

The #286/#389 real-GPU validation run (2026-09-13, g5.xlarge, 942/us-east-1, i-0b46e604b61dc9563, terminated + leak-checked clean). That run confirmed the #286/#389 change works — the AWS DLAMI base resolved via SSM, Amazon DCV 2025.0 installed at boot, dcvserver + spored + TLS cert + NVIDIA driver all up, dcv create-session invoked — and the only thing that failed was this ECR pull. So this is the last blocker between "mechanism validated" and "paraview actually streams."

Activity

  1. added
    bug
    on Sep 14, 2026
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