I have a large GCS function that used to work, and after updating it to include a minor change I am getting the following error:
TypeError: gcs_trigger() missing 1 required positional argument: 'context'
For context, my entry function does have context:
def gcs_trigger(event, context):
"""Handles a GCS event, processes zip files for nominal and backup procedures"""
bucket_name = event["bucket"]
file_path = event["name"]
# Initialize the storage client
storage_client = storage.Client()
bucket = storage_client.bucket(bucket_name)
# NOMINAL PROCEDURE
if (
file_path.endswith(".zip")
and file_path.startswith(SPECIFIC_FOLDER)
and file_path.count("/") == NOMINAL_PROCEDURE_SLASH_COUNT
):
....
Reading about it, I have seen it can be caused if the function is triggered by an HTTP request, but it is not my case.
Running gcloud functions describe
gives me:
eventTrigger:
eventFilters:
- attribute: bucket
value: mybucket
eventType: google.cloud.storage.object.v1.finalized
What am I missing?