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:
- Exported the Fastly API credentials as environment variables for the shell session:
export FASTLY_SERVICE_ID="" # Provided ID
export FASTLY_API_TOKEN="" # Provided token
- Verified API credentials were valid and returning information:
- 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
- Tried to validate the draft version before publishing
fastly service version validate --version="latest"
- Received error:
ERROR: error parsing arguments: required flag --service-id not provided.
- 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`
Version
What happened
When running
fastly service version validate, the command errors and requires the--service-idflag to be set. TheFASTLY_SERVICE_IDenvironment variable is present and is successfully used with other commands in the same session.Steps:
fastly service version validate --version="latest"--service-idflag equal to the environment variable, which was successful