kin: KIN-095 При добавлении в среды серверов вылетает ошибка 500 Internal Server Error в модалке

This commit is contained in:
Gros Frumos 2026-03-16 20:58:44 +02:00
parent 8ebc6f1111
commit 1bf0125991
3 changed files with 66 additions and 1 deletions

View file

@ -1170,6 +1170,8 @@ def create_environment(project_id: str, body: EnvironmentCreate):
raise HTTPException(409, f"Environment '{body.name}' already exists for this project")
if "KIN_SECRET_KEY" in str(e):
raise HTTPException(503, "Server misconfiguration: KIN_SECRET_KEY is not set. Contact admin.")
if isinstance(e, ModuleNotFoundError) or "cryptography" in str(e) or "No module named" in str(e):
raise HTTPException(503, "Server misconfiguration: cryptography package not installed. Run: python3.11 -m pip install cryptography")
raise HTTPException(500, str(e))
scan_task_id = None
if body.is_installed:
@ -1237,6 +1239,8 @@ def patch_environment(project_id: str, env_id: int, body: EnvironmentPatch):
raise HTTPException(409, f"Environment name already exists for this project")
if "KIN_SECRET_KEY" in str(e):
raise HTTPException(503, "Server misconfiguration: KIN_SECRET_KEY is not set. Contact admin.")
if isinstance(e, ModuleNotFoundError) or "cryptography" in str(e) or "No module named" in str(e):
raise HTTPException(503, "Server misconfiguration: cryptography package not installed. Run: python3.11 -m pip install cryptography")
raise HTTPException(500, str(e))
scan_task_id = None