Why do I get "401 Invalid Credentials" when doing this lab?
Hmmm… I wish I knew right off the top what the issue is, but I can’t say, just based on what you’ve described. So let me ask a few things.
Are you doing the lab in an Incognito window? This helps to rule out situations where the console or Cloud Shell connect to another account than the one you’re meaning to use.
Are you using a Google account that is not connected to an Organization? If you’re using a work account as your user, there may be Organization-level restrictions on it that can mess you up.
Are you still having this problem? Sorry for the slow reply, but I’ve been rather ill since a bit before you asked this question. I hope you’ve gotten unblocked, already, but if you haven’t then I’d very much like to unblock you, now.
I saw the same problem periodically when I was doing the GCS command line lab. I would get it on a ls command like this:
$ gsutil ls -a gs://storage-lab-cli-xxx/
ServiceException: 401 Invalid Credentials
I tried a ls on another bucket and the ls command would work fine. Then I would try again on the same bucket with the error and it would work fine too.
Seems like this is some kind of transient error. I saw it 2 times in 20 minutes or so that it took me to complete the CGS CLI lab. Both times if I waited a little bit the error would go away.