Query on bucket on remote server returns unknown error

I am opening a bucket on a remote server, waiting for the connect event, then running the following simple viewQuery:

var query = ViewQuery.from('sync_housekeeping', 'all_bits').limit(0);

This should give me the number of rows in the database. However, it always fails after a couple of minutes with the error:
[Error: unknown error : error parsing failed]

I can access the database through the web interface (http://:8091 and see all of the docs in the database. I can also see that this view exists and get a random doc through the web interface.

If I ssh on to the remote machine and run the same query as localhost, it returns practically immediately with the correct row count.

Can anyone give me some pointers on this error?

Thanks,
Giles

@giles does it also happen without the “limit 0”?

Hi @daschl, the behaviour is the same without the limit(0).
It’s also the same with limit 10 (so that something is returned but not everything).

FYI, there are about 220,000 docs in thr bucket.

Thanks,
Giles

Hi @daschl,

Do you have any more thoughts on this. I still don’t have a resolution.

I have found that I don’t get the error when connecting to a different server on the same local network. It’s only when I run the command from a server on a different network that it hangs before giving the unknown error.

Also, the command to get the bucket worked successfully, so I assume that it can see the server, open Couchbase and read the bucket.

Thanks,
Giles

Hey @giles,

Can you confirm that you are able to use curl to query that index from your app server? It looks like there might be a firewall sitting between your app server and Couchbase server.

Cheers, Brett

hi @brett19 and @daschl,

Very sorry for the late reply. I missed brett’s reply with a pre-christmas work rush.

Anyway, back on this now and have tried using curl to read the view. curl does work properly and returns the correct number of rows. However, the SDK version mentioned in the first post still does not hangs. There are currently only three rows in the database.
I don’t really want to post the curl command that I’m using (with our server and bucket details). However, I can send it in a private message, along with my code using the SDK, if there’s a chance you could look at it?

Thanks a lot and aologise again for the late response.
Giles

hi @brett19 and @dschl,

This is now resolved. I didn’t have the node name set correctly in couchbase. Looking at the “Server Nodes” page, it was showing the internal network IP address, which I think it defaults to. I changed this to the external DNS host name using the curl command http://localhost:8091/node/controller/rename and my query command started working as expected. :slight_smile:

Thanks for your help,
Giles