How to Solve 'EMFILE: Too Many Open Files' Error Triggered by WF Sent Gmail Emails Every 15 Minutes?

This topic was automatically generated from Slack. You can find the original thread here.

Hello there! Could you possibly suggest any solution for this issue I have, please?
The trigger for WF is sent Gmail emails (every 15 mins).

Error: EMFILE: too many open files, scandir '/tmp/__pds__'
    at Object.readdirSync (fs.js:1048:3)
    at module.exports (/var/task/node_modules/rmrf/index.js:5:20)
    at clearScriptTemp (file:///var/task/lambda_handler.mjs:410:3)
    at Runner.runUserCode (file:///var/task/lambda_handler.mjs:856:13)
    at Runner.run (file:///var/task/lambda_handler.mjs:698:12)
    at Runtime.handler (file:///var/task/lambda_handler.mjs:914:48)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

I can provide the WF link and access if necessary.
Thanks in advance :heart:

Hi , could you share a screenshot of your trigger?

Sure! There it is!

could you share screenshot of the step having error?

It happened 4 times only (1 error is not related to this issue). This WF works fine mostly.

It’s the trigger step, as far as I see. Shared the 2nd SS as well.

Thanks , I will check this with Pipedream component dev

Should I wait for a bit, then you’re gonna contact me here in this thread?

please considering this an asynchronous communication, meaning don’t wait for the response. I will ping you when there’s an update on this, but it won’t be immediate

Yeah, I got you. Thanks :slightly_smiling_face:

Hey , did it only happen in that sequence? Or were there any other times too?
Can you try replaying the event and see if the error happens again?

Hey! I am almost sure it happened in this particular wf only. I’ve restarted all the 4 executions, and it worked fine this time.

However, I wanted to make sure that it is some kind of a corner-case / container error and I do not need to manage Execution controls.

What’s your opinion?

Looks good to me!
Let us know if anything pops up again!

Alright. Let’s keep an eye on this one.
Appreciate your help!

@U03CXTHK4RF Hello there! Faced this issue again.

It’s happened more than 20 times.
Also, the trigger has been created on the 28th, but it is processing not the new emails only, but it is processing the emails sent on the 27th and 26th as well.

We noticed that the error might be showing up due to the high volume of emails you receive in a short period of time. It’s definitely needing an improvement in the component code. Let me try to reproduce to confirm the suspicion

Sure! I’m looking forward to the reply from your side.

Hi , thanks for you patience. I took this to the core team and will come back to you when I have a response. Note that they are out of office today due to the holiday in the US.

I noticed there is an update available for the Gmail source. Can you try making a copy of the workflow (as a backup), update the trigger version in the new workflow and deploy it? The updated code might help resolve the issue, but no guarantees. Note that if you don’t pause 1 workflow, your consumed credits will be doubled.

Hi! It seems that there were no issues during the past couple of days. I’ll take a look at my logs and update the trigger if there will be any issues, same to these we used to have.

For now, I’d just like to get any comments from the core team of your :з
So to say, I do believe that there will be a possibility to perform some specific actions, as soon as we get a response from them.