Solution 1:

I can see you are Triggering a Cloud Function on Cloud Storage Changes that returns the uploaded object metadata.

However, this function does not upload the file:

onFinalize Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event.

In that case please follow the documentation provided to Upload Files. Finally, adding Error Handling to your code will help you the next time as in this case you have no logs or anything to debug the error.

Update:

This issue onFinalize trigger not working in emulator, that uses the same Cloud Functions with the same results. We have to wait for support on that.

After some research a colleague found this github issue that uses the same documentation and the same methods you are using. The first one describes how ‘onFinalize’ is triggered even on failed upload: and also redirects to the documentation that was mentioned above. In this case the function is triggered when it’s not supposed to, you can try executing it like this.