Couchbase cbbackup fails from remote server

7/28/2020

Couchbase cbbackup failing from the remote server, which has full connectivity to the Couchbase running on K8s.

  • Couchbase Server version: couchbase: community-6.0.0
  • Couchbase running on Kubernetes 1.17.
<!-- begin snippet: js hide: false console: true babel: false --><!-- language: lang-html -->
cbbackup -m full http://{IP}:61006 /backup-1 -u admin -p password -vvv
<!-- end snippet -->

error: SASL auth socket error: 192.168.72.10:11210, timed out

cbbackup log added below,

<!-- begin snippet: js hide: false console: true babel: false --><!-- language: lang-html -->
mt cbbackup...
mt  source : http://{IP}:61006
mt  sink   : /backup-1
mt source_class: <class 'pump_dcp.DCPStreamSource'>
mt Starting new HTTP connection (1): {IP}
mt "GET /pools/default/buckets HTTP/1.1" 200 19966
mt sink_class: <class 'pump_bfd.BFDSink'>
mt source_buckets: bucket-1
mt bucket: bucket-1
mt  source_nodes: 192.168.72.10:8091
mt  enqueueing node: 192.168.72.10:8091
mt rest_request: <ud>admin</ud>@{IP}:61006/pools/default/buckets/bucket-1/stats/curr_items; reason: total_msgs
w0  node: 192.168.72.10:8091
w0 sink_bucket: bucket-1
w0   DCPStreamSource connecting mc: 192.168.72.10:11210
s0   create_db: /backup-1/2020-07-28T083342Z/2020-07-28T083342Z-full/bucket-bucket-1/node-192.168.72.10%3A8091/data-0000.cbb
s0   connect_db: /backup-1/2020-07-28T083342Z/2020-07-28T083342Z-full/bucket-bucket-1/node-192.168.72.10%3A8091/data-0000.cbb
mt rest_request: <ud>admin</ud>@{IP}:61006/pools/default/buckets/bucket-1/stats/vb_active_resident_items_ratio; reason: total_msgs
w0   pump (http://{IP}:61006(bucket-1@192.168.72.10:8091)->/backup-1(bucket-1@192.168.72.10:8091)) done.
w0   source : http://{IP}:61006(bucket-1@192.168.72.10:8091)
w0   sink   : /backup-1(bucket-1@192.168.72.10:8091)
w0          :                total |       last |    per sec
w0  node: 192.168.72.10:8091, done; rv: (u'error: SASL auth socket error: 192.168.72.10:11210, timed out', None)
(u'error: SASL auth socket error: 192.168.72.10:11210, timed out', None)
<!-- end snippet -->

Raised issue in Couchbase forum as well. Refer here.

Any idea about this? I am stuck with this issue.

Update I can't use the exposed memcached port for cbbackup as no option added in the official document.. This answer posted in the Couchbase forum gives some details. If that is true then, its not possible to run a successful cbbackup from a remote system. But I don't think the Couchbase team has designed in that way. Hope there is way to achieve the same.

  • Backing up and Restoring a Couchbase is tested and working using Kubernetes Jobs. But looking for a remote Couchbase backup.
-- SkPuthumana
couchbase
kubernetes

2 Answers

7/28/2020

The problem here looks like 🤔 is that you have SASL authentication configured on your couchbase server/bucket. Also, looks like 🤔 the pod IP is 192.168.72.10 so the client is trying to authenticate from the same pod network but you are issuing the request from a different machine that is not in your Kubernetes cluster (I assume).

You can try running the backup from a pod:

$ kubectl run -i --tty --rm debug --image=couchbase --restart=Never -- /opt/couchbase/bin/cbbackup -m full http://{IP}:61006 /backup-1 -u admin -p password -vvv

Unfortunately, kubectl run doesn't have a lot of functionality so you'll probably have to create your own Kubernetes YAML manifest if you'd like to to mount a volume.

apiVersion: v1
kind: Pod
metadata:
  name: couchbase-backup
spec:
  containers:
  - name: couchbase-backup
    image: couchbase
    command: ["/opt/couchbase/bin/cbbackup"]
    args: ["-m", "full", "http://{IP}:61006", "/backup-1", "-u", "admin", "-p", "password", "-vvv"]
    volumeMounts:
    - name: storage
      mountPath: /backup-1
  volumes:
  - name: storage
    ...

✌️☮️

-- Rico
Source: StackOverflow

7/28/2020

Unfortunately, backup from an external network is not possible with Couchbase 6.0.

https://docs.couchbase.com/server/6.0/cli/cbbackup-tool.html#description

The cbbackup, cbrestore, and cbtransfer tools do not communicate with external IP addresses for server nodes outside of a cluster. Backup, restore, or transfer operations are performed on data from a node within a Couchbase Server cluster. They only communicate with nodes from a node list obtained within a cluster. This also means that if Couchbase Server is installed with a default IP address, an external hostname cannot be used to access it.

This caveat is not present in the documentation for 6.5... I think that's because 6.5 introduced alternate addresses for connecting from outside the network.

-- dnault
Source: StackOverflow