Connect to Query Client not running on localhost .NET Core

We are using Couchbase SDK 2.4.7 with dependency injection but cannot connect to the query client. We have a Couchbase Server running on another machine (not localhost). We are getting the following error:

Couchbase.N1QL.QueryClient:Information: Failed query cid1::3: http://127.0.0.1:8093/query

So it is trying to find the queryClient locally. How do we tell it that it is running on a different machine? We can get documents fine, but obviously cannot query them.

AppSetting.json:

{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Debug",
      "Couchbase": "Debug"
    }
  },
  "Couchbase": {
    "Servers": ["http://192.168.30.199:8091/"],
    "Buckets": [
      {
        "Name": "bucket",
        "Password": "password"
      },
    ]
  }
}

Config:

public void ConfigureServices(IServiceCollection services)
{
    //Register CouchBase with configuration Section Service
    services
    .AddCouchbase(Configuration.GetSection("Couchbase"))
    .AddCouchbaseBucket<IMyBucketProvider>("bucket")
    // Add framework services.
    .AddMvc();
}

That’s a known issue as covered in the release notes. There is a workaround which involves setting up your single-node-cluster slightly differently or you can downgrade. Should be fixed in the next maintenance release.

1 Like

Hi,

I am having the same issue. I am running single node CouchBase 5 in a Linux Docker container.
I have updated the hostname of the container to the IP of the Linux VM.
Still no luck.
I am using CouchNetClient 2.4.7 on ASP.Net Core 2 preview 2.

Did I change the hostname in the correct place? Or were you referring to the Linux VM it is running ?

Thanks,


From the debug logs:
2017-07-25 19:04:41.6564|0|Couchbase.CouchbaseBucket|DEBUG|Creating bucket refCount# 0
2017-07-25 19:04:41.6641|0|Couchbase.CouchbaseBucket|INFO|Config updated old/new: 0, 70
2017-07-25 19:04:46.7628|0|Couchbase.N1QL.QueryClient|DEBUG|http://127.0.0.1:8093/query[{“statement”:“SELECT h.* FROM Hcr h WHERE personId = ‘63054feb-57fc-49f7-91a6-b90d5d95a59d’ LIMIT $1”,“timeout”:“30000ms”,“args”:[10],“creds”:[{“user”:“local:Administrator”,“pass”:“dotNetDev@”}],“client_context_id”:“1::2”}]
2017-07-25 19:04:46.7796|0|Couchbase.N1QL.QueryClient|TRACE|Sending query cid1::3: http://127.0.0.1:8093/query
2017-07-25 19:04:47.8174|0|Couchbase.Configuration.Server.Monitoring.ConfigMonitor|DEBUG|Checking configs…
2017-07-25 19:04:47.8337|0|Couchbase.Configuration.Server.Monitoring.ConfigMonitor|INFO|Using index 0 - server Couchbase.Core.Server
2017-07-25 19:04:47.8337|0|Couchbase.Core.Server|DEBUG|Sending Config with key using server 192.168.72.186:11210
2017-07-25 19:04:47.8556|0|Couchbase.IO.Services.PooledIOService|TRACE|Using conn d4c94696-4797-4d24-a689-34e17c4807c6 on 192.168.72.186:11210
2017-07-25 19:04:47.8696|0|Couchbase.Configuration.Server.Monitoring.ConfigMonitor|INFO|Checking config with revision #70
2017-07-25 19:04:47.8976|0|Couchbase.Core.ClusterController|DEBUG|Queueing config rev#70 for [Hcr].
2017-07-25 19:04:47.8976|0|Couchbase.Core.ClusterController|DEBUG|Processing config rev#70
2017-07-25 19:04:47.8976|0|Couchbase.Configuration.Server.Monitoring.ConfigMonitor|DEBUG|Waiting to check configs…
2017-07-25 19:04:47.9219|0|Couchbase.Configuration.Server.Providers.ConfigProviderBase|DEBUG|1. Checking config with rev#70 on thread 13
2017-07-25 19:04:47.9462|0|Couchbase.Configuration.Server.Providers.ConfigProviderBase|INFO|Ignoring config with rev#70
2017-07-25 19:04:48.0264|0|Couchbase.N1QL.QueryClient|INFO|Failed query cid1::3: http://127.0.0.1:8093/query

Here are the container details:

