聚合国内IT技术精华文章,分享IT技术精华,帮助IT从业人士成长

Some problems when using GCP

2020-02-12 14:20 浏览: 1830634 次 我要评论(0 条) 字号:

After I launched a compute engine with container, it report error:

gcr.io/xx/xx-xx/feature:yy
Feb 03 00:12:28 xx-d19b201 konlet-startup[4664]: {“errorDetail”:{“message”:”failed to register layer: Error processing tar file(exit status 1): write /xxx/2020-01-16/base_cmd/part-00191-2e99af0e-1615-42af-9c60-910f9a9e6a17-c000.snappy.parquet: no space left on device”},”error”:”failed to register layer: Error processing tar file(exit status 1): write /xxx/2020-01-16/base_cmd/part-00191-2e99af0e-1615-42af-9c60-910f9a9e6a17-c000.snappy.parquet: no space left on device”}

The key is in the no space left on device. Then I use df to see the disk space:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       1.2G  879M  343M  72% /
devtmpfs         26G     0   26G   0% /dev
tmpfs            26G     0   26G   0% /dev/shm
tmpfs            26G  436K   26G   1% /run
tmpfs            26G     0   26G   0% /sys/fs/cgroup
tmpfs           1.0M  108K  916K  11% /etc/machine-id
tmpfs            26G     0   26G   0% /tmp
tmpfs           256K     0  256K   0% /mnt/disks
overlayfs       1.0M  108K  916K  11% /etc
/dev/sda8        12M   28K   12M   1% /usr/share/oem
/dev/sda1       5.7G  5.7G     0 100% /mnt/stateful_partition
tmpfs           1.0M  4.0K 1020K   1% /var/lib/cloud

Obviously the space on /mnt/stateful_partition has been used out. The solution is simple: add new argument for gcloud command

gcloud compute instances create-with-container [INSTANCE_NAME] 
     --container-image [DOCKER_IMAGE] 
     --boot-disk-size=30GB

Another problem occurred when I trying to launch an instance of Cloud Run. It reported a mess:

Traceback (most recent call last): File “/usr/local/lib/python3.6/site-packages/google/auth/compute_engine/credentials.py”, line 98, in refresh request, service_account=self._service_account_email File “/usr/local/lib/python3.6/site-packages/google/auth/compute_engine/_metadata.py”, line 241, in get_service_account_token request, “instance/service-accounts/{0}/token”.format(service_account) File “/usr/local/lib/python3.6/site-packages/google/auth/compute_engine/_metadata.py”, line 172, in get response, google.auth.exceptions.TransportError: (“Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/564585695625-compute@developer.gserviceaccount.com/token from the Google Compute Enginemetadata service. Status: 500 Response:nb’Could not fetch URI /computeMetadata/v1/instance/service-accounts/564585695625-compute@developer.gserviceaccount.com/token\n'”, )

Actually, the reason is quite simple: I haven’t realized that Cloud Run need its instance to listen on PORT. Otherwise, the service will not be launched successfully.



网友评论已有0条评论, 我也要评论

发表评论

*

* (保密)

Ctrl+Enter 快捷回复