I have this Python code:
def upload_to_gcs(bucket_name, local_file_path, gcs_file_name):
"""
Uploads local files to Google Cloud Storage (GCS).
:param bucket_name: string
:param local_file_path: string
:param gcs_file_name: string
:return: None
"""
client = storage.Client()
bucket = client.bucket(bucket_name)
blob = bucket.blob(gcs_file_name)
blob.upload_from_filename(local_file_path)
which is failing with this error:
Exception has occurred: Forbidden
403 POST https://storage.googleapis.com/upload/storage/v1/b/monzo/o?uploadType=multipart: {
"error": {
"code": 403,
"message": "The billing account for the owning project is disabled in state closed",
"errors": [
{
"message": "The billing account for the owning project is disabled in state closed",
"domain": "global",
"reason": "accountDisabled",
"locationType": "header",
"location": "Authorization"
}
]
}
}
I have confirmed and Billing is definitely enabled, see below.
I also went through all possible solutions in this similar question. Nothing worked, double checked the bucket exists and all that. Finally also tried reaching Google but got stuck in chatbot which didn't help.
EDIT: Tried checking in Cloud Shell and got this back
miguel@cloudshell:~$ gcloud beta billing projects describe miguel-377315
billingAccountName: billingAccounts/0193C3-8A2BD3-44C7DB
billingEnabled: true
name: projects/miguel-377315/billingInfo
projectId: miguel-377315
Does anyone have an idea?