Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Logging is not happening

Hi,

I had followed the lab but logging is not happening, below are the steps that I followed:

1. Created Storage-bucket (gceinstancebucket)

2. Created F1-micro (instance-gce) which has the ‘Write-only’ access for Stackdriver Logging API, Stackdriver Monitoring API, Stackdriver Trace and others are untouched.

added custom metadata – key:lab-logs-bucket (which is mentioned in startup-script), Value:’gs"//gceinstancebucket/

After hitting the create button i can see the stress is happening but i don’t see anything on my storage-bucket and SD logs.

I’m accessing the GCP through the Playground button.

could someone please help me on this?

Krishnan Gurusamy

I’m having the same issue. Did you give storage access? I also ssh into VM and tried to copy a file to bucket and it copied successfully. Only the log files are not getting moved to specific bucket. The stackdriverloggin doesn’t show any error.

Volney Stefflre

For me the file copy worked just fine once I set up the scope properly. The curl of the StackLogger distribution did not have any errors. When this part of the script ran there was a warning: startup-script: Warning: apt-key output should not be parsed (stdout is not a terminal). The bad result (not necessarily related) is that pressing the StackLogging button or browsing the URL in the syslog gives an uninitialized logging screen and no messages. The gsutil cp worked fine.

Volney Stefflre

Command with warning was curl -s -f https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add –

Volney Stefflre

Issue resolved itself by after I started the next labs a couple of hours later. When I looked for Stackdriver Logging there was now messages there. There were even messages in logs for instances that had not had logs this morning. It is like something was blocked or disconnected between the VM Instance UI and the stackdriver logging button. Console logging worked this morning and still works.

1 Answers

It was the storage scope issue. default it is Read only.
I set it to Read/Write and I was able to see the log file in bucket.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?