https://prefect.io logo
Title
j

Joseph Loss

03/29/2023, 8:29 PM
I've been using Prefect for years now, and have been on Prefect 2 since it came out. I'm currently experiencing this insanely frustrating error when running a new prefect agent. I've tried it both on this VM we have on our corporate network, as well as locally, running prefect v2.8.7. My PREFECT_API_URL and PREFECT_API_KEY (not expired) are set as environment variables. But the agent keeps crashing and is stuck in this iterative loop. Does anyone know how to solve this?
___ ___ ___ ___ ___ ___ _____     _   ___ ___ _  _ _____
 | _ \ _ \ __| __| __/ __|_   _|   /_\ / __| __| \| |_   _|
 |  _/   / _|| _|| _| (__  | |    / _ \ (_ | _|| .` | | |
 |_| |_|_\___|_| |___\___| |_|   /_/ \_\___|___|_|\_| |_|


Agent started! Looking for work from work pool 'susilceimpwssx2'...

Failed the last 3 attempts.  Please check your environment and configuration.
Examples of recent errors:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py",
line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py",
line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File
"/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py",
line 208, in handle_async_request
    raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://'
protocol.

Agent stopped!
d

David Steiner Sand

03/29/2023, 8:30 PM
Could you edit you message and move the error to inside the thread? Make the channel less polluted, thanks 🙂
r

redsquare

03/29/2023, 8:31 PM
you sure your api_url is correct and includes https?
j

Joseph Loss

03/29/2023, 8:56 PM
positive. I've used this same url for agents that are currently running on Azure Containers and on Rancher on another server, they work fine
r

redsquare

03/29/2023, 9:07 PM
is this after the 2.8.7 upgrade?
z

Zanie

03/30/2023, 2:22 PM
Can you run a flow without the agent on the machine that throws this error?
a

Andreas Gustafsson

05/03/2023, 11:50 AM
@Joseph Loss Did you manage to find a fix to this problem? I'm encountering the same one when trying to running an agent on ECS.