run-llama / llama_deploy

Deploy your agentic worfklows to production
https://docs.llamaindex.ai/en/stable/module_guides/llama_deploy/
MIT License
1.85k stars 193 forks source link

python full stack example deployment failure #328

Closed Rohith-Scalers closed 1 month ago

Rohith-Scalers commented 1 month ago

apiserver-1 | INFO: 172.21.0.3:37134 - "POST /deployments/create HTTP/1.1" 500 Internal Server Error apiserver-1 | ERROR: Exception in ASGI application apiserver-1 | Traceback (most recent call last): apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi apiserver-1 | result = await app( # type: ignore[func-returns-value] apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call apiserver-1 | return await self.app(scope, receive, send) apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in call apiserver-1 | await super().call(scope, receive, send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in call apiserver-1 | await self.middleware_stack(scope, receive, send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in call apiserver-1 | raise exc apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in call apiserver-1 | await self.app(scope, receive, _send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in call apiserver-1 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app apiserver-1 | raise exc apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app apiserver-1 | await app(scope, receive, sender) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/routing.py", line 715, in call apiserver-1 | await self.middleware_stack(scope, receive, send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/routing.py", line 735, in app apiserver-1 | await route.handle(scope, receive, send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle apiserver-1 | await self.app(scope, receive, send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app apiserver-1 | await wrap_app_handling_exceptions(app, request)(scope, receive, send) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app apiserver-1 | raise exc apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app apiserver-1 | await app(scope, receive, sender) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/starlette/routing.py", line 73, in app apiserver-1 | response = await f(request) apiserver-1 | ^^^^^^^^^^^^^^^^ apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app apiserver-1 | raw_response = await run_endpoint_function( apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function apiserver-1 | return await dependant.call(values) apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/llama_deploy/apiserver/routers/deployments.py", line 68, in create_deployment apiserver-1 | manager.deploy(config) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/llama_deploy/apiserver/deployment.py", line 297, in deploy apiserver-1 | deployment = Deployment(config=config, root_path=self._deployments_path) apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/llama_deploy/apiserver/deployment.py", line 69, in init apiserver-1 | self._workflow_services: list[WorkflowService] = self._load_services(config) apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/llama_deploy/apiserver/deployment.py", line 159, in _load_services apiserver-1 | source_manager.sync(source.name, str(destination.resolve())) apiserver-1 | File "/opt/venv/lib/python3.12/site-packages/llama_deploy/apiserver/source_managers/local.py", line 18, in sync apiserver-1 | shutil.copytree(source, destination, dirs_exist_ok=True) apiserver-1 | File "/usr/local/lib/python3.12/shutil.py", line 598, in copytree apiserver-1 | with os.scandir(src) as itr: apiserver-1 | ^^^^^^^^^^^^^^^ apiserver-1 | FileNotFoundError: [Errno 2] No such file or directory: './workflows' apiserver-1 | INFO: 127.0.0.1:49614 - "GET /status/ HTTP/1.1" 200 OK apiserver-1 | INFO: 127.0.0.1:49030 - "GET /status/ HTTP/1.1" 200 OK deploy_workflows-1 | Traceback (most recent call last): deploy_workflows-1 | File "/opt/venv/bin/llamactl", line 8, in deploy_workflows-1 | sys.exit(main()) deploy_workflows-1 | ^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/llama_deploy/cli/main.py", line 7, in main deploy_workflows-1 | sys.exit(llamactl()) deploy_workflows-1 | ^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1157, in call deploy_workflows-1 | return self.main(args, kwargs) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1078, in main deploy_workflows-1 | rv = self.invoke(ctx) deploy_workflows-1 | ^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke deploy_workflows-1 | return _process_result(sub_ctx.command.invoke(sub_ctx)) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke deploy_workflows-1 | return ctx.invoke(self.callback, ctx.params) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke deploy_workflows-1 | return __callback(args, kwargs) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/click/decorators.py", line 45, in new_func deploy_workflows-1 | return f(get_current_context().obj, *args, kwargs) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/llama_deploy/cli/deploy.py", line 21, in deploy deploy_workflows-1 | raise click.ClickException(resp.json().get("detail")) deploy_workflows-1 | ^^^^^^^^^^^ deploy_workflows-1 | File "/opt/venv/lib/python3.12/site-packages/httpx/_models.py", line 766, in json deploy_workflows-1 | return jsonlib.loads(self.content, kwargs) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/usr/local/lib/python3.12/json/init.py", line 346, in loads deploy_workflows-1 | return _default_decoder.decode(s) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode deploy_workflows-1 | obj, end = self.raw_decode(s, idx=_w(s, 0).end()) deploy_workflows-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deploy_workflows-1 | File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode deploy_workflows-1 | raise JSONDecodeError("Expecting value", s, err.value) from None deploy_workflows-1 | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Rohith-Scalers commented 1 month ago

@dosu

logan-markewich commented 1 month ago

FileNotFoundError: [Errno 2] No such file or directory: './workflows'

I think there's a bug in the docker-compose not mounting this folder, taking a look

Rohith-Scalers commented 1 month ago

yaa , and i dont see deploy.py anywhere in the folder

logan-markewich commented 1 month ago

Making progress, but getting a few errors here and there. Let me open WIP PR

logan-markewich commented 1 month ago

for reference, you can do this without docker, which does work! Just need to launch qdrant, launch the api server, deploy the workflows, launch the frontend :) But thats annoying lol

