Panic: runtime error: invalid memory address or nil pointer dereference

Hello,
I have Couchbase Server 4.5 CE, i have a bucket with 20M records.
I have a 3 machine cluster with Data/Index/Query.
I have a simple index on the bucket, the index is on machine 1.
CREATE INDEX index ON bucket(action,field, field2) USING GSI WITH {“nodes”:“xxx.xxx.xxx.xx1:8091”};

When i do the query:
select * from bucket where action = 3 limit 1

On Machine 1 (where index is)
I get the panic runtime error.

if i do the query on machine 2 or 3 everything works fine.

This error start when i migrate from Couchbase 4.1 CE to 4.5 CE.
Any ideas why this is happening?
Can this be a Bug?

Thanks

Reinstalling Couchbase on the machine solve the panic error.
But now when i do the query some times i have results, some times i don’t.
Don’t know what can cause this behavior?

Any help?

Thanks

Hi @rafael.felix,

Could you provide more detail about the N1QL queries that you are having problems with?

Hello,
The index is:
CREATE INDEX index ON bucket(action,field,field2) USING GSI WITH {“nodes”:“xxx.xxx.xxx.xx1:8091”};
and the query is:
select * from bucket where action = 3 limit 1

Nothing complex, sometimes i get results, some times i don’t, this on one specific machine.
Like i said before, i reinstalled couchbase, but still have the problem.

@rafael.felix,

Could you try an EXPLAIN on that SELECT, and see what index is being used? Also, when you don’t get results, are you just getting an empty array, or are you getting an error?

Explain:
[
{
“plan”: {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Sequence”,
"~children": [
{
"#operator": “IndexScan”,
“index”: “omnibeesevents_action_propertyid_createddate_3”,
“index_id”: “dc1854b6e47c81bb”,
“keyspace”: “OmnibeesEvents”,
“limit”: “1”,
“namespace”: “default”,
“spans”: [
{
“Range”: {
“High”: [
“successor(3)”
],
“Inclusion”: 1,
“Low”: [
“3”
]
}
}
],
“using”: “gsi”
},
{
"#operator": “Parallel”,
"~child": {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Fetch”,
“keyspace”: “OmnibeesEvents”,
“namespace”: “default”
},
{
"#operator": “Filter”,
“condition”: “((OmnibeesEvents.action) = 3)”
},
{
"#operator": “InitialProject”,
“result_terms”: [
{
“expr”: “self”,
“star”: true
}
]
},
{
"#operator": “FinalProject”
}
]
}
}
]
},
{
"#operator": “Limit”,
“expr”: “1”
}
]
},
“text”: “select * from OmnibeesEvents where action = 3 limit 1”
}
]

Before reinstall sometimes i got the panic error, other times i get an empty array.
After reinstall i get empty array, no error.

@rafael.felix,

Could you try select b.* from bucket b where b.action = 3 limit 1 and see if that returns the records you expect? If not, I’m going to have to refer you over to the N1QL forums to talk to N1QL expert @geraldss.

hi,
To resolve the problem until i can replicate and find a solution in development environment, i disable query and index service on that machine.
When i add that services again i will test the query and get back to you.
Thanks for your help.