β οΈ Troubleshooting Guide
This page outlines common issues you may encounter when working with the Snapr project, and how to resolve them efficiently.
β‘ Modal App Not Running
Symptoms:
- Errors like
ft loaded failed
or[ERROR] Remote RAGPricer failed
- Agents not responding or failing silently
Fix:
-
Make sure the Modal app is running.
-
It should start automatically with
make docker-run
. Youβll see output similar to:β Created objects. βββ π¨ Created mount PythonPackage:src βββ π¨ Created function RAGPricer.*. βββ π¨ Created function XGBPricer.*. βββ π¨ Created function EnsemblePricer.*. βββ π¨ Created function FTPricer.*. β App deployed in 2.806s! π
-
-
If you manually deleted the app in Modal:
- Set the correct environment in
src/config/constants.py
:env=PROD # or env=DEV
- Then run make
make docker-run
to redeploy.
- Set the correct environment in
-
Check the logs in Modal for errors.
π¨ Code Formatting
Symptoms:
- Pre-commit hook errors related to PEP8/code formatting (Ruff)
Fix:
-
For any PEP8 or code formatting failures flagged by pre-commit:
- Quick fix: Run
make fix
to auto-fix most issues, thenmake lint
to verify - Manual fix: Address each issue shown in the pre-commit log output
- Quick fix: Run
π API Key Issues
Symptoms:
- Agent calls to Modal or OpenAI fail
- Authentication errors in logs
Fix:
-
Ensure your
.env
file exists and includes valid tokens:MODAL_TOKEN_ID
MODAL_TOKEN_SECRET
OPENAI_API_KEY
-
A sample
env.example
is provided with a list of all tokens required for this project.
π Env Misconfig
Symptoms:
- Wrong app being deployed
- Unexpected behavior or resource usage
Fix:
- Set the correct environment in
src/config/constants.py
:env=DEV # or env=PROD
-
Then run make
make docker-run
to redeploy. -
For production: Ensure the deployment workflow (CI/CD) sets the environment to
prod
after execution.
6. π³ Docker Cache
Status:
- No known issues.
Donβt clear Docker/Modal volumes unless you intend to.