<p>We are facing frequent <code>Kubernetes container restarts</code> in our <code>production env</code> and the container aborts by listing down below messages. In Kubernetes events, I also see a Backoff event.
Please find below the error msg log.</p>
<pre><code>#
#
 1: 0xaef6f1  [node]
 3: 0xf5b8b9 v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr&lt;v8::internal::BackingStore&gt;) [node]
 6: 0x7f268814b0ef  [/app/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
# Check failed: result.second.
#
10: 0xcd8cbb  [node]
 1: 0xaef6f1  [node]
 6: 0x7fecce5ef0ef  [/app/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
13: 0x14fa219  [node]
 7: 0x7fecce5f15bb  [/app/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]

 

 8: 0x7fecce5f7ceb Napi::details::CallbackData&lt;void (*)(Napi::CallbackInfo const&amp;), void&gt;::Wrapper(napi_env__*, 
12: 0xcda8e6 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]

 

#FailureMessage Object: 0x7ffce56dd1e0
#
 5: 0xa36020 napi_get_typedarray_info [node]
 2: 0x1af81e4 V8_Fatal(char const*, ...) [node]
 3: 0xf5b8b9 v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr&lt;v8::internal::BackingStore&gt;) [node]
#
Aborted (core dumped)
#FailureMessage Object: 0x7ffdae60ed30
11: 0xcda26c  [node]

 

 4: 0xc99a98 v8::ArrayBuffer::GetBackingStore() [node]

 

#
 9: 0xa2d08f  [node]
# Check failed: result.second.
10: 0xcd8cbb  [node]
 5: 0xa36020 napi_get_typedarray_info [node]
 2: 0x1af81e4 V8_Fatal(char const*, ...) [node]
13: 0x14fa219  [node]
 7: 0x7f268814d5bb  [/app/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
# Fatal error in , line 0
 4: 0xc99a98 v8::ArrayBuffer::GetBackingStore() [node]
#
12: 0xcda8e6 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
#
Aborted (core dumped)
# Fatal error in , line 0
8: 0x7f2688153ceb Napi::details::CallbackData&lt;void (*)(Napi::CallbackInfo const&amp;), void&gt;::Wrapper(napi_env__*, napi_callback_info__*) [/app/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
 9: 0xa2d08f  [node]
11: 0xcda26c  [node]
</code></pre>
<p>I tried searching on the internet but was not able to find anything, some pointers would be really helpful here.</p>

Prabhat Mishra
<p>Without more context this problem is hard to diagnose, but on a high level the answer is quite straight forward:
You have a nodejs based application that uses the ref-napi library for memory/buffer management. <a href="https://www.npmjs.com/package/ref-napi" rel="nofollow noreferrer">https://www.npmjs.com/package/ref-napi</a>
Either you or a dependency is causing a problem related to native memory which lead to a crash of the node process.</p>
<p>Kubernetes notices that the container crashes and restarts it, to keep the pod available. Kubernetes is not to blame here, the application has a problem/bug and crashes. If this is fixed, the container restarts will stop.</p>
