Symptom: You upload a file, get a Job ID, but polling status returns 404 Not Found.
Cause: Relative path mismatch in DATABASE_URL. If you run uvicorn from the root instead of backend/, it creates a new empty database.
Fix:
- Always run
uvicornfrom thebackenddirectory. - We have patched
config.pyto use absolute paths, so this should be rare now.
Symptom: Upload endpoint returns 500.
Cause: Missing audit_logs table in the database.
Fix: Run migrations to update the schema:
cd backend
alembic upgrade head
# Or simply restart the server (Ctrl+C and run uvicorn again) - missing tables are auto-created on startup.Symptom: Worker dies at 30% progress.
Cause: PaddleOCR version mismatch returning different data structure.
Fix: We have patched PaddleOCRService to handle both list-of-lists and list-of-dicts formats. Ensure you are using the latest code.
Symptom: Upload fails with "Network Error" or CORS policy errors in browser console. Cause: Frontend and backend running on different origins without proper CORS configuration. Fix:
- Ensure backend is running on
http://127.0.0.1:8000(notlocalhost) - Frontend should use
http://127.0.0.1:5173 - CORS origins are whitelisted in
backend/main.py
Symptom: Upload fails with "Field required" validation errors.
Cause: Global Content-Type: application/json header interfering with FormData.
Fix: This has been fixed in src/lib/api.ts. Ensure you're using the latest code.
Symptom: Running tests fails with import errors. Fix: Run tests as a module to add current directory to path:
python -m pytest tests/- Backend Logs: Check the terminal running
uvicorn. - Worker Logs: The worker runs in the same process (dev mode). Check console output.
- Database: Use a SQLite viewer to inspect
backend/data/indiaai.db.