Rohith-Scalers commented 1 month ago

after mounting requried files getting timed out error

deploy_workflows-1  | Traceback (most recent call last):
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions
deploy_workflows-1  |     yield
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 236, in handle_request
deploy_workflows-1  |     resp = self._pool.handle_request(req)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
deploy_workflows-1  |     raise exc from None
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
deploy_workflows-1  |     response = connection.handle_request(
deploy_workflows-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 101, in handle_request
deploy_workflows-1  |     return self._connection.handle_request(request)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 143, in handle_request
deploy_workflows-1  |     raise exc
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 113, in handle_request
deploy_workflows-1  |     ) = self._receive_response_headers(**kwargs)
deploy_workflows-1  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 186, in _receive_response_headers
deploy_workflows-1  |     event = self._receive_event(timeout=timeout)
deploy_workflows-1  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 224, in _receive_event
deploy_workflows-1  |     data = self._network_stream.read(
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 124, in read
deploy_workflows-1  |     with map_exceptions(exc_map):
deploy_workflows-1  |          ^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
deploy_workflows-1  |     self.gen.throw(value)
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
deploy_workflows-1  |     raise to_exc(exc) from exc
deploy_workflows-1  | httpcore.ReadTimeout: timed out
deploy_workflows-1  | 
deploy_workflows-1  | The above exception was the direct cause of the following exception:
deploy_workflows-1  | 
deploy_workflows-1  | Traceback (most recent call last):
deploy_workflows-1  |   File "/opt/venv/bin/llamactl", line 8, in <module>
deploy_workflows-1  |     sys.exit(main())
deploy_workflows-1  |              ^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/llama_deploy/cli/__main__.py", line 7, in main
deploy_workflows-1  |     sys.exit(llamactl())
deploy_workflows-1  |              ^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
deploy_workflows-1  |     return self.main(*args, **kwargs)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
deploy_workflows-1  |     rv = self.invoke(ctx)
deploy_workflows-1  |          ^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
deploy_workflows-1  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
deploy_workflows-1  |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
deploy_workflows-1  |     return ctx.invoke(self.callback, **ctx.params)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
deploy_workflows-1  |     return __callback(*args, **kwargs)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/click/decorators.py", line 45, in new_func
deploy_workflows-1  |     return f(get_current_context().obj, *args, **kwargs)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/llama_deploy/cli/deploy.py", line 16, in deploy
deploy_workflows-1  |     resp = request(
deploy_workflows-1  |            ^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/llama_deploy/cli/utils.py", line 12, in request
deploy_workflows-1  |     return httpx.request(method, url, *args, **kwargs)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_api.py", line 118, in request
deploy_workflows-1  |     return client.request(
deploy_workflows-1  |            ^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_client.py", line 837, in request
deploy_workflows-1  |     return self.send(request, auth=auth, follow_redirects=follow_redirects)
deploy_workflows-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_client.py", line 926, in send
deploy_workflows-1  |     response = self._send_handling_auth(
deploy_workflows-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_client.py", line 954, in _send_handling_auth
deploy_workflows-1  |     response = self._send_handling_redirects(
deploy_workflows-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_client.py", line 991, in _send_handling_redirects
deploy_workflows-1  |     response = self._send_single_request(request)
deploy_workflows-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_client.py", line 1027, in _send_single_request
deploy_workflows-1  |     response = transport.handle_request(request)
deploy_workflows-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 235, in handle_request
deploy_workflows-1  |     with map_httpcore_exceptions():
deploy_workflows-1  |          ^^^^^^^^^^^^^^^^^^^^^^^^^
deploy_workflows-1  |   File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
deploy_workflows-1  |     self.gen.throw(value)
deploy_workflows-1  |   File "/opt/venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions
deploy_workflows-1  |     raise mapped_exc(message) from exc
deploy_workflows-1  | httpx.ReadTimeout: timed out
jabbasj commented 1 month ago

I have a similar issue with the 'simple' message-queue-integrations example but it's not related to apiserver FileNotFoundError:

~/llama_deploy/examples/message-queue-integrations$ docker compose -f ./simple/docker/docker-compose.yml --project-directory ./ up
[+] Running 4/4
 ✔ Network message-queue-integrations_default                  Created                                                                        0.1s 
 ✔ Container message-queue-integrations-message_queue-1        Created                                                                        0.0s 
 ✔ Container message-queue-integrations-control_plane-1        Created                                                                        0.0s 
 ✔ Container message-queue-integrations-funny_joke_workflow-1  Created                                                                        0.0s 
Attaching to control_plane-1, funny_joke_workflow-1, message_queue-1
message_queue-1        | INFO:llama_deploy.message_queues.simple - Launching message queue server at 0.0.0.0:8002
message_queue-1        | INFO:     Started server process [7]
message_queue-1        | INFO:     Waiting for application startup.
message_queue-1        | INFO:     Application startup complete.
message_queue-1        | INFO:     Uvicorn running on http://0.0.0.0:8002 (Press CTRL+C to quit)
control_plane-1        | INFO:llama_deploy.control_plane.server - Launching control plane server at 0.0.0.0:8000
control_plane-1        | INFO:     Started server process [7]
control_plane-1        | INFO:     Waiting for application startup.
control_plane-1        | INFO:     Application startup complete.
control_plane-1        | INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
funny_joke_workflow-1  | Traceback (most recent call last):
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
funny_joke_workflow-1  |     return _run_code(code, main_globals, None,
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
funny_joke_workflow-1  |     exec(code, run_globals)
funny_joke_workflow-1  |   File "/app/multi_workflows_app/deployment/workflow_funny_joke.py", line 9, in <module>
funny_joke_workflow-1  |     asyncio.run(
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
funny_joke_workflow-1  |     return loop.run_until_complete(main)
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
funny_joke_workflow-1  |     return future.result()
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/site-packages/llama_deploy/deploy/deploy.py", line 204, in deploy_workflow
funny_joke_workflow-1  |     queue_config_dict = response.json()
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 766, in json
funny_joke_workflow-1  |     return jsonlib.loads(self.content, **kwargs)
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
funny_joke_workflow-1  |     return _default_decoder.decode(s)
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
funny_joke_workflow-1  |     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
funny_joke_workflow-1  |   File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
funny_joke_workflow-1  |     raise JSONDecodeError("Expecting value", s, err.value) from None
funny_joke_workflow-1  | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
funny_joke_workflow-1 exited with code 1