Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 101 error listeners added to [RuntimeApiClient]. #2532

Closed
clabnet opened this issue May 10, 2024 · 10 comments

Comments

@clabnet
Copy link

clabnet commented May 10, 2024

We have three Platformatic DB services v.1.36.2 running on a staging environment.
All three services (Mailer, Gemini, Mizar) require more and more memory until they cause the server to crash.

This is the charts of memory
image

This image is related to log related to one of these services, it is the same as others services log.
From 2024-05-08 22:18 to 2024-05-10 06:24 the service's API are not called by any application.
image

Please support us, thank you.
image

@mcollina
Copy link
Member

Can you please run it with --trace-warnings and paste the warning?

@clabnet
Copy link
Author

clabnet commented May 10, 2024

@mcollina Thank you.
I should be add this parameters to start of platformatic on Dockerfile, as is :
CMD ["platformatic", "start", "--trace-warnings"]
It is correct ?

@mcollina
Copy link
Member

No, try setting the env NODE_OPTIONS=--trace-warnings.

@clabnet
Copy link
Author

clabnet commented May 10, 2024

Ok, I have added this env settings after the base image

FROM platformatic/platformatic:latest as base
ENV NODE_OPTIONS=--trace-warnings

Now will proceed to deploy on Azure. I think is need 1 or 2 days before crash the server.
I will inform you.

@clabnet
Copy link
Author

clabnet commented May 13, 2024

@mcollina Memory occupancy is increasing more and more, but I have not yet other messages on the log.
image

Any API was not called, the service is not used from others applications. There are the logs at now :

Regenerating global.d.ts
generating types
Registered plugin nodemailer
Registered plugin fastify-view
Registered plugin fastify-static
Registered plugin fastify-env
Public local folder: /app/public
Migrating from /app/services/mailer/migrations/*
running migrations
start query
loaded schema lock
end query
skipping autoloading of file because it does not export a Fastify plugin compatible shape
Server listening at http://0.0.0.0:5011
start watching files
All routes loaded! Check your console for the route details.
skipping autoloading of file because it does not export a Fastify plugin compatible shape

When ENV NODE_OPTIONS=--trace-warnings will cause the messages ? I hope before the crash.

@clabnet
Copy link
Author

clabnet commented May 14, 2024

I expect the system to crash soon

image

@mcollina
Copy link
Member

It will print the messages when the warning in the OP will be emitted.
I highly doubt it's related but it's better to check.

@clabnet
Copy link
Author

clabnet commented May 14, 2024

@mcollina Now the Azure VM is crashed. There are the logs.

image

Other info: this is a service with one table only, Postgresdb, Typescript, with not any custom routes, created by pnpm create platformatic@latest command. Also other two services, "gemelli", have the same behaviour.

@mcollina
Copy link
Member

You have started this thread by asking about an EE leak. You have not really posted those warnings again or the relative stacktrace.

@clabnet
Copy link
Author

clabnet commented May 15, 2024

I have reported the full parts of log returned by the faulted service. Probably the initial logs are overrided by ENV NODE_OPTIONS=--trace-warnings.

So, good news. I solved the problem setting false to PLT_HOT_RELOAD and PLT_MANAGEMENT_API to docker compose.

@clabnet clabnet closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants