Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru

Real-Time Troubleshooting with Google Cloud Error Reporting

You have been tasked with deploying your team's application to App Engine, as a proof-of-concept demo for Platform-as-a-Service technologies that you will present to the rest of your organisation. The app will work just great — most of the time. For some reason, it also seems to return an internal server error, although you can't see any bugs in your code when you run the app locally. In this lab, we will use GCP Error Reporting to see live errors and stack traces from our deployed application, to identify where the error is occurring.


Path Info

Clock icon Intermediate
Clock icon 30m
Clock icon Apr 09, 2021

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Deploy the Demo Application

    1. Under "APIs & Services," "Library," search for "Cloud Build API." Click "ENABLE" to enable the Cloud Build API.

    2. Inside the GCP console, click the Activate Cloud Shell icon.

    3. Clone the Git repo from GitHub.

    4. From the appengine-buggy directory inside the repo, deploy the application to App Engine.

    5. You will be asked to choose a region for deployment (select us-east1), then confirm the details to create the application. When the command completes you should be able to see the URL of your deployed app.

    6. Visit the application in your browser. Did it work? Keep reloading the page until it breaks.

  2. Challenge

    Use Cloud Error Reporting

    View your application's errors in the GCP console. You can find application errors in the App Engine dashboard, or in the Error Reporting section (under Operations in the GCP menu).

    The variable sample_text is sometimes not set because of the if random_value condition. You can see the stack trace of this error, along with all of its occurrences, as a single Error in Error Reporting.

  3. Challenge

    Fix the Application and Redeploy

    1. Remove the if condition on line 21 of so that sample_text is always set. Make sure you correct the indentation on the following line. You should probably change the text as well, so that it no longer claims to fail some of the time!

    2. Redeploy the application to App Engine, and test that your change has solved the problem by reloading the app several times.

    3. You can now mark the Error as resolved in Error Reporting.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans