---
title = "Edge Function 546 error response"
topics = [ "functions" ]
keywords = [ "546", "error", "resource", "memory", "cpu", "event loop", "edge function" ]

[[errors]]
http_status_code = 546
message = "Edge Function error"
---

The 546 error typically indicates resource exhaustion or code issues in your Edge Function.

## Common causes

### Memory or CPU limits

Your function may have exceeded available resources. Check the resource usage metrics in your dashboard at Functions > [Your Function] > Metrics.

### Event loop completion

If logs show "Event loop completed," your function has implementation issues. Check your function code for:

- Syntax errors
- Infinite loops
- Unresolved promises

## Debugging steps

### Run the function locally

Use the Supabase CLI to run your function locally and get detailed stack traces:

```bash
supabase functions serve your-function --debug
```

The local console provides full stack traces with line numbers, making it easier to identify the source of errors.

### Check function logs

Navigate to Functions > [Your Function] > Logs in the dashboard. Look for:

- Error messages
- Resource usage warnings
- Shutdown events with specific reasons

### Review example implementations

Compare your function against working examples in the [Edge Functions examples repository](https://github.com/supabase/supabase/tree/master/examples/edge-functions).

## Additional resources

- [Edge Function shutdown reasons explained](./edge-function-shutdown-reasons-explained)
- [Edge Function wall clock time limit reached](./edge-function-wall-clock-time-limit-reached-Nk38bW)
- [Monitoring resource usage](./edge-function-monitoring-resource-usage)
- [Debugging Edge Functions](/docs/guides/functions/logging)
