Skip to content

spored's hybrid-registry client has no region on EC2, so burst members never register #963

Closed

Description

@scttfrdmn

Found while fixing #939.

registry.NewPeerRegistry (pkg/registry/dynamodb.go) is the client spored registers a job-array member through and heartbeats on (pkg/agent/agent.go, newAgent, every member with spawn:job-array-id). It built its DynamoDB client from a bare config.LoadDefaultConfig(ctx).

On an EC2 instance that config has no region:

  • the bootstrap's spored.service sets only SPORE_DNS_SIGV4=1, no AWS_REGION;
  • aws-sdk-go-v2's default chain does not take the region from instance metadata unless config.WithEC2IMDSRegion is passed (nothing in the repo passes it);
  • root has no ~/.aws/config on a fresh AMI.

Checked locally: with AWS_REGION/AWS_DEFAULT_REGION unset and no shared config file, config.LoadDefaultConfig(ctx) returns Region == "" and no error. Every DynamoDB call on that client then fails endpoint resolution, so Register logs Warning: Failed to register with hybrid registry and the heartbeat never starts.

Consequence: a spawn burst member never appears in spawn-hybrid-registry, so the local nodes it was launched to work with (which discover through the registry) never see it. #918 fixed the other direction (the EC2 provider's registry reader is built from the instance's region); the writer was left on the ambient chain.

Fix: build the client in identity.Region (from the instance identity document on EC2, from the local config for the local provider). Done in the PR for #939, with TestNewPeerRegistryUsesTheMembersRegion.

Verified by reading the code and the local SDK check above. No instances were launched, so the on-instance failure itself has not been observed.

Activity

  1. added
    bug
    on Oct 15, 2026
  2. added 2 commits that reference this issue on Oct 17, 2026
    6f0d316
    97d549e
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