0
votes

I have deployed a Cloud Function to make a simple POST request when a file is uploaded to my storage bucket.

The function looks like this:

import requests

def hello_gcs(event, context):
    r = requests.post('http://192.168.2.198:8000/api/upload-data', data = {'file':event['name']})

Whenever I upload a file to the bucket I get a function finished with status: timeout. I found some similar questions on stack but nothing solve the problem. Does anyone see the issue? Thanks in advance.

1
are you sure http://192.168.2.198:8000 is the right url?Yash
@YashShah yes, everything works fine from postmanEthan
Does it work if you use curl?pepoluan
@pepoluan curl worksEthan
is it in the same network? 192.168.2.198 suggests you should be in the same network. Try the same command from post man on the other machine. i think it will not workYash

1 Answers

0
votes

The IP address 192.168.2.198 looks like an IP on a local network. This is probably not reachable from the Cloud Functions execution environment. You need to expose a public IP address instead.