aws / aws-xray-sdk-node

The official AWS X-Ray SDK for Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertionError [ERR_ASSERTION]: context not currently entered; can't exit

KarthikMuthuvel opened this issue · comments

Hello All,

We keep getting the error "AssertionError [ERR_ASSERTION]: context not currently entered; can't exit." followed by below AWS XRAY trace logs in cloudwatch.

Namespace {

name: 'AWSXRay',
active: null,
_set: [],
id: -1,
_contexts: Map(54) {
2** => { _ns_name: 'AWSXRay', id: 2**, segment: [Segment] },
68 => { _ns_name: 'AWSXRay', id: 68, segment: [Subsegment] },
....
.....
.....
.....
at Namespace.exit (/src/node_modules/cls-hooked/context.js:220:12)

We have setup our Node js container service in ECS. Due to this error we get memory leaks / exception and the ECS tasks go to unhealthy state after a while. We couldn't replicate the same error in our local.

we use aws-sdk: 2.1003.0 ; aws-xray-sdk: 3.3.3.

Is this something caused by Xray Module. Can anyone please provide your inputs on this.

Thanks

Hello!
Is it possible to attempt replicating the problem again locally so we can follow the same steps and trace the source of the issue? Any additional information and steps to reproduce the error you are seeing would be very helpful as well.

Hi @carolabadeer , Thanks for responding.

We have tried multiple times on different scenarios and we couldn't replicate the same in local. We have also checked with AWS support, since it is an error from node module, they coudln't help and they suggested to get help from here. Can you please provide suggestions to replicate.

Thanks

@KarthikMuthuvel does the code for this project that is generating this error available on a public repository? Unfortunately it's difficult to tell what the root cause of this problem is without more information

Similar issue I am also facing in my project. Not able to find the root cause

I am also facing same issue in my project...@KarthikMuthuvel is it resolved?

Hi @KarthikMuthuvel can you please provide the complete stack trace for investigation?

Also running into this on aws-xray-sdk-core 3.4.1

@ncino-esselman can you try upgrading to the latest version (3.5.1) to see if the issue still persists in the latest version? If it does, can you provide a reproducible example or some guidance that can help with investigating the root cause?