Segmentation fault (core dumped)

Hi Team,

We have 3 different servers for data, index, query.

When we are trying to create models using nodejs - ottoman it gives us an error which says “Segmentation fault (core dumped)”.

However, we have a different development server which has data, index & query services running on it and there everything works fine.

Please let us know how to go about resolving this issue.

Thanks,
Ajinkya

Hi Ajinkya,

Can you give more details?

A segmentation fault is likely the result of a null pointer somewhere. As a guess, since it works when together on one system, there’s a reference being created somewhere that isn’t happening when the setup gets split.

It would help most to cut down your code to find the smallest example that fails, and send details about that.

Hod

Hi Hod,

Thanks for your reply.

I am using ottoman to connect to couchbase.

Have tried connecting to couchbase via the data server / index server / query server one by one. Like connecting using the data server IP at first but it failed, then again using index IP & later using query server IP but the results were same.

Below is the AWS Lambda function that I have tried:

var couchbase=require(‘couchbase’);
var ottoman=require(‘ottoman’);
var config = require("./config");

var myCluster = new couchbase.Cluster(config.couchbase.server); // here tried connecting to either data / index / query server
ottoman.bucket = myCluster.openBucket(config.couchbase.bucket);

require(’./models/users’);

ottoman.ensureIndices(function(err) {
if (err) {
console.log(‘failed to created neccessary indices’, err);
return;
}

console.log('ottoman indices are ready for use!');

});

var user = require(’./models/users’);

exports.handler = function(event, context) {
user.computeHash(event.password, function(err, salt, hash) {
if (err) {
context.fail('Error in hash: ’ + err);
} else {
user.createAndSave(“userDetails details sent to the user creation function”, function (error, done) {

            if (error) {
                context.fail(error.toString());
            }

            context.succeed({
                success: true,
                data: done
            });
        });
    }
});

};

When you run the above function locally to test it gives the same “Segmentation fault(core dumped)” error and when uploaded on Lambda and tested it gives the following error :
{
“errorMessage”: “Process exited before completing request”
}

Please let us know how to proceed further.

Thanks,
Ajinkya

Which OS platform does the node client run on in this case? What version of the node client are you using? There have been some problems with glibc dependencies and I suspect this may be an example of it. @brett19 may be able to give some more info.

Our function is deployed on AWS Lambda using Nodejs V-4.3

What does that correspond to in OS? Amazon Linux?

Yes.

The underlying AWS Lambda execution environment is based on the following:

Public Amazon Linux AMI version (AMI name: amzn-ami-hvm-2015.09.1.x86_64-gp2):
AMI ID – ami-f0091d91 in the US West (Oregon) region.
AMI ID – ami-60b6c60a in the US East (N. Virginia) region.
AMI ID – ami-bff32ccc in the EU (Ireland) region.
AMI ID – ami-bc5b48d0 in the EU (Frankfurt) region.
AMI ID – ami-383c1956 in the Asia Pacific (Tokyo) region.
AMI ID – ami-48d38c2b in the Asia Pacific (Sydney) region.

We’ve made some updates to how the npm loaded. Any chance that’s helped? Is this resolved? I have another thought on approach if you need more help.

We’ve resolved this issue by connecting different nodes using public DNS instead of the elastic IP address which amazon provides i.e: connect your couchbase nodes using public dns like : “ec2-xxx-xxxx”.

However, now we are facing issues while communicating from AWS Lambda to couchbase server residing on ec2 instance.

Below are the errors that we are struggling with

{ “errorMessage”: “Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout”,
“errorType”: “CouchbaseError”,
“stackTrace”: []
}

And after this we get error on queries:
“Cannot perform operation on a shutdown bucket”