Node.js application Buffers are created as empty in ECS Fargate

0

Hello, I'm running a NodeJS microservice API on ECS Fargate.

One of these services uses NodeJS's Buffer.from constructor to create a new buffer from a string however the buffer creation is faulty and it seems to happen only with the deployed ECS Fargate version (testing locally as well as a built copy on a separate server and there it works, buffer is properly created). For some reason, Buffers created in ECS Fargate are empty - they are valid Buffers but the size is 0 bytes when it should be 32 bytes.

Debugging shows that the payload exists the moment the Buffer is being created. I'm a first time user of Fargate and ECS in general and I have no idea if there are some kind of hidden limitations with ECS runtimes that I can't seem to find from documentation.

The service is allocated with 0.25vCPU and 1GB of RAM. From graphs I can see that the CPU utilization is 10% and MemoryUtilization is 8% so it doesn't seem to be an actual resource starvation that is causing it.

Is this intended behaviour with ECS or is this something that is configurable or am I just overlooking something?

  • It should not have any issues. Are you done something similar to this? |

    var buf = Buffer.from('abc');
    console.log(buf); 
    

    If yes, it shouldn't create an empty buffer. What about the logs? What are you seeing on them?

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions