Ubuntu Hangs on 'Trying with selected node 0'

I am trying to connect my couchbase sync gateway (2.1) to my couchbase server (4.0.0), both running on Ubuntu 14.04. I get the following error when starting the sync_gateway:

2016-02-09T17:33:18.478-05:00 Enabling logging: [CRUD CRUD+ HTTP HTTP+ Access Cache Changes Changes+] 2016-02-09T17:33:18.478-05:00 ==== Couchbase Sync Gateway/1.2.0(79;9df63a5) ==== 2016-02-09T17:33:18.478-05:00 requestedSoftFDLimit >= currentHardFdLimit (5000 >= 4096) capping at 4096 2016-02-09T17:33:18.478-05:00 Configured process to allow 4096 open file descriptors 2016-02-09T17:33:18.478-05:00 Opening db /default as bucket "sync_gateway", pool "default", server <http://localhost:8091> 2016-02-09T17:33:18.479-05:00 Opening Couchbase database sync_gateway on <http://localhost:8091> 2016/02/09 17:33:18 Trying with selected node 0 2016/02/09 17:33:18 Trying with 2016/02/09 17:33:18 Got new configuration for bucket sync_gateway 2016/02/09 17:33:18 Trying with selected node 0

It just hangs like this indefinitely. It is the exact same issue seen here: https://github.com/couchbase/sync_gateway/issues/1314, except after several restarts of the server, sync gateway, and ubuntu, the problem still persists. Any idea what to do with this?

Here is my config.json:

{ "log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Changes", "Changes+"], "interface":":4984", "verbose":true, "adminInterface":":4985", "databases":{ "default":{ "server":"http://localhost:8091", "bucket":"sync_gateway", "sync": function(doc, oldDoc) { channel(“all_docs”); } } } }

I would like to stay on Ubuntu but could move to Red Hat if I need to. Unfortunately those are the only two linux distros supported by the sync gateway now. Thanks in advance.

1 Like

Can you tell us more about your setup? Is Couchbase running on the same machine as the SyncGateway?

Yes, they are both running on the same Ubuntu image in DigitalOcean. It only has 512mb of ram but that was never a problem before (I am still early in development).

I am having this same issue.
The first time I installed everything worked as expected on DigitalOcean w/ 1G Ram. Ubuntu 14.04 LTS.
Then suddenly it started with this behavior mentioned above and it never started the sync_gateway again.
I detroyed the droplet on DigitalOcean and created it again to no avail… the problem persists…
Don’t know what else to do to brig sync_gateway interfaces up and running.
BTW it seems that with walrus it runs fine…
But it doesnt when configured with the local server.

Any help will be much appreciated.

[UPDATE] [Solved]
Tried many things. Last one was with an Ubuntu 12.04 x64 LTS digital ocean droplet (instead of 14.04 x64).
Installed the same Couchbase 4.0.0 Community and Sync Gateway 1.2 Community on that server.
Setup the sync gateway same as in the original post but the error persisted.
As a last attempt, before falling back to “walrus” in memory server, I created a second bucket with a different name for use with the sync_gateway database.
Updated the config.json to use it. Restarted the sync gateways service… And guess what? It worked!!!
The interface services were started successfully on 4984 and 4985 as shown below.

2016-03-06T08:56:09.886-03:00 ==== Couchbase Sync Gateway/1.2.0(79;9df63a5) ====
2016-03-06T08:56:09.887-03:00 requestedSoftFDLimit >= currentHardFdLimit (5000 >= 4096) capping at 4096
2016-03-06T08:56:09.887-03:00 Configured process to allow 4096 open file descriptors
2016-03-06T08:56:09.887-03:00 Opening db /sync_gateway as bucket "syncGateway", pool "default", server <http://localhost:8091>
2016-03-06T08:56:09.887-03:00 Opening Couchbase database syncGateway on <http://localhost:8091>
2016/03/06 08:56:09  Trying with selected node 0
2016/03/06 08:56:09  Trying with
2016/03/06 08:56:09 Got new configuration for bucket syncGateway
2016/03/06 08:56:10  Trying with selected node 0
2016/03/06 08:56:10 go-couchbase: call to ViewCustom("sync_gateway", "access") in github.com/couchbase/sync_gateway/db.(*DatabaseContext).ComputeSequenceChannelsForPrincipal took 401.513431ms
2016-03-06T08:56:10.729-03:00     Reset guest user to config
2016-03-06T08:56:10.729-03:00 Starting admin server on :4985
2016-03-06T08:56:10.745-03:00 Starting server on :4984 ...

Examining the buckets I noticed the bucked named “sync_gateway” was created with 4Mb and pre-filled with “[0]” where the new one had only around 400K.
Could it be there is some hardcoded handling for the bucket named as “sync_gateway”?
Or because the bucket originally named “sync_gateway” same as the database? Doesn’t make any sense to me. But anyway…

For now I’ll keep the Ubuntu 12.04 droplet as dev box… May upgrade it later…


Thank you for the insight, changing the name to something other than sync_gateway also fixed the problem for me! Ironically, I originally had it named something different, but I had a different problem (which I have since resolved), so I had changed it back to sync_gateway in an attempt to solve that problem.

1 Like