403 Forbidden your client does not have permission to get URL/algotrading from this server

Environment

Windows/GoogleCLoudPlatform/Python3.7

Alpaca SDK Version
Latest pip3 install alpaca-trade-api (from Google Cloud command window)
when I did the pip3 install it didn’t install the packages, only after I changed the directory permissions with ‘cd …’ and then ‘sudo chmod 777 mitchtradebot’ the install apparently went ok.

Other Environment Details
I am following the "Build an Algorithmic Trading in Python with Google Cloud:

Problem

the function deploys correctly (creates green tick).
Paper Trading

Test is never run. Only {}, empty brackets show.
I have tried to run the algotrading, (the function’s name) from 2 different google/alpaca accounts (both with Owner permissions), but I always get:
403 Forbidden your client does not have permission to get URL/algotrading from this server.

Also:

  1. I am a novice on Google Cloud Platform. The URL /algotrading might be wrong?

  2. the function’s ‘Region’ is set to ‘us-central1’, but I and my laptop are in Europe (Netherlands).

I hope someone can help.
Thanks,
Mitch

Ok, the problem was that I had no key ID for the appspot.gserviceaccount.com.
This problem is solved…I guess a case of duh…

Correction: after adding the gservice key ID, it works in Testing only.

If I run the URL (click the link in the Function Details) I still get the
“403 Forbidden your client does not have permission to get URL/algotrading from this server”

I wonder if something goes wrong with the name of the URL, because the URL-link in the function details is: “https://us-central1-alpacatradebot.cloudfunctions.net/algotrading” whilst the Error message refers to “/algotrading”

any pointers would be much appreciated.

Apologies. I needed to allow the ‘allUsers’ member with Invoker role.

Now it works from the Trigger-link as well.

Learning: This “403 Forbidden”-error can be the result of not setting the Function’s Permission for (the newly created) Member ‘allUser’ to ‘Invoker’ in Google Cloud.

Thanks,
mitch