Gabe Villasana
12/31/2023, 10:15 PMGabe Villasana
12/31/2023, 11:03 PMnmap -p 443 <domain_name>.<http://openai.azure.com|openai.azure.com>
I am running my prefect deployments using prefect cloud and the flow.serve
methods. Here's the output I'm seeing repeatedly:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='<domain_name>.<http://openai.azure.com|openai.azure.com>', port=443): Max retries exceeded with url: //openai/deployments/<deployment_name>/chat/completions?api-version=2023-07-01-preview (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f9f19b2b370>: Failed to resolve '<domain_name>.<http://openai.azure.com|openai.azure.com>' ([Errno -2] Name or service not known)"))
Gabe Villasana
12/31/2023, 11:29 PM@flow()
def my_flow():
def is_port_open(url, port):
try:
ip = socket.gethostbyname(url)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1)
s.connect((ip, port))
s.close()
return True
except Exception as e:
print(e)
return False
assert is_port_open("<domain_name>.<http://openai.azure.com|openai.azure.com>", 443)
This failed with
Flow run '<flow_run_name>' - [Errno -5] No address associated with hostname
On the other hand, if I run this code directly from my python shell on the same machine, it works. Anyone able to help resolve?Kevin Grismore
01/01/2024, 12:43 AM.serve
, in this case do you mean the pod you're serving your flows from?Gabe Villasana
01/01/2024, 1:19 PMGabe Villasana
01/01/2024, 1:20 PM