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

log4js.logger - defaultParseCallStack error appears in my logs #1413

Open
Schaka opened this issue Jan 16, 2024 · 11 comments
Open

log4js.logger - defaultParseCallStack error appears in my logs #1413

Schaka opened this issue Jan 16, 2024 · 11 comments

Comments

@Schaka
Copy link

Schaka commented Jan 16, 2024

I see those messages pop up for me once in a while and cannot understand where they're coming from.
They show up in Stackdriver (which observes console output in GCP containers), as well as Sentry which works similarly.

As far as I can tell from the code, this shouldn't be happening at all. Is there any way to turn off those log messages?
They eat into our log budget unfortunately.

I wish I had more info to give you, but the only thing I can see in my logs is the message in the title.
There's nothing else being logged as far as I can tell. Not before and not after.

@lamweili
Copy link
Contributor

Can you paste that entire line of the error? Or a screenshot would be fine as well.

@Schaka
Copy link
Author

Schaka commented Jan 18, 2024

I should've been more clear. That is literally the full output.
I exclude those messages specifically from Sentry for now.

Here's the JSON Stackdriver returns:

{
  "textPayload": "log4js.logger - defaultParseCallStack error",
  "insertId": "op4yv8zdgzceot5s",
  "resource": {
    "type": "k8s_container",
    "labels": {
      "namespace_name": "company-namespace",
      "cluster_name": "cluster-name",
      "pod_name": "application-service-68d6b88b68-xdqxs",
      "location": "europe-west3",
      "container_name": "browser",
      "project_id": "infrastructure-260414"
    }
  },
  "timestamp": "2024-01-18T09:46:10.785199253Z",
  "severity": "ERROR",
  "labels": {
    "k8s-pod/app_kubernetes_io/instance": "application-name-prod",
    "k8s-pod/adsoul_com/stage": "prod",
    "k8s-pod/pod-template-hash": "68d6b88b68",
    "k8s-pod/app_kubernetes_io/name": "application-name",
    "k8s-pod/app_kubernetes_io/part-of": "the-application",
    "k8s-pod/app_kubernetes_io/component": "pcc-service",
    "compute.googleapis.com/resource_name": "gke-server-name-node-2023020809242-7bb25b77-pqtx",
    "k8s-pod/app_kubernetes_io/managed-by": "Helm",
    "k8s-pod/app_kubernetes_io/version": "2bfe0965"
  },
  "logName": "projects/infrastructure-260414/logs/stderr",
  "receiveTimestamp": "2024-01-18T09:46:12.217156923Z"
}

@lamweili
Copy link
Contributor

What's your log4js version?

Do you have a sample/stripped-down code to replicate the issue?
You can upload the zip file here if you have it.

@Schaka
Copy link
Author

Schaka commented Jan 18, 2024

Version is 6.9.1

It's quite the complicated setup, I'm afraid I can't really create a stripped down version.
I'm not even able to reproduce the problem locally.

Meaning it happens only in our GCP environment inside a Docker image.
We have a base image that we add some dependencies into, this image inherits from node:18.19-bullseye
I can't speak to the exact dependencies, but it pretty much only installs Chrome and creates a user to use for the image.

Then we create an image from the one I just talked about. I cleaned up that config for you:
Dockerfile.zip

There's not much more I can give you, unfortunately.
We start a NestJS server, use Log4js as a logger and somehow these errors show up, though never locally. This holds true when running it on a local container (MacOS) too.

If my employer gives me more time, I'll debug some more and try to provide extra resources for you. I'm sorry I can't be of too much help.

@xianping-yan
Copy link

image

@xianping-yan
Copy link

image

"log4js": "^6.9.1",
node: v18.17.0

@lamweili
Copy link
Contributor

lamweili commented Apr 4, 2024

@xianping-yan, do you have more of the stack trace?
Can you provide the log4js configuration?

Or even better, can you upload a sample.zip for me to replicate?

@xianping-yan
Copy link

my-app.zip

I just verified that using it alone in nodejs is not a problem, but when combined with the nextjs framework, this issue will occur. So I think it's a compatibility issue between nextjs and log4js, and the above is the code that caused the problem。

Thank you for your support

@lamweili
Copy link
Contributor

lamweili commented Apr 5, 2024

It would seem that they are using the variable location but I would need some time to look into it.

@xianping-yan
Copy link

OK, Thank you

@xianping-yan
Copy link

image
And please take a look at this prompt question. Thank you very much

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

3 participants