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

Winston throws 'Elasticsearch error' with no other information #234

Open
rauldeheer opened this issue Sep 7, 2023 · 5 comments
Open

Winston throws 'Elasticsearch error' with no other information #234

rauldeheer opened this issue Sep 7, 2023 · 5 comments

Comments

@rauldeheer
Copy link

rauldeheer commented Sep 7, 2023

Our application sometimes receives a Elasticsearch error from node_modules/winston-elasticsearch/bulk_writer.js and specifically on line 134:

.then((res) => {
      if (res && res.errors && res.items) {
        const err = new Error('Elasticsearch error');
        res.items.forEach((item, itemIndex) => {
          const bodyData = body[itemIndex * 2 + 1];

The error appears to be:

elasticsearch indexing error {
  type: 'mapper_parsing_exception',
  reason: 'object mapping for [fields.stack] tried to parse field [null] as object, but found a concrete value'
}

Why and when is such an error usually thrown and what can we do to fix this? This error actually causes our whole container to shut-down. We're using NestJS.

@rauldeheer
Copy link
Author

Any news/information on this?

@rauldeheer
Copy link
Author

I was eventually able to fix this error by just catching all errors in our NestJS application and mutating the error format. It took quite some while to figure out where the exception was actually coming from.

@rauldeheer
Copy link
Author

It still throws this error occasionally. So this is still not fixed unfortunately.

@Elio-FairlyMade
Copy link

We also encounter some issues with this since some weeks on multiple Nest 9 repositories, multiple logs are sent and it seems to loop on it and then crash
image
image

@rauldeheer
Copy link
Author

We eventually just disabled this package and our application never crashes again. Just waiting until it's fixed.

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