Skip to content

fastly service version validate requires --service-id flag with no env var fallback #1866

Description

@coolbrewed

Version

Fastly CLI version v15.4.0 (c142c746)
Built with go version go1.26.4 darwin/arm64 (2026-07-30)

What happened

When running fastly service version validate, the command errors and requires the --service-id flag to be set. The FASTLY_SERVICE_ID environment variable is present and is successfully used with other commands in the same session.

Steps:

  1. Exported the Fastly API credentials as environment variables for the shell session:
export FASTLY_SERVICE_ID="" # Provided ID
export FASTLY_API_TOKEN="" # Provided token
  1. Verified API credentials were valid and returning information:
fastly whoami
  1. Drafted some service changes, all reporting successful
# Clone a new service version for adding a dynamic ACL
fastly service acl create --version="active" --name="restricted_ips" --autoclone

# Add a `recv` type VCL snippet that will use the ACL entries to enforce some client IP restrictions
fastly service vcl snippet create --version="latest" --name="custom_restricted-ips_recv" --type="recv" --content="./restricted-ips.vcl" --priority=5
  1. Tried to validate the draft version before publishing
fastly service version validate --version="latest"
  1. Received error:

ERROR: error parsing arguments: required flag --service-id not provided.

  1. Retried by explicitly passing the --service-id flag equal to the environment variable, which was successful
fastly service version validate --version="latest" --service-id="${FASTLY_SERVICE_ID}"
# SUCCESS: Service ... version 18 is valid: Warning: Unused table `enabled_products`

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions