Issue getting all executions from HTTP API Request: 502 Error

Describe the issue/error/question

Getting an error when using API to get all executions from a self-hosted instance.
Error message: 502 - Failed to fetch from https://xxxxxxxxxx.com/api/v1/executions?limit=250&includeData=true
image

Please share more details

Using Coda Pack to call the API.
The instance that gets the issue has 2000+ executions
Have tested it on a different self-hosted instance with 253 executions, it worked fine.

Anyone have some ideas on what might be going on here? Thanks in advance.

I have a theory which might be that the actual data is too much for the server to handle. Can someone from n8n confirm?

I didn’t see this in any documentation, but my hunch is that with the first instance that’s throwing the error, the execution data that gets pulled in from the “includeData=true” is just too much for the API to handle…

cc @Robm fyi

Does the instance crashes after the you hit the endpoint? The UI become non responsive?

Hmm. Not sure since it was @Robm 's instance. Rob did this crash your instance after you try to get the executions from Coda Doc? i.e you couldn’t do anything in your n8n instance right after

I would try sending the same request without the includeData flag. If that solves the issue then you hunch is right. Depending on the size of the workflow, this can get quite big. You can of course leverage the pagination to return less number of records on each request.

@RicardoE105
Yep trying that now without the includeData. Will report back.

I would try the pagination thing, except that pagination doesn’t work for executions. :rofl: I think we had another thread going about that, was waiting on you to get back about that. Sounded like you knew what was wrong

Ahh yes I’m aware of that. I’m the one that wil fix it. Have not got to it but will do.

1 Like

Still you can test it by using a lower limit number in the first page.

1 Like

So removing the includeData parameter worked. Seems like there’s some kind of too much data issue then.

No problem for my application, I was only using the includeData parameter to grab the error message when there’s an error.

I can probably do that by getting the list of executions, then IF the execution is error then get that individual execution details and get the error message from there.

But just something to be aware, maybe add to the API documentation so people know there’s an issue there.

Again, if you use the pagination it should not be an issue, as n8n will never run out of memory because of retrieving too much data.