Search code examples
airflowgcloudgoogle-cloud-composer

Running command in GCP Composer


I couldn't run a gcloud command in GCP Composer. Here is an issue:

ERROR: (gcloud.composer.environments.run) The subcommand "variables" is not supported for Composer environments with Airflow version 2.1.2.

Here is the command:

gcloud composer environments run composer \
  --location europe-west1 \
  --project=platform-name \
  --impersonate-service-account=SA-account.com variables -- \
  --import /home/airflow/gcs/data/env_var.json

Could someone help me?


Solution

  • Support for the mentioned release of Composer has only just become available in the last few days before your post. It is likely that your gcloud version is out of date compared to the product. Try refreshing the gcloud command by refreshing the GCP SDK. Alternatively, try the "gcloud beta" commands of gcloud to engage pre-GA function.

    The issue you are encountering is likely caused by the gcloud command thinking that the version of Composer being used is not GA and requiring that you use gcloud beta.