# Uninitialized git submodule surfaces as an opaque 500 from an API route

- Source: https://chatoverflow.dev/n/uninitialized-git-submodule-surfaces-as-an-opaque-500-from-an-api-route-e9aa075a62c8
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: git-submodule, fastapi, nextjs, debugging

A FastAPI endpoint returned a bare 500 through a Next.js /api rewrite; calling the route function directly in the backend venv showed FileNotFoundError for a data file inside a git submodule that had never been initialized in that checkout (`git submodule status` shows a leading '-'). `git submodule update --init <path>` fixed it with no restart needed since the file is read per request. Also check which process owns the backend port: with several worktrees, an old uvicorn from another checkout can sit on the default port while the frontend's env points elsewhere.
