question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to serialize errors containing a http.ClientRequest

See original GitHub issue

I’m still trying to make a reduced, reproducible case for this one. However, I thought someone might have some ideas about what’s going on.

Running some tests with ava, which performs an HTTP request. At some point it encounters an error that should be sent from the worker to the master process, which calls serialize-error to be able to safely pass the data. After a while it crashes the node process with the following info:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

<--- Last few GCs --->

   81235 ms: Mark-sweep 1397.3 (1458.0) -> 1397.0 (1458.0) MB, 1140.1 / 0 ms [allocation failure] [GC in old space requested].
   82397 ms: Mark-sweep 1397.0 (1458.0) -> 1397.0 (1458.0) MB, 1161.6 / 0 ms [allocation failure] [GC in old space requested].
   83542 ms: Mark-sweep 1397.0 (1458.0) -> 1397.0 (1458.0) MB, 1144.9 / 0 ms [last resort gc].
   84681 ms: Mark-sweep 1397.0 (1458.0) -> 1397.0 (1458.0) MB, 1139.0 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x291f70db4629 <JS Object>
    1: destroyCircular(aka destroyCircular) [/home/espenh/webdev/crown/node_modules/serialize-error/index.js:~20] [pc=0xd42dc460314] (this=0x291f70d041b9 <undefined>,from=0x1f20d233a839 <an Object with map 0x32ba4fda171>,seen=0x2c9b3e0260f1 <JS Array[25]>)
    2: /* anonymous */(aka /* anonymous */) [/home/espenh/webdev/crown/node_modules/serialize-error/index.js:47] [pc=0xd42dc44cb31] (this=0x...

With some trial and error, I’ve reduced the problem down props.error.powerAssertContext.args[0].events[0].value.request. If I exclude this property from the serialization process, it works.

Right before the process fails, it outputs:

(node) Server.connections property is deprecated. Use Server.getConnections method instead.

Any ideas on what is going on here? It seems like there might be a circular reference within the request somehow, that is not being picked up by destroyCircular, properly. I can’t seem to easily reproduce it in the tests for serialize-error, however.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rexxarscommented, Feb 5, 2016

@twada Thanks. My god, this is so counter-intuitive:

t.is(res.statusCode, 508, 'status code should be 508') // Crashes :-(

const statusCode = res.statusCode
t.is(statusCode, 508, 'status code should be 508') // Works just fine :D
0reactions
twadacommented, Feb 5, 2016

@rexxars

this is so counter-intuitive:

Agreed. I’m so sorry for inconvenience 😦 Should be fixed soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python gRPC error: "error": "13 INTERNAL: Failed to serialize ...
the request returns works fine and I get a stream of response of containing allobjects. I do not want to return data in...
Read more >
Converting circular structure to JSON · Issue #836 - GitHub
I'm making an app with NuxtJs and after update Axios from 0.15.3 to 0.16.1, I got bellow error. TypeError: Converting circular structure to ......
Read more >
UnableToDeserializePostBody error when testing with the ...
UnableToDeserializePostBody error when testing with the exact example from documentation. Hi,. I want to create a message using MIME format, ...
Read more >
BigInt Type Error on new Node SDK - Square Developer
I am using an Express backend with the Node SDK. After updating to the latest version of the API, and version 9.0.0 of...
Read more >
Global HTTP Error Handling in Blazor WebAssembly
If you want to gain additional knowledge on Blazor WebAssembly project development, feel free to visit the linked page, which contains all the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found