[root@CentOS7Dev home]# docker inspect bf08
[
{
“Id”: “bf08707fdc37842affe6ea3c37a0f267ec934ca70a5c791ccbb5c4b985adb011”,
“Created”: “2017-07-25T16:50:16.4790152Z”,
“Path”: “/entrypoint.sh”,
“Args”: [
“couchbase-server”
],
“State”: {
“Status”: “running”,
“Running”: true,
“Paused”: false,
“Restarting”: false,
“OOMKilled”: false,
“Dead”: false,
“Pid”: 25077,
“ExitCode”: 0,
“Error”: “”,
“StartedAt”: “2017-07-25T16:51:24.3557029Z”,
“FinishedAt”: “2017-07-25T16:51:17.9080024Z”
},
“Image”: “sha256:71a1fd0fdbc3e058e392167563c3fcb651de958284da581895ca359535ba8b86”,
“ResolvConfPath”: “/var/lib/docker/containers/bf08707fdc37842affe6ea3c37a0f267ec934ca70a5c791ccbb5c4b985adb011/resolv.conf”,
“HostnamePath”: “/var/lib/docker/containers/bf08707fdc37842affe6ea3c37a0f267ec934ca70a5c791ccbb5c4b985adb011/hostname”,
“HostsPath”: “/var/lib/docker/containers/bf08707fdc37842affe6ea3c37a0f267ec934ca70a5c791ccbb5c4b985adb011/hosts”,
“LogPath”: “/var/lib/docker/containers/bf08707fdc37842affe6ea3c37a0f267ec934ca70a5c791ccbb5c4b985adb011/bf08707fdc37842affe6ea3c37a0f267ec934ca70a5c791ccbb5c4b985adb011-json.log”,
“Name”: “/couch-5beta2”,
“RestartCount”: 0,
“Driver”: “overlay”,
“MountLabel”: “”,
“ProcessLabel”: “”,
“AppArmorProfile”: “”,
“ExecIDs”: null,
“HostConfig”: {
“Binds”: [
"/opt/couchbase/var:/opt/couchbase/var"
],
“ContainerIDFile”: “”,
“LogConfig”: {
“Type”: “json-file”,
“Config”: {}
},
“NetworkMode”: “default”,
“PortBindings”: {
“11207/tcp”: [
{
“HostIp”: “”,
“HostPort”: “11207”
}
],
“11210/tcp”: [
{
“HostIp”: “”,
“HostPort”: “11210”
}
],
“11211/tcp”: [
{
“HostIp”: “”,
“HostPort”: “11211”
}
],
“18091/tcp”: [
{
“HostIp”: “”,
“HostPort”: “18091”
}
],
“18092/tcp”: [
{
“HostIp”: “”,
“HostPort”: “18092”
}
],
“18093/tcp”: [
{
“HostIp”: “”,
“HostPort”: “18093”
}
],
“8091/tcp”: [
{
“HostIp”: “”,
“HostPort”: “8091”
}
],
“8092/tcp”: [
{
“HostIp”: “”,
“HostPort”: “8092”
}
],
“8093/tcp”: [
{
“HostIp”: “”,
“HostPort”: “8093”
}
],
“8094/tcp”: [
{
“HostIp”: “”,
“HostPort”: “8094”
}
]
},
“RestartPolicy”: {
“Name”: “no”,
“MaximumRetryCount”: 0
},
“AutoRemove”: false,
“VolumeDriver”: “”,
“VolumesFrom”: null,
“CapAdd”: null,
“CapDrop”: null,
“Dns”: [],
“DnsOptions”: [],
“DnsSearch”: [],
“ExtraHosts”: null,
“GroupAdd”: null,
“IpcMode”: “”,
“Cgroup”: “”,
“Links”: null,
“OomScoreAdj”: 0,
“PidMode”: “”,
“Privileged”: false,
“PublishAllPorts”: false,
“ReadonlyRootfs”: false,
“SecurityOpt”: null,
“UTSMode”: “”,
“UsernsMode”: “”,
“ShmSize”: 67108864,
“Runtime”: “runc”,
“ConsoleSize”: [
0,
0
],
“Isolation”: “”,
“CpuShares”: 0,
“Memory”: 0,
“NanoCpus”: 0,
“CgroupParent”: “”,
“BlkioWeight”: 0,
“BlkioWeightDevice”: null,
“BlkioDeviceReadBps”: null,
“BlkioDeviceWriteBps”: null,
“BlkioDeviceReadIOps”: null,
“BlkioDeviceWriteIOps”: null,
“CpuPeriod”: 0,
“CpuQuota”: 0,
“CpuRealtimePeriod”: 0,
“CpuRealtimeRuntime”: 0,
“CpusetCpus”: “”,
“CpusetMems”: “”,
“Devices”: [],
“DeviceCgroupRules”: null,
“DiskQuota”: 0,
“KernelMemory”: 0,
“MemoryReservation”: 0,
“MemorySwap”: 0,
“MemorySwappiness”: -1,
“OomKillDisable”: false,
“PidsLimit”: 0,
“Ulimits”: null,
“CpuCount”: 0,
“CpuPercent”: 0,
“IOMaximumIOps”: 0,
“IOMaximumBandwidth”: 0
},
“GraphDriver”: {
“Data”: {
“LowerDir”: “/var/lib/docker/overlay/00321dde921049d82e0c3581dddd3d08ed4424d426ec2bd4c623dfb25b77af23/root”,
“MergedDir”: “/var/lib/docker/overlay/5994dc389074afed76ece158d045a7811e7eb8046dc289b77b535ddd662a84bb/merged”,
“UpperDir”: “/var/lib/docker/overlay/5994dc389074afed76ece158d045a7811e7eb8046dc289b77b535ddd662a84bb/upper”,
“WorkDir”: “/var/lib/docker/overlay/5994dc389074afed76ece158d045a7811e7eb8046dc289b77b535ddd662a84bb/work”
},
“Name”: “overlay”
},
“Mounts”: [
{
“Type”: “bind”,
“Source”: “/opt/couchbase/var”,
“Destination”: “/opt/couchbase/var”,
“Mode”: “”,
“RW”: true,
“Propagation”: “”
}
],
“Config”: {
“Hostname”: “192.168.72.186”,
“Domainname”: “”,
“User”: “”,
“AttachStdin”: false,
“AttachStdout”: false,
“AttachStderr”: false,
“ExposedPorts”: {
“11207/tcp”: {},
“11210/tcp”: {},
“11211/tcp”: {},
“18091/tcp”: {},
“18092/tcp”: {},
“18093/tcp”: {},
“8091/tcp”: {},
“8092/tcp”: {},
“8093/tcp”: {},
“8094/tcp”: {}
},
“Tty”: false,
“OpenStdin”: false,
“StdinOnce”: false,
“Env”: [
“PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/couchbase/bin:/opt/couchbase/bin/tools:/opt/couchbase/bin/install”
],
“Cmd”: [
“couchbase-server”
],
“ArgsEscaped”: true,
“Image”: “couchbase/server:5.0.0-beta2”,
“Volumes”: {
"/opt/couchbase/var": {}
},
“WorkingDir”: “”,
“Entrypoint”: [
"/entrypoint.sh"
],
“OnBuild”: null,
“Labels”: {}
},
“NetworkSettings”: {
“Bridge”: “”,
“SandboxID”: “4693acd9a2baa5c0d92050a086f4a4e7b7dc9d64d842ce61a7fb79537b8a8e54”,
“HairpinMode”: false,
“LinkLocalIPv6Address”: “”,
“LinkLocalIPv6PrefixLen”: 0,
“Ports”: {
“11207/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “11207”
}
],
“11210/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “11210”
}
],
“11211/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “11211”
}
],
“18091/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “18091”
}
],
“18092/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “18092”
}
],
“18093/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “18093”
}
],
“8091/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “8091”
}
],
“8092/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “8092”
}
],
“8093/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “8093”
}
],
“8094/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “8094”
}
]
},
“SandboxKey”: “/var/run/docker/netns/4693acd9a2ba”,
“SecondaryIPAddresses”: null,
“SecondaryIPv6Addresses”: null,
“EndpointID”: “722d16ce533450d2b18d43b3b8fa17c25b1f8fbe9d6f9792de4896a7bfdc8e3d”,
“Gateway”: “172.17.0.1”,
“GlobalIPv6Address”: “”,
“GlobalIPv6PrefixLen”: 0,
“IPAddress”: “172.17.0.3”,
“IPPrefixLen”: 16,
“IPv6Gateway”: “”,
“MacAddress”: “02:42:ac:11:00:03”,
“Networks”: {
“bridge”: {
“IPAMConfig”: null,
“Links”: null,
“Aliases”: null,
“NetworkID”: “f7bfbe9e189c076111a7e19a60ae1b3fa5dfec2b7f137592ced468240dfad00d”,
“EndpointID”: “722d16ce533450d2b18d43b3b8fa17c25b1f8fbe9d6f9792de4896a7bfdc8e3d”,
“Gateway”: “172.17.0.1”,
“IPAddress”: “172.17.0.3”,
“IPPrefixLen”: 16,
“IPv6Gateway”: “”,
“GlobalIPv6Address”: “”,
“GlobalIPv6PrefixLen”: 0,
“MacAddress”: “02:42:ac:11:00:03”
}
}
}
}
]