我无法使用Cloud SDK连接到Google cloud上的项目。我想使用SDK将文件上传到我的实例上。我得到的错误是:
You are now logged in as [ishanatech@gmail.com].
Your current project is [Trial-2015-1]. You can change this setting by running:
$ gcloud config set project PROJECT
C:\Program Files\Google\Cloud SDK>gcloud compute instances list
NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS
ERROR: (gcloud.compute.instances.list) Some requests did not succeed:
- Invalid value 'Trial-2015-1'. Values must match the following regular expression: '(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](
?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))'
C:\Program Files\Google\Cloud SDK>gcloud compute instances create instance-2 --image centos-6 --zone uscentral1-a
NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS
ERROR: (gcloud.compute.instances.create) Failed to find image for alias [centos-6] in public image project [centos-cloud
]. Try specifying a different image using [--image].
- Invalid value 'Trial-2015-1'. Values must match the following regular expression: '(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](
?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))'
C:\Program Files\Google\Cloud SDK>gcloud compute instances create instance-2 --image opensuse-13 --zone uscentral1-a
NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS
ERROR: (gcloud.compute.instances.create) Failed to find image for alias [opensuse-13] in public image project [opensuse-
cloud]. Try specifying a different image using [--image].
- Invalid value 'Trial-2015-1'. Values must match the following regular expression: '(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](
?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))'发布于 2015-02-08 06:52:49
如果您仔细查看复杂的RE,则会显示错误消息:
'(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:-a-z0-9{0,61}a-z0-9)?):)?(?:0-9{1,19}|(?:a-z?))‘
您会发现那里的所有字母都是小写 --总是小心地表示为a-z。
Trial-2015-1以大写字母开头,因此它不被视为有效的项目名称。
您确定您的项目实际上没有命名为trial-2015-1,并带有前导小写首字母...?
发布于 2020-04-10 15:32:14
我在使用terraform脚本创建堡垒服务器时遇到以下错误
创建实例时出错: googleapi:错误400:字段'resource.name':'Bastion-server‘的值无效。
https://stackoverflow.com/questions/28388291
复制相似问题