3 Answers
It’s hard to tell what the problem is without any more information but I’d suggest checking to see if you entered the correct metadata key (lab-logs-bucket) and value (gs://your-bucket-name) in the instance template. Since you can’t edit existing templates, you can check by creating a VM from the template and looking at the metadata values on the instance and if they are present and correct. If not then you’ll need to create a new template with the correct metadata.
Have a look at this post, hope you will be able to find out the root cause (most probably a missing step during set-up)
In this lab, you need to create the bucket with a unique name before creating the VM, and then add a Metadata tag with key "lab-logs-bucket" and value of "gs://{your_bucket_name}" when creating the VM. Note in the lecture he mentions adding a trailing "/", however, the script couldn’t write to the bucket for me with that trailing "/". Also, make sure that the VM instance has Storage – Write enabled for API Access Scopes. Hope this helps!
I tried it with and without the "/" in the value field but it didn’t show up. Not sure what it could be