I’m getting this same error running a FTS geospatial N1QL query explain in the admin UI. The query returns results. This is with Couchbase Server 7.0.2 build 6703.
In Chrome 95.0.4638.69:
Internal error generating query plan: TypeError: Cannot read properties of undefined (reading ‘forEach’)
If I run the same in Firefox 94.0.1 this is the error:
Internal error generating query plan: TypeError: result.all_paths_used is undefined
And Safari 15.0 similarly:
Internal error generating query plan: TypeError: undefined is not an object (evaluating ‘result.all_paths_used.forEach’)
I can reproduce it with this query on the travel-sample
bucket (with or without a FTS index):
SELECT *
FROM `travel-sample`.`inventory`.`landmark` AS l
WHERE SEARCH(l, {
"query": {
"top_left": {
"lon": -1.680420,
"lat": 53.509470
},
"bottom_right": {
"lon": -1.234866,
"lat": 53.272751
},
"field": "geo"
}
});
The JavaScript console output is:
myN1qlListener.js:141
Got error: [@25,126:133=‘1.680420’,<3>,6:14],6,14,no viable alternative at input ‘SELECT*FROMtravel-sample
.inventory
.landmark
ASlWHERESEARCH(l,{“query”:{“top_left”:{“lon”:-1.680420’,
myN1qlListener.js:222
no viable alternative at input ‘SELECT*FROMtravel-sample
.inventory
.landmark
ASlWHERESEARCH(l,{“query”:{“top_left”:{“lon”:-1.680420’
myN1qlListener.js:223
SELECT *
FROM^^^travel-sample
.inventory
.landmark
AS l
WHERE SEARCH(l, {
“query”: {
“top_left”: {
“lon”: -1.680420,
“lat”: 53.509470
},
“bottom_right”: {
“lon”: -1.234866,
“lat”: 53.272751
},
“field”: “geo”
}
});
myN1qlListener.js:141
Got error: [@19,67:74=‘1.234866’,<3>,1:67],1,67,extraneous input ‘1.234866’ expecting ‘)’,null
myN1qlListener.js:222
extraneous input ‘1.234866’ expecting ‘)’
myN1qlListener.js:223
search(l
, {“query”: {“bottom_right”: {“lat”: 53.272751, “lon”: (-^^^.234866)}, “field”: “geo”, “top_left”: {“lat”: 53.50947, “lon”: (-1.68042)}}})
qw.query.service.js:1705
Exception analyzing query plan: TypeError: Cannot read properties of undefined (reading ‘forEach’)
It seems to be getting hung up on parsing the lat/lon in the search JSON.