-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way I can get workflow status #1071
Comments
Hey @mxnoob, I think you're looking for run = hatchet.admin.run_workflow("MyWorkflow", {})
await run.result()
workflow_run = await hatchet.rest.aio.workflow_run_get(run.workflow_run_id)
# can now access workflow_run.status |
Hi @abelanger5, thanks for the reply, I have rewritten the code and am getting the error again. I am trying to get data from another docker compose, could this be the cause? @router.get("/workflow/{workflow_id}")
async def test_back_task(workflow_id: str):
res = await hatchet.rest.aio.workflow_run_get(workflow_id)
return {"workflow_status": res.status} Error> Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 113, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 187, in __call__ raise exc File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 715, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 735, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 288, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 73, in app response = await f(request) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 301, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 212, in run_endpoint_function return await dependant.call(**values) File "/app/router.py", line 31, in test_back_task res = await hatchet.rest.aio.workflow_run_get(workflow_id) File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest_client.py", line 159, in workflow_run_get return await self.workflow_api.workflow_run_get( File "/usr/local/lib/python3.10/site-packages/pydantic/_internal/_validate_call.py", line 33, in wrapper_function return await wrapper(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest/api/workflow_api.py", line 1842, in workflow_run_get response_data = await self.api_client.call_api( File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest/api_client.py", line 262, in call_api response_data = await self.rest_client.request( File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest/rest.py", line 180, in request r = await pool_manager.request(**args) File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 622, in _request raise err_exc_cls(url) aiohttp.client_exceptions.InvalidUrlClientError: /api/v1/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/workflow-runs/b0a0d8b0-5338-40f2-a0d9-471c8db22ee7 |
Hey @mxnoob how are you instantiating the Hatchet client? This looks like potentially a configuration issue or a bug on our end -- it may be that when you overwrite the |
.envHATCHET_CLIENT_TOKEN=tokenHATCHET_CLIENT_TLS_STRATEGY=none I got docker-compose.yml from https://docs.hatchet.run/self-hosting/docker-compose What settings did I miss? |
Got it, I believe this is a bug on our end -- when you use the
Let me know if that works while we investigate this. |
I did everything according to the points, unfortunately to no avail errorINFO: 172.23.0.1:40706 - "GET /workflow/ef1d4bf8-be2c-4ea5-a786-28604ff0b5f9 HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1109, in _wrap_create_connection sock = await aiohappyeyeballs.start_connection( File "/usr/local/lib/python3.10/site-packages/aiohappyeyeballs/impl.py", line 123, in start_connection raise OSError(first_errno, msg) ConnectionRefusedError: [Errno 111] Multiple exceptions: [Errno 111] Connect call failed ('::1', 8080, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 8080)The above exception was the direct cause of the following exception: Traceback (most recent call last): |
@mxnoob could you try one more step -- setting And you are correct, it should be |
@abelanger5 thanks! I got a new error, now pydantic
|
@mxnoob just to double check, which version of the Python SDK are you using? |
hatchet-sdk 0.38.3 |
hey @mxnoob - what's the code you're running that triggers this error? is it still what you put in this earlier comment? If yes, I'll try to reproduce this! |
Hi @hatchet-temporary, that's right, the error occurs when this code is called |
Hey @mxnoob - looking into this a bit more! One thing I'm noticing is in the code, it looks like you're passing a To me, this looks like it's likely a bug in an old version of the SDK. The TL;DR of what's going on is that somehow, an empty string is being passed to a Pydantic Would it be possible to upgrade the version of the SDK on your end and see if the issue persists? If it does, it's pretty likely it'd be a straightforward fix I could push! |
I tried to get with
await hatchet.rest.aio.workflow_get(workflow_id)
Error
> Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 113, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 187, in __call__ raise exc File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 715, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 735, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 288, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 73, in app response = await f(request) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 301, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 212, in run_endpoint_function return await dependant.call(**values) File "/app/router.py", line 28, in test_back_task res = await hatchet.rest.aio.workflow_get(workflow_id) File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest_client.py", line 117, in workflow_get return await self.workflow_api.workflow_get( File "/usr/local/lib/python3.10/site-packages/pydantic/_internal/_validate_call.py", line 33, in wrapper_function return await wrapper(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest/api/workflow_api.py", line 702, in workflow_get response_data = await self.api_client.call_api( File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest/api_client.py", line 262, in call_api response_data = await self.rest_client.request( File "/usr/local/lib/python3.10/site-packages/hatchet_sdk/clients/rest/rest.py", line 180, in request r = await pool_manager.request(**args) File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 622, in _request raise err_exc_cls(url) aiohttp.client_exceptions.InvalidUrlClientError: /api/v1/workflows/0d19625e-7c4c-4358-9304-1f1498df3ddaThe text was updated successfully, but these errors were encountered: