Forge tunnel crashes when using an external libraries

Hi,

I’m developing a Custom UI app and I recently encountered an issue.
Seems like forge tunnel doesn’t work when the runtime snapshot is true. I’m getting the below error:

=== Snapshotting functions...


#
# Fatal error in , line 0
# Check failed: (backing_store) != nullptr.
#
#
#
#FailureMessage Object: 0x7ffcb642a810
 1: 0xaa8321  [node]
 2: 0x1a46f04 V8_Fatal(char const*, ...) [node]
 3: 0x11108ec bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
 4: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
 5: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
 6: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
 7: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
 8: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
 9: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
10: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
11: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
12: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
13: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
14: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
15: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
16: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
17: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
18: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
19: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
20: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
21: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
22: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
23: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
24: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
25: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
26: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
27: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
28: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
29: 0x11107d5 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
30: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
31: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
32: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
33: 0x11107d5 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
34: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
35: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
36: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
37: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
38: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
39: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
40: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
41: 0x11107d5 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
42: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
43: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
44: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
45: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
46: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
47: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
48: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
49: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
50: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
51: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
52: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
53: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
54: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
55: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
56: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
57: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
58: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
59: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
60: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
61: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
62: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
63: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
64: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
65: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
66: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
67: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
68: 0x110af64 v8::internal::ContextDeserializer::Deserialize(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSGlobalProxy>, v8::DeserializeInternalFieldsCallback) [node]
69: 0x110b774 v8::internal::ContextDeserializer::DeserializeContext(v8::internal::Isolate*, v8::internal::SnapshotData const*, bool, v8::internal::Handle<v8::internal::JSGlobalProxy>, v8::DeserializeInternalFieldsCallback) [node]
70: 0x1131b6a v8::internal::Snapshot::NewContextFromSnapshot(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSGlobalProxy>, unsigned long, v8::DeserializeInternalFieldsCallback) [node]
71: 0xe32d98 v8::internal::Genesis::Genesis(v8::internal::Isolate*, v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node
]
72: 0xe33148 v8::internal::Bootstrapper::CreateEnvironment(v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, v8::ExtensionConfiguration*, unsigned long, v8::DeserializeInternalFieldsCallback, v8::Mi
crotaskQueue*) [node]
73: 0xbcfa8e v8::NewContext(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocal<v8::ObjectTemplate>, v8::MaybeLocal<v8::Value>, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node]
75: 0x7feafdd6b534 ivm::IsolateEnvironment::NewContext() [/tunnel/node_modules/@forge/isolated-vm/build/Release/isolated_vm.node]
77: 0x7feafdd9abe9 ivm::IsolateHandle::New(v8::MaybeLocal<v8::Object>) [/tunnel/node_modules/@forge/isolated-vm/build/Release/isolated_vm.node]
78: 0x7feafdda2a45 ivm::ConstructorFunction<std::unique_ptr<ivm::ClassHandle, std::default_delete<ivm::ClassHandle> > (*)(v8::MaybeLocal<v8::Object>), &ivm::IsolateHandle::New>::Entry(v8::FunctionCallbackInfo<v8::Value> const&) [/tunne
l/node_modules/@forge/isolated-vm/build/Release/isolated_vm.node]
79: 0xc272e5  [node]
80: 0xc278ef  [node]
81: 0xc27f16 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
82: 0x1448ef9  [node]

This happened when I tried to import an external library (jwt-simple or atlassian-jwt) in the Forge part of the application.

I’m using node 16.13.2 and @forge/cli 4.1.0.

When deploying the app (with snapshot true) it’s working as expected.
When setting the snapshot to ‘false’ and working with a tunnel, it’s also working as expected.

Seems like the issue is only with the tunnel.

I saw this issue reported a month ago: 10 Feb 2022 - Forge CLI version 3.0.0 - #9 by OnucheIdoko1

2 Likes

We use atlassian-jwt in our project actually.

And you are able to use the tunnel with snapshot set to true?

Actually, the default is for snapshot true.

I had to set it to false for tunnel to work.

That’s exactly what’s happening in my case…
For some reason, it’s not working anymore when the snapshot is set to true.

Yes true.

May be some Atlassian guys can give us some tips here.

It’s been a week already and no response.
I really hope that someone from Atlassian will answer here…

I found that snapshotting does not work when certain third-party libraries are included. In particular, libs that reference the “crypto” builtins seem to cause problems.

2 Likes

Seeing the same issue here when incorporating typescript into our Forge app code. Turning snapshot off allows us to run in the tunnel but it’s not clear to me what we are sacrificing by doing that.

If the snapshot is set to false, with tunneling you need to do npm run build for your changes to reflect.

With snapshot true, your custom UI changes reflect automatically when tunneling.

ouch - thats unfortunate. thanks for the info @OnucheIdoko1

It’s strange that no one from Atlassian replied here so far…
Looks like something that needs to be addressed.

Hi @amityahav, I sincerely apologise in the delay in reaching out in this thread.

We are unfortunately aware of the issue while tunnelling with snapshotting. We believe that this is the result of the snapshot size being sent, exceeding the configured Isolate limits that we use and causing the tunnel to crash.

We are currently investigating increasing the isolate memory limits, which our current testing indicates fixes this issue. This will hopefully be included in the next release of the CLI.

In the meantime, as @OnucheIdoko1 mentioned, a solution to getting the tunnel to work is to disable snapshotting while tunnelling, then re-enabling it before you deploy your app.

Again, apologies for the delay in reaching out. We are aiming to have this resolved as soon as possible.

I will keep everyone updated on the progress on the fix and when developers can expect it to be released.

Thanks

2 Likes

Thanks, @MatthewFreeman.

I hope it will be resolved soon.