<@U03FYEHGY57> Hi, I am working on a workflow poc ...
# ask-community
d
@Bianca Hoch Hi, I am working on a workflow poc using prefect. For poc, I am choosing prefect as a self-hosted server. Here is the steps which I had followed: 1. installed prefect (prefect server start) 2. i could open the ui at localhost:4200/ 3. now i run the same code which is given in the quick start guide "my_gh_workflow.py"
attached the error which I am facing.
I tried replacing the api with with my cloud login as well like:
prefect cloud login -k <my-token>
export PREFECT_API_URL="https://api.prefect.io/accounts/{account-id}/workspaces/{workspace-id}/api"
but I couldn't succeed. Is there anything which I'm missing?
l
Hey welcome to the prefect community 🙂 I think for local server you should replace
https
with
http
instead. For cloud, the URL is slightly different from what you have, it should be
<https://api.prefect.cloud/api/accounts/{account-id}/workspaces/{workspace-id}>
instead of
<https://api.prefect.io/accounts/{account-id}/workspaces/{workspace-id}/api>
. I hope this helps 🙂
gratitude thank you 1
1
b
Hi Laxmi and Danne! Laxmi, you're correct that the
PREFECT_API_URL
would start with
https://api.prefect.cloud/api/
to use Prefect Cloud. Danne, if you're self-hosting your own server, you'll want to set your
PREFECT_API_URL
to
<http://127.0.0.1:4200/api>
. The command to set this is:
prefect config set PREFECT_API_URL=<http://127.0.0.1:4200/api>
d
@Laxmi and @Bianca Hoch I was using http://127.0.0.1/api but I was facing
Copy code
/Users/danne/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: <https://github.com/urllib3/urllib3/issues/3020>
  warnings.warn(
Traceback (most recent call last):
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions
    yield
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpx/_transports/default.py", line 236, in handle_request
    resp = self._pool.handle_request(req)
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
    raise exc from None
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
    response = connection.handle_request(
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
    raise exc
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
    stream = self._connect(request)
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpcore/_sync/connection.py", line 122, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpcore/_backends/sync.py", line 213, in connect_tcp
    sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/danne/Library/Python/3.9/lib/python/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 61] Connection refused
i tried installing openssl 1.1.1 as well, but
Copy code
Error: openssl@1.1 has been disabled because it is not supported upstream! It was disabled on 2024-10-24.
tried with different openssl versions too.. facing the same issue.
l
@danne have you also tried downgrading urllib3 to <2.x.x ? urllib3 v2 works with python3.10 so if that's an option, that should also work
d
NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn(
l
yes seems to be an issue with mac. here are some mac specific solutions, may be give that a try?
wizard2 1
🙌 1
d
Omg, let me try or I'll try in some linux system.
👍 1
that worked.. thanks.
🎊 2