Skip to content

failed to read all source data during backup

Emruz Hossain edited this page Jul 9, 2021 · 1 revision

Problem:

Sometime backup fails with the following error.

2021-07-09T04:10:13.550033354ZWarning: failed to read all source data during backup

Reason:

By default Stash runs backup as non-root user. If the target data directory is readable only for a particular user, then Stash fail to read the target data resulting this error.

Solution:

Run the backup process as same user as the data owner or run the backup process as root user.

We can run the backup process as root user as below:

apiVersion: stash.appscode.com/v1beta1
kind: BackupConfiguration
metadata:
  name: ss-backup
  namespace: demo
spec:
  repository:
    name: s3-repo
  schedule: "*/3 * * * *"
  target:
    ref:
      apiVersion: apps/v1
      kind: StatefulSet
      name: stash-demo
    volumeMounts:
    - name: data-volume
      mountPath: /my/data
    paths:
    - /my/data
  runtimeSettings:
    container:
      securityContext:
        runAsUser: 0
        runAsGroup: 0
  retentionPolicy:
    name: 'keep-last-5'
    keepLast: 5
    prune: true