I’m using node.js on a google vm running Debian. The test app connects to the server using the travel-sample bucket and the default collection, then writes a document and reads the document. The document is successfully written a read (see output from script). The script crashes after about 7 seconds.
Software Version
google-cloud/compute@2.6.0
couchbase@3.2.0
Couchbase Server 6.6.0
The script will crash after 7 seconds even if everything after the bucket statement is removed. Minimal crash script - see below for full script that successfully writes and reads
const couchbase = require("couchbase");
const cluster = new couchbase.Cluster("couchbase://10.128.0.3", {
username: "Administrator",
password: "applesauce",
});
const bucket = cluster.bucket("travel-sample");
Full Script
const couchbase = require("couchbase");
const cluster = new couchbase.Cluster("couchbase://10.128.0.3", {
username: "Administrator",
password: "applesauce",
});
const bucket = cluster.bucket("travel-sample");
const collection = bucket.defaultCollection();
const airline = {
type: "airline",
id: 8091,
callsign: "ddd",
name: "Couchbase Airways"
};
const upsertDocument = async (doc) => {
try {
const key = "airline_8091"; // doc.docMeta.key;
const result = await collection.upsert(key, doc);
console.log("Upsert Result: ");
console.log(result);
} catch (error) {
console.log("Upsert Error...");
console.error(error);
}
};
upsertDocument(airline);
const getAirlineByKey = async (key) => {
try {
const result = await collection.get(key);
console.log("Get Result: ");
console.log(result);
} catch (error) {
console.error(error);
}
};
getAirlineByKey("airline_8091");
Output
sudo node app.js
upsert Result:
MutationResult {
cas: CbCas { '0': <Buffer 00 00 69 37 98 5d 99 16> },
token: CbMutationToken {
'0': <Buffer 77 77 f8 25 e8 12 00 00 01 00 00 00 00 00 00 00 a9 03 00 00 00 00 00 00 74 7
2 61 76 65 6c 2d 73 61 6d 70 6c 65 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 230 more bytes>
}
}
Get Result:
GetResult {
content: {
type: 'airline',
id: 8091,
callsign: 'ddd',
name: 'Couchbase Airways'
},
cas: CbCas { '0': <Buffer 00 00 69 37 98 5d 99 16> },
expiryTime: undefined
}
Crashes after about 7 seconds
#
# Fatal error in , line 0
# Check failed: AllowJavascriptExecution::IsAllowed(isolate).
#
#
#
#FailureMessage Object: 0x7ffd0e40efb0
1: 0xb6afe1 [node]
2: 0x1bd40d4 V8_Fatal(char const*, ...) [node]
3: 0xe2995f [node]
4: 0xe2a1df 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>*) [node]
5: 0xd03257 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [node]
6: 0x7f8131bad018 couchnode::Logger::handler(unsigned int, char const*, int, char const*, int, char const*, __va_list_tag*) [/home/connect/wayapi/node_modules/couchbase/build/Release/couchbase_impl.node]
7: 0x7f8131bad1f6 couchnode::Logger::lcbHandler(lcb_LOGGER_ const*, unsigned long, char const*, lcb_LOG_SEVERITY, char const*, int, char const*, __va_list_tag*) [/home/connect/wayapi/node_modules/couchbase/build/Release/couchbase_impl.node]
8: 0x7f8131c3b147 lcb_log [/home/connect/wayapi/node_modules/couchbase/build/Release/couchbase_impl.node]
9: 0x7f8131bc9d33 lcb::Server::finalize_errored_ctx() [/home/connect/wayapi/node_modules/couchbase/build/Release/couchbase_impl.node]
10: 0x7f8131c37238 lcb_destroy [/home/connect/wayapi/node_modules/couchbase/build/Release/couchbase_impl.node]
11: 0x7f8131ba582c couchnode::Connection::~Connection() [/home/connect/wayapi/node_modules/couchbase/build/Release/couchbase_impl.node]
12: 0x7f8131ba5951 couchnode::Connection::~Connection() [/home/connect/wayapi/node_modules/couchbase/build/Release/couchbase_impl.node]
13: 0xe682bf v8::internal::GlobalHandles::InvokeFirstPassWeakCallbacks() [node]
14: 0xec05e3 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
15: 0xec1cc7 v8::internal::Heap::FinalizeIncrementalMarkingIfComplete(v8::internal::GarbageCollectionReason) [node]
16: 0xec55e0 v8::internal::IncrementalMarkingJob::Task::RunInternal() [node]
17: 0xdbcc1b non-virtual thunk to v8::internal::CancelableTask::Run() [node]
18: 0xb6c634 node::PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<v8::Task, std::default_delete<v8::Task> >) [node]
19: 0xb6e499 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [node]
20: 0x1542096 [node]
21: 0x1554e25 [node]
22: 0x15429c8 uv_run [node]
23: 0xa3ff25 node::SpinEventLoop(node::Environment*) [node]
24: 0xb40ff6 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [node]
25: 0xac6792 node::Start(int, char**) [node]
26: 0x7f813470909b __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
27: 0xa3c0dc [node]
Trace/breakpoint trap