> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Common issues building Tensorlake applications and how to debug them

## Common Issues

### Function Timeout

If your function is timing out, consider:

1. **Increase the timeout** - Set a higher `timeout` value in your `@function` decorator
2. **Report progress** - Use `ctx.progress.update()` to reset the timeout. See [Streaming Progress Updates](/applications/concepts#streaming-progress-updates)
3. **Check the logs** - Use the Logs API above to see what your function was doing before it timed out

### Request Failed

To investigate a failed request:

1. **Check request state** - Get the full request state including failure reason:

```bash theme={null}
curl -X GET \
  "https://api.tensorlake.ai/applications/{application}/requests/{request_id}" \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY"
```

2. **Review logs** - Filter logs by the request ID to see what happened:

```bash theme={null}
curl -X GET \
  "https://api.tensorlake.ai/applications/{application}/logs?requestId={request_id}" \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY"
```

### Out of Memory

If your function is running out of memory:

1. **Check current allocation** - Review the `memory` setting in your `@function` decorator
2. **Increase memory** - Set `memory` to a higher value (up to 32 GB). See [Memory](/applications/concepts#memory)
3. **Process in batches** - Break large datasets into smaller chunks

### Debugging Tips

* Add `print()` statements in your code to log intermediate values
* Use `ctx.request_id` to correlate logs across function calls. See [Request ID](/applications/concepts#request-id)
* Check that your function has sufficient CPU, memory, and disk resources
* Review retry settings if functions are failing intermittently. See [Retries](/applications/concepts#retries)
