Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Unable to select existing subnet using the latest merge that includes the --subnet-name flag #2054

Closed
jmmaldonado opened this issue Aug 9, 2018 · 1 comment

Comments

@jmmaldonado
Copy link
Contributor

As of today the merge that includes the --subnet-name flag is not surfaced in the SDK
I have cloned the repo and executed the following command:

./datalab.py create --network-name eci-vpc --subnet-name default --no-connect --verbosity debug --zone europe-west1-b datalabvm01

The default subnet exists as can be seen by executing manually the gcloud command:
gcloud compute networks subnets describe default --region europe-west1

However the datalab create command fails as apparently it does not pass through the --region flag to the gcloud compute command, whether it is specified as the --zone flag in the datalab command, or it is selected via the interactive prompt of the datalab create command

DEBUG: (gcloud.compute.networks.subnets.describe) Underspecified resource [default]. Specify the [--region] flag.
Traceback (most recent call last):
File "/google/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 848, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/google/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 770, in Run
resources = command_instance.Run(args)
File "/google/google-cloud-sdk/lib/surface/compute/networks/subnets/describe.py", line 49, in Run
scope_lister=compute_flags.GetDefaultScopeLister(client))
File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 755, in ResolveAsResource
default_scope, scope_lister)
File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 510, in ResolveResources
api_resource_registry)
File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 421, in _ResolveUnderspecifiedNames
raise UnderSpecifiedResourceError(names, [s.flag for s in self.scopes])
UnderSpecifiedResourceError: Underspecified resource [default]. Specify the [--region] flag.
ERROR: (gcloud.compute.networks.subnets.describe) Underspecified resource [default]. Specify the [--region] flag.
Traceback (most recent call last):
File "./datalab.py", line 420, in run
sdk_version=sdk_version, datalab_version=datalab_version)
File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 802, in run
disk_cfg = prepare(args, gcloud_compute, gcloud_repos)
File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 771, in prepare
ensure_subnet_exists(args, gcloud_compute, args.subnet_name)
File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 585, in ensure_subnet_exists
raise SubnetException(subnet_name)
SubnetException: Failed to find the subnet default.

Ask a project owner to create it for you, or double check your gcloud config for the correct region.
Failed to find the subnet default.

Ask a project owner to create it for you, or double check your gcloud config for the correct region.

@jmmaldonado
Copy link
Contributor Author

Fixed in CL #2055 currently merged in master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant