https://prefect.io logo
j

Jean-Philippe Rodrigue

08/16/2023, 1:13 PM
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

Jeff Hale

08/16/2023, 1:44 PM
Hmm. Sorry to hear that. Are you usually able to run Python scripts ok?
j

Jean-Philippe Rodrigue

08/16/2023, 1:44 PM
usually yeah
j

Jeff Hale

08/16/2023, 1:45 PM
What happens if you run
prefect server start
In the CLI
j

Jean-Philippe Rodrigue

08/16/2023, 1:45 PM
Screenshot 2023-08-16 at 9.45.38 AM.png
j

Jeff Hale

08/16/2023, 1:46 PM
Cool. What if you click on/navigate to the URL in the message. http://127.0.0.1:4200
j

Jean-Philippe Rodrigue

08/16/2023, 1:47 PM
I get to the dashboard
j

Jeff Hale

08/16/2023, 1:47 PM
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

Jean-Philippe Rodrigue

08/16/2023, 1:49 PM
python flowtest.py
j

Jeff Hale

08/16/2023, 1:50 PM
Thank you. Can you please copy paste the the code in the file?
j

Jean-Philippe Rodrigue

08/16/2023, 1:50 PM
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

Jeff Hale

08/16/2023, 1:52 PM
Try adding
verify=False
as a second argument in the httpx.get call.
j

Jean-Philippe Rodrigue

08/16/2023, 1:54 PM
same error message 😞
j

Jeff Hale

08/16/2023, 1:55 PM
What’s the output of
conda list
j

Jean-Philippe Rodrigue

08/16/2023, 1:55 PM
Oh I don't have Conda.. i'm using venv
j

Jeff Hale

08/16/2023, 1:55 PM
What text editor/IDE are you using?
j

Jean-Philippe Rodrigue

08/16/2023, 1:55 PM
VS code
👍 1
j

Jeff Hale

08/16/2023, 1:56 PM
What does
pip list
show?
j

Jean-Philippe Rodrigue

08/16/2023, 1:57 PM
Screenshot 2023-08-16 at 9.56.48 AM.png,Screenshot 2023-08-16 at 9.56.57 AM.png
j

Jeff Hale

08/16/2023, 1:58 PM
What’s the result of running a script with the following contents only:
Copy code
import httpx
httpx.get('<https://www.example.org/>')
j

Jean-Philippe Rodrigue

08/16/2023, 1:59 PM
same error again
j

Jeff Hale

08/16/2023, 2:01 PM
Ok. We’re getting somewhere. How about
Copy code
import requests
requests.get('<https://www.example.org/>')
j

Jean-Philippe Rodrigue

08/16/2023, 2:01 PM
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

Jeff Hale

08/16/2023, 2:07 PM
ok. Thank you. Does running
curl <http://example.com|example.com>
work?
j

Jean-Philippe Rodrigue

08/16/2023, 2:08 PM
curl: (6) Could not resolve host: <http://example.com|example.com>
j

Jeff Hale

08/16/2023, 2:09 PM
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

Jean-Philippe Rodrigue

08/16/2023, 2:10 PM
Yeah I am! hmm ok give me a sec
j

Jeff Hale

08/16/2023, 2:10 PM
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

Jean-Philippe Rodrigue

08/16/2023, 2:13 PM
I get the same error again
j

Jeff Hale

08/16/2023, 2:19 PM
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

Jean-Philippe Rodrigue

08/16/2023, 2:24 PM
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

Jeff Hale

08/16/2023, 2:34 PM
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

Jean-Philippe Rodrigue

08/16/2023, 2:37 PM
ouff good question haha