googleapis / nodejs-pubsub

Node.js client for Google Cloud Pub/Sub: Ingest event streams from anywhere, at any scale, for simple, reliable, real-time stream analytics.
https://cloud.google.com/pubsub/
Apache License 2.0
524 stars 227 forks source link

Fatal error when recreating subscription #1958

Closed garrettg123 closed 3 months ago

garrettg123 commented 3 months ago

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

1) Is this a client library issue or a product issue? This is the client library for . We will only be able to assist with issues that pertain to the behaviors of this library. If the issue you're experiencing is due to the behavior of the product itself, please visit the [ Support page]() to reach the most relevant engineers.

2) Did someone already solve this?

3) Do you have a support contract? Please create an issue in the support console to ensure a timely response.

If the support paths suggested above still do not result in a resolution, please provide the following details.

Environment details

Steps to reproduce

  1. Create a subscription
  2. Delete the subscription
  3. Recreate the subscription
// create
await pubSubClient.createSubscription(
      PUBSUB_TOPIC,
      subscriptionName
    )
subscription = pubSubClient.subscription(subscriptionName, {
    flowControl: {
      maxMessages: 2,
    },
  })

// delete
await pubSubClient.detachSubscription(subscriptionName)
await subscription.delete()
await pubSubClient.close()

// recreate
await pubSubClient.createSubscription(
      PUBSUB_TOPIC,
      subscriptionName
    )

Throws error:

#
# Fatal error in , line 0
# Check failed: AllowJavascriptExecution::IsAllowed(isolate).
#
#
#
#FailureMessage Object: 0x313c5a1a0
 1: 0x105080092 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/usr/local/bin/node]
 2: 0x106340193 V8_Fatal(char const*, ...) [/usr/local/bin/node]
 3: 0x10530bcd4 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/usr/local/bin/node]
 4: 0x10530aec5 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/usr/local/bin/node]
 5: 0x1051d9c46 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/usr/local/bin/node]
 6: 0x104f24fce node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/usr/local/bin/node]
 7: 0x104f3e3ca node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/usr/local/bin/node]
 8: 0x105116768 node::inspector::(anonymous namespace)::JSBindingsConnection<node::inspector::(anonymous namespace)::LocalConnection>::JSBindingsSessionDelegate::SendMessageToFrontend(v8_inspector::StringView const&) [/usr/local/bin/node]
 9: 0x10510c235 node::inspector::(anonymous namespace)::ChannelImpl::sendNotification(std::__1::unique_ptr<v8_inspector::StringBuffer, std::__1::default_delete<v8_inspector::StringBuffer>>) [/usr/local/bin/node]
10: 0x1058c1b12 non-virtual thunk to v8_inspector::V8InspectorSessionImpl::SendProtocolNotification(std::__1::unique_ptr<v8_crdtp::Serializable, std::__1::default_delete<v8_crdtp::Serializable>>) [/usr/local/bin/node]
11: 0x105af33c0 v8_inspector::protocol::Debugger::Frontend::paused(std::__1::unique_ptr<std::__1::vector<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>, std::__1::allocator<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>>>, std::__1::default_delete<std::__1::vector<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>, std::__1::allocator<std::__1::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__1::default_delete<v8_inspector::protocol::Debugger::CallFrame>>>>>>, v8_inspector::String16 const&, v8_crdtp::detail::PtrMaybe<v8_inspector::protocol::DictionaryValue>, v8_crdtp::detail::PtrMaybe<std::__1::vector<v8_inspector::String16, std::__1::allocator<v8_inspector::String16>>>, v8_crdtp::detail::PtrMaybe<v8_inspector::protocol::Runtime::StackTrace>, v8_crdtp::detail::PtrMaybe<v8_inspector::protocol::Runtime::StackTraceId>, v8_crdtp::detail::PtrMaybe<v8_inspector::protocol::Runtime::StackTraceId>) [/usr/local/bin/node]
12: 0x1058a2a7d v8_inspector::V8DebuggerAgentImpl::didPause(int, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int>> const&, v8::debug::ExceptionType, bool, v8::base::EnumSet<v8::debug::BreakReason, int>) [/usr/local/bin/node]
13: 0x10589d098 std::__1::__function::__func<v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int>> const&, v8::base::EnumSet<v8::debug::BreakReason, int>, v8::debug::ExceptionType, bool)::$_4, std::__1::allocator<v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int>> const&, v8::base::EnumSet<v8::debug::BreakReason, int>, v8::debug::ExceptionType, bool)::$_4>, void (v8_inspector::V8InspectorSessionImpl*)>::operator()(v8_inspector::V8InspectorSessionImpl*&&) [/usr/local/bin/node]
14: 0x1058bd231 v8_inspector::V8InspectorImpl::forEachSession(int, std::__1::function<void (v8_inspector::V8InspectorSessionImpl*)> const&) [/usr/local/bin/node]
15: 0x1058974bd v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__1::vector<int, std::__1::allocator<int>> const&, v8::base::EnumSet<v8::debug::BreakReason, int>, v8::debug::ExceptionType, bool) [/usr/local/bin/node]
16: 0x10589786a v8_inspector::V8Debugger::ExceptionThrown(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, bool, v8::debug::ExceptionType) [/usr/local/bin/node]
17: 0x1052c7652 v8::internal::Debug::OnException(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::debug::ExceptionType) [/usr/local/bin/node]
18: 0x1052c71fa v8::internal::Debug::OnThrow(v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
19: 0x10531ee4d v8::internal::Isolate::ThrowInternal(v8::internal::Object, v8::internal::MessageLocation*) [/usr/local/bin/node]
20: 0x10531ea34 v8::internal::Isolate::StackOverflow() [/usr/local/bin/node]
21: 0x1057f9e86 v8::internal::Runtime_CompileLazy(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
22: 0x105bd4276 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
error Command failed with exit code 133.

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

garrettg123 commented 3 months ago

It appears that this was similarly caused by logging an object:

    const subscriptionCreateResult = await pubSubClient.createSubscription(
      PUBSUB_TOPIC,
      subscriptionName
    )
    log('Subscribed to Gmail notifications', subscriptionCreateResult) // removing the object from the log fixes the error