Google Certified Professional Data Engineer

Sign Up Free or Log In to participate!

403 Error creating topic


When I enter ‘python learning-gcp create test-topic’, i get following error :

"google.api_core.exceptions.PermissionDenied: 403 User not authorized to perform this action."

I have followed all the steps in the lab. 

I would appreciate any help. 


Tim Berry

Hi Harris, hopefully PJ’s answer below has sorted this out for you – but one more thing to check is that your GCP project is set inside your cloud shell, as sometimes the cloud shell can "forget"! Your project name appears to be ‘learning-gcp’ according to your question, so you can reset it with: gcloud config set project learning-gcp

1 Answers

Hello Harris,

thanks for your question, sorry to hear that you are having troubles.

I am going over the lab again myself and still had no difficulties when I followed the instruction personally.

Can I ask you to check a few things:

  • That you are using a project you have created yourself and you are the owner.

  • Make sure that pub/sub API has been enabled (this is done automatically the first time you access

  • That the project name is spelt correctly in the command you are trying to run.

  • That you have installed all the pre-requirements, check to make sure the previous steps executed without error.

  • That you are using the latest version of the referred to example repo.

git clone

or if you already have the repo in your cloud shell you can cd into the directory and perform git pull to get the latest

I really hope these tips help get you going again, and thank you so much for reaching out, please let us know if this helps.


Sign In
Welcome Back!

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

Get Started
Who’s going to be learning?