hcengineering/platform · warning
Not found
Error message
Not found
What it means
The pod-notification Express server registers a catch-all middleware that replies HTTP 404 { message: 'Not found' } when no registered endpoint matched the request. It is the route-matching fallback, not a handler error. The notification pod registers its endpoints via createServer; anything else — wrong path or wrong HTTP verb — lands here.
Source
Thrown at services/notification/pod-notification/src/server.ts:47
})()
}
export function createServer (endpoints: Endpoint[]): Express {
const app = express()
app.use(cors())
app.use(express.json())
endpoints.forEach((endpoint) => {
if (endpoint.type === 'get') {
app.get(endpoint.endpoint, catchError(endpoint.handler))
} else if (endpoint.type === 'post') {
app.post(endpoint.endpoint, catchError(endpoint.handler))
}
})
app.use((_req, res, _next) => {
res.status(404).send({ message: 'Not found' })
})
app.use((err: any, _req: any, res: any, _next: any) => {
if (err instanceof ApiError) {
res.status(400).send({ code: err.code, message: err.message })
return
}
res.status(500).send({ message: err.message })
})
return app
}
export function listen (e: Express, port: number, host?: string, onListening?: () => void): Server {
const cb = (): void => {
if (onListening !== undefined) {
onListening()View on GitHub (pinned to 63e28dc964)
Solutions
- Compare the request method+path against the endpoints registered in pod-notification's main.ts and correct the URL/verb.
- Verify the target host:port is the notification pod, not the mail pod (identical 404 bodies make this easy to confuse).
- Check gateway/ingress path rewrites that might alter the prefix before it reaches Express.
- Temporarily log req.method and req.originalUrl before the 404 middleware to see the exact incoming route.
Example fix
// before
await fetch('http://notify:3040/push', { method: 'GET' })
// after
await fetch('http://notify:3040/push', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body }) Defensive patterns
Strategy: validation
Validate before calling
const NOTIFY_ROUTES = ['/push'] // paths registered by pod-notification
function assertNotifyRoute(method: string, path: string) {
if (method !== 'POST' || !NOTIFY_ROUTES.includes(path)) throw new Error(`unknown notification route ${method} ${path}`)
} Try / catch
const res = await fetch(url, opts)
if (res.status === 404) throw new Error(`notification pod has no route for ${opts.method} ${url} — verify path, verb, and target pod`) Prevention
- Share route constants between client and server endpoint registration
- Distinguish notification pod from mail pod ports in config to avoid cross-pod 404s
- Use POST for push endpoints; do not probe undocumented paths
When it happens
Trigger: Requesting a path not among the registered notification endpoints, using GET where type is 'post', or hitting the notification pod expecting mail-pod routes (the two services share the same 404 body).
Common situations: Service discovery misconfiguration pointing clients at the wrong pod; path prefix changes after gateway updates; forgetting that push endpoints require POST; probing the service for documentation endpoints that do not exist.
Related errors
AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29).
Data as JSON: /api/errors/b4f73755e4d876bc.
Report an issue: GitHub.