Skip to content
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

Backend Startup Failure Due to Unset Environment Variables #77

Open
luolin-ai opened this issue Mar 27, 2024 · 6 comments
Open

Backend Startup Failure Due to Unset Environment Variables #77

luolin-ai opened this issue Mar 27, 2024 · 6 comments
Assignees
Labels
deployment Problem with deployment

Comments

@luolin-ai
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\Scripts\python.exe C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\main.py
Traceback (most recent call last):
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\main.py", line 2, in
from app.config import CONFIG
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\config.py", line 103, in
CONFIG = Config()
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\config.py", line 86, in init
self.TASKINGAI_PLUGIN_URL = load_str_env("TASKINGAI_PLUGIN_URL", required=True)
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\config.py", line 33, in load_str_env
raise Exception(f"Env {name} is not set")
Exception: Env TASKINGAI_PLUGIN_URL is not set

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
image

@luolin-ai
Copy link
Author

INFO: Started server process [8616]
INFO: Waiting for application startup.
2024-03-28 03:19:03,844 - fastapi_app - INFO - fastapi app startup...
2024-03-28 03:19:03,844 - fastapi_app - INFO - start plugin cache scheduler...
2024-03-28 03:19:03,845 - apscheduler.scheduler - INFO - Adding job tentatively -- it will be properly scheduled when the scheduler starts
2024-03-28 03:19:03,847 - apscheduler.scheduler - INFO - Added job "sync_data" to job store "default"
2024-03-28 03:19:03,847 - apscheduler.scheduler - INFO - Scheduler started
2024-03-28 03:19:03,847 - fastapi_app - INFO - Syncing model schema data...
2024-03-28 03:19:07,856 - fastapi_app - ERROR - Failed to sync model schema data.
2024-03-28 03:19:07,856 - fastapi_app - INFO - fastapi app shutdown...
ERROR: Traceback (most recent call last):
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\aiohttp\connector.py", line 992, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 1055, in create_connection
raise exceptions[0]
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 1040, in create_connection
sock = await self._connect_sock(
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 954, in _connect_sock
await self.sock_connect(sock, address)
File "C:\Program Files\Python310\lib\asyncio\selector_events.py", line 502, in sock_connect
return await fut
File "C:\Program Files\Python310\lib\asyncio\selector_events.py", line 537, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 8002)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\starlette\routing.py", line 734, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "C:\Program Files\Python310\lib\contextlib.py", line 199, in aenter
return await anext(self.gen)
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\fastapi_app.py", line 43, in lifespan
await sync_data(first_sync=True)
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\fastapi_app.py", line 21, in sync_data
await sync_model_schema_data()
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\services\model\model_schema.py", line 38, in sync_model_schema_data
response = await session.get(
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\aiohttp\client.py", line 578, in _request
conn = await self._connector.connect(
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\aiohttp\connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\aiohttp\connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\aiohttp\connector.py", line 1235, in _create_direct_connection
raise last_exc
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\aiohttp\connector.py", line 1204, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend.venv\lib\site-packages\aiohttp\connector.py", line 1000, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8002 ssl:default [Connect call failed ('127.0.0.1', 8002)]

ERROR: Application startup failed. Exiting.

@jameszyao
Copy link
Contributor

jameszyao commented Mar 28, 2024

It appears you are trying to launch the project from source code.

The application startup failed according to the logs, because the environment variables TASKINGAI_PLUGIN_URL and TASKINGAI_INFERENCE_URL must be specified.

Please set them to point to the Docker pods taskingai/taskingai-plugin and taskingai/taskingai-inference (e.g.http://127.0.0.1:8001 and http://127.0.0.1:8002).

@jameszyao jameszyao changed the title File "C:\Users\86185\Desktop\cuiyi\TaskingAI-0.2.0\TaskingAI-0.2.0\backend\app\config.py", line 33, in load_str_env raise Exception(f"Env {name} is not set") Exception: Env TASKINGAI_PLUGIN_URL is not set Backend Startup Failure Due to Unset Environment Variables Mar 28, 2024
@jameszyao jameszyao self-assigned this Mar 28, 2024
@jameszyao jameszyao added the deployment Problem with deployment label Mar 28, 2024
@luolin-ai
Copy link
Author

is that so
image

@luolin-ai
Copy link
Author

What should I do if I don’t want to use Docker?

@luolin-ai luolin-ai mentioned this issue Mar 28, 2024
@jameszyao
Copy link
Contributor

What should I do if I don’t want to use Docker?

@luolin-ai Since TaskingAI-Inference and TaskingAI-Plugin are not yet ready to be made open-source on GitHub, it is recommended to host TaskingAI directly through Docker.

If you are keen on starting from the source code, please follow our organization and stay updated. We plan to make TaskingAI-Inference open-source in April, followed by TaskingAI-Plugin :-)

@luolin-ai
Copy link
Author

OK 坐等开源 我做一个基于企业微信的TaskingAI客户端 马上项目

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Problem with deployment
Projects
None yet
Development

No branches or pull requests

2 participants