# fastapi.HTTPException: 404 Not Found

- **ID:** `python/fastapi-httpexception-not-found`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Requested URL does not match any defined route.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **Verify URL and method match a route** (90% success)
   ```
   Check app routes: for route in app.routes: print(route.path, route.methods)
   ```
2. **Add a catch-all route for debugging** (80% success)
   ```
   @app.api_route('/{path:path}', methods=['GET', 'POST'])
async def catch_all(path: str):
    return {'path': path}
   ```

## Dead Ends

- **Assuming trailing slash doesn't matter** — FastAPI distinguishes between /path and /path/ unless configured. (50% fail)
- **Using wrong HTTP method** — Route may exist but not for the used method (e.g., POST vs GET). (70% fail)
