-
First Check
Commit to Help
Example Code
DescriptionEnvironment variables are not recognized for test backend workflow. Moving .env.example to .env allowed docker to execute successfully, however, fastapi does not recognize these, resulting in this error: Run uv run bash scripts/prestart.sh
Using Python 3.10.15 interpreter at: /opt/hostedtoolcache/Python/3.10.15/x64/bin/python3
Creating virtual environment at: .venv
Installed 81 packages in 86ms
+ python app/backend_pre_start.py
Traceback (most recent call last):
File "/home/runner/work/ecelabs-vue/ecelabs-vue/backend/app/backend_pre_start.py", line 7, in <module>
from app.core.db import engine
File "/home/runner/work/ecelabs-vue/ecelabs-vue/backend/app/core/db.py", line 3, in <module>
from app import crud
File "/home/runner/work/ecelabs-vue/ecelabs-vue/backend/app/crud.py", line 8, in <module>
from app.core import security
File "/home/runner/work/ecelabs-vue/ecelabs-vue/backend/app/core/security.py", line 13, in <module>
from app.core.config import settings
File "/home/runner/work/ecelabs-vue/ecelabs-vue/backend/app/core/config.py", line 114, in <module>
settings = Settings() # type: ignore
File "/home/runner/work/ecelabs-vue/ecelabs-vue/backend/.venv/lib/python3.10/site-packages/pydantic_settings/main.py", line 152, in __init__
super().__init__(
File "/home/runner/work/ecelabs-vue/ecelabs-vue/backend/.venv/lib/python3.10/site-packages/pydantic/main.py", line 2[12](https://github.com/Purdue-ECELabs/ecelabs-vue/actions/runs/11280140352/job/31372426620#step:9:13), in __init__
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 8 validation errors for Settings
SSO_PRIVATE_KEY_PATH
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/missing
USERS_PATH
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/missing
... Where are these variables supposed to be defined? Operating SystemWindows Operating System DetailsWindows 11 Python Version3.10 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Answered by
meme8383
Oct 11, 2024
Replies: 1 comment
-
Resolved by copying .env to backend/.env, however not sure why this is necessary for me. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tiangolo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resolved by copying .env to backend/.env, however not sure why this is necessary for me.