Hello! After running the flowtest.py I get this er...
# pacc-aug-16-2023
j
Hello! After running the flowtest.py I get this error:
httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
Any idea how I could get to the
<Response [200 OK]>
. I followed the instructions provided in the google doc
j
Hmm. Sorry to hear that. Are you usually able to run Python scripts ok?
j
usually yeah
j
What happens if you run
prefect server start
In the CLI
j
Screenshot 2023-08-16 at 9.45.38 AM.png
j
Cool. What if you click on/navigate to the URL in the message. http://127.0.0.1:4200
j
I get to the dashboard
j
Good stuff.
It’s picking up that the flows you ran didn’t complete. Can you please copy paste the code you ran below?
j
python flowtest.py
j
Thank you. Can you please copy paste the the code in the file?
j
Copy code
import httpx
from prefect import flow

@flow
def test_flow():
    res = httpx.get("<https://example.com>")
    print(res)

if __name__ == "__main__":
    test_flow()
j
Try adding
verify=False
as a second argument in the httpx.get call.
j
same error message 😞
j
What’s the output of
conda list
j
Oh I don't have Conda.. i'm using venv
j
What text editor/IDE are you using?
j
VS code
👍 1
j
What does
pip list
show?
j
Screenshot 2023-08-16 at 9.56.48 AM.png,Screenshot 2023-08-16 at 9.56.57 AM.png
j
What’s the result of running a script with the following contents only:
Copy code
import httpx
httpx.get('<https://www.example.org/>')
j
same error again
j
Ok. We’re getting somewhere. How about
Copy code
import requests
requests.get('<https://www.example.org/>')
j
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='<http://www.example.org|www.example.org>', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x103553f70>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
j
ok. Thank you. Does running
curl <http://example.com|example.com>
work?
j
curl: (6) Could not resolve host: <http://example.com|example.com>
j
You’re running this in VSCode terminal on a mac, is that right? What happens if you open a regular terminal window outside VSCode and run any of the above commands?
j
Yeah I am! hmm ok give me a sec
j
Right now you aren’t able to use your terminal to connect to anything at all, but you are able to use it to create a server that your browser can connect to and we’re having this conversation, so your machine can connect to the internet.
j
I get the same error again
j
This Stack Overflow answer might be what you’re looking for: https://stackoverflow.com/a/69530340/4590385
The two answers under that one also look promising.
j
so it works when I change to "https://www.google.com"
Is example.com mandatory for the course?
Ok, so I connected to my company's VPN and it seems to work now
What's the reason for the flow "test-flow" to have three different run?
j
Example.com is just an example website. Strange it works for google, but not Example.com. Does your company block some/most/all traffic from the terminal that isn’t through the VPN? Glad it’s working. 🙂 Not sure why it ran 3 times and is showing those 3 logged runs.
j
ouff good question haha