Not able to connect to Couchbase Sync Gateway 3.1 on port 4984

We have installed Couchbase Sync Gateway 3.1 on Ubuntu 20.04 on an Azure VM.
However, we are not able to connect to it on port 4984.
When we are trying

curl -vX GET 'http://localhost:4984'

We are getting the following error message:

Note: Unnecessary use of -X or --request, GET is already inferred.
  Trying 127.0.0.1:4984...
TCP_NODELAY set
connect to 127.0.0.1 port 4984 failed: Connection refused
Failed to connect to localhost port 4984: Connection refused
Closing connection 0
curl: (7) Failed to connect to localhost port 4984: Connection refused

On the VM, we have opened up ports 4984,4985 and 4986.
However, when we run the sudo ss -ltnp command on the VM, we are not able to see the sync gateway ports.

Please let me know what we are missing.

@bbrks
Please can you help?


Bootstrap config:

{
        "bootstrap": {
                "server": "couchbases://xx.xxx.xx.xxx",
                "username": "xxxxxxxx",
                "password": "xxxxxxxx",
                "server_tls_skip_verify": true,
                "use_tls_server": true
        },
        "api": {
        "admin_interface": "127.0.0.1:4985",
        "admin_interface_authentication": true,
        "compress_responses": true,
        "enable_advanced_auth_dp": true,
        "hide_product_version": true,
        "idle_timeout": "90s",
        "max_connections": 0,
        "pretty": true,
        "profile_interface": "127.0.0.1:4984",
        "public_interface": ":4984",
        "read_header_timeout": "30s",
         "server_read_timeout": "30s",
         "server_write_timeout": "30s"
   },
        "logging": {
                "log_file_path": "/var/tmp/sglogs",
                "redaction_level": "partial",
                "console": {
                        "log_level": "none",
                        "log_keys": [
                                "*"
                        ]
                },
                "error": {
                        "enabled": true,
                        "rotation": {
                                "max_size": 20,
                                "max_age": 180
                        }
                },
                "warn": {
                        "enabled": true,
                        "rotation": {
                                "max_size": 20,
                                "max_age": 90
                        }
                },
                "info": {
                        "enabled": false
                },
                "debug": {
                        "enabled": false
                }
        }
}

Obvious question but is Sync Gateway running, and has it fully started up (the ports are only opened after initial bootstrap/startup)

I’ve just noticed this in your bootstrap config. This would result in a port conflict. Are there errors starting up?

        "profile_interface": "127.0.0.1:4984",
        "public_interface": ":4984",

@bbrks

The status of Sync Gateway is active.
I believe active status means all is well, or do we need to review the logs?

@bbrks
Please can you let us know the values that we need to add for profile_interface?
The docs doesnt say much.

Thanks for all your help.

I would recommend not setting this config option at all. It’s an option that has existed for a long time but is now of limited use. By default the profiling API is disabled.

You probably won’t need profiling, and if you do, you can get them via the Admin API or automatically via sgcollect.