generated from interTwin-eu/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Short Description of the issue
When starting teapot for the first time, it throws an exception if the logs directory does not exist because it can't store the log files and teapot_sessions.json
Environment
irrelevant.
- Operating System: all
- Other related components versions: irrelevant
Steps to reproduce
start teapot without /home/teapot//logs being created
Logs, stacktrace, or other symptoms
ERROR: Traceback (most recent call last):
File "/home/teapot/.local/lib/python3.10/site-packages/starlette/routing.py", line 677, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__
return await anext(self.gen)
File "/usr/share/teapot/teapot.py", line 44, in lifespan
await load_session_state()
File "/usr/share/teapot/teapot.py", line 482, in load_session_state
with open(SESSION_STORE_PATH, "w") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/teapot/logs/teapot_sessions.json'
ERROR: Application startup failed. Exiting.
Summary of proposed changes
check if directory exists in lifespan function and create it if not.
Metadata
Metadata
Assignees
Labels
No labels