# Endpoint returns 500 / "Class not found" in ECS but works locally on Windows
Services: any PHP backend · Owner: backend lead

## Symptom
One or more endpoints of a backend return 500 after a deploy. The same code works on developer
machines. A past incident took down about 25 endpoints while every build stayed green.

## Confirm it is this
CloudWatch `/ecs/<tier>/<service>`: search for `Class` and `not found`, or `Unable to find`. Then from
the repo root:
```bash
python ci/ns-case-check.py
```
It lists every namespace reference whose case doesn't match the real path. Yii's autoloader maps
namespaces straight to paths; Windows/macOS filesystems ignore case, Linux doesn't.

## Fix
Mitigate: `ecs-rollback.md`. Then fix the namespace or the directory case so they match exactly. On
Windows a case-only directory rename needs two steps: `git mv Foo foo_tmp` then `git mv foo_tmp foo`.

## Prevent
CI already runs `ci/ns-case-check.py` before Docker. If it passed and this still happened, the
reference is built dynamically (string class name). Add that pattern to the checker.
