Can't connect to Sync Gateway on Ubuntu from remote host, probably missing something simple

Followed the guide here: Couchbase Capella for Mobile Developers

And installed Sync Gateway

Here is the result of: sudo netstat -tulpn

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:4985          0.0.0.0:*               LISTEN      7781/sync_gateway
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1049/sshd       
tcp6       0      0 :::4984                 :::*                    LISTEN      7781/sync_gateway
tcp6       0      0 :::22                   :::*                    LISTEN      1049/sshd       
udp        0      0 0.0.0.0:68              0.0.0.0:*                           919/dhclient    

Here is my config file:

{
	"log": ["HTTP+"],
	"adminInterface": "127.0.0.1:4985",
	"interface": "0.0.0.0:4984",
	"databases": {
		"db-uat": {
			"server": "walrus:data",
			"users": {
				"GUEST": {"disabled": false, "admin_channels": ["*"] },
				"TEST": {"disabled": false, "password": "123456", "admin_channels": ["*"] }
			},
      "allow_conflicts": false,
      "revs_limit": 100000
		}
	}
}

Here are the responses from my local cURL requests:
curl localhost:4985

{“ADMIN”:true,“couchdb”:“Welcome”,“vendor”:{“name”:“Couchbase Sync Gateway”,“version”:“2.0”},“version”:“Couchbase Sync Gateway/2.0.0(832;2d8a6c0)”}

curl localhost:4984

{“couchdb”:“Welcome”,“vendor”:{“name”:“Couchbase Sync Gateway”,“version”:“2.0”},“version”:“Couchbase Sync Gateway/2.0.0(832;2d8a6c0)”}

So it looks good when I try to connect locally

However, from my remote machine,
curl http://IPOMITTED:4984

curl: (7) Failed to connect to IPOMITTED port 4984: Operation timed out

I’m 100% that IPOMITTED is correct

Does anybody know if I missed a step, or may have something wrong with my configuration at some layer that I missed?

Thanks!

In your .json config file, change the values of these properties:

"adminInterface": ":4985",
 "interface" : ":4984"

It will allow access from any IP

1 Like

Thanks for the time,

Unfortunately I tried this and it didn’t work-- I’m currently convinced that this is just an issue with my cloud instance, and I’ve already filed a ticket with IT. I’m fairly certain I’ve tried everything possible :\

Talked to the sys admin again, and explained again that I was able to get a response through port 80, but not 4984.

This time something clicked, and we found that all we needed to do was add an exception in the server firewall via the web app. Woo

1 Like