clickhouse-backup icon indicating copy to clipboard operation
clickhouse-backup copied to clipboard

Backup job failure with error another operation is currently running

Open NeuZhou opened this issue 1 year ago • 19 comments

Debug: create increment-2025-06-19-00-00-16 on chi-adgroup2-advbi-0-2 INSERT INTO system.backup_actions(command) VALUES('create chi-adgroup2-advbi-0-2-increment-2025-06-19-00-00-16') Received exception from server (version 24.5.1): Code: 86. DB::Exception: Received from chi-adgroup2-advbi-0-2:9000. DB::HTTPException. DB::HTTPException: Received error from remote server /backup/actions. HTTP status code: 500 Internal Server Error, body: {"status":"error","operation":"create chi-adgroup2-advbi-0-2-increment-2025-06-19-00-00-16","error":"another operation is currently running"} . (RECEIVED_ERROR_FROM_REMOTE_IO_SERVER) (query: INSERT INTO system.backup_actions(command) VALUES('create chi-adgroup2-advbi-0-2-increment-2025-06-19-00-00-16'))

Image

NeuZhou avatar Jun 19 '25 10:06 NeuZhou

looks like your backup job is wrong

increment-0-2-2025-06-10-00-00-01 was executed before 0-2-increment-2025-06-19-00-00-16

Slach avatar Jun 19 '25 11:06 Slach

looks like your backup job is wrong

increment-0-2-2025-06-10-00-00-01 was executed before 0-2-increment-2025-06-19-00-00-16

@Slach I backup clickhouse with this approach, but the job is stuck with this message, do you know how to fix it? https://github.com/Altinity/clickhouse-backup/blob/master/Examples.md#how-to-use-clickhouse-backup-in-kubernetes

NeuZhou avatar Jun 20 '25 02:06 NeuZhou

@kazhou2024

did you modify https://github.com/Altinity/clickhouse-backup/blob/master/Examples.md#how-to-use-clickhouse-backup-in-kubernetes?

This is a worked approach

Did you read https://github.com/Altinity/clickhouse-backup/blob/master/Examples.md#how-to-back-up--restore-a-sharded-cluster ?

Slach avatar Jun 20 '25 03:06 Slach

could you share

kubectl get cronjob --all-namespces
kubectl get chi --all-namespaces

Slach avatar Jun 20 '25 03:06 Slach

Thanks @Slach I modified it to use Azure Block, and it is working for month, but for a bigger cluster is stucked since 5/30

Here is the clickhouse-backup pod Yaml

- name: clickhouse-backup
              image: xxx/clickhouse-backup:latest
              imagePullPolicy: Always
              args: ["server"]
              env:
                 - name: LOG_LEVEL
                   value: "info"
                 - name: ALLOW_EMPTY_BACKUPS
                   value: "true"
                 - name: API_LISTEN
                   value: "0.0.0.0:7171"
                 - name: BACKUPS_TO_KEEP_LOCAL
                   value: "-1"
                 - name: BACKUPS_TO_KEEP_REMOTE
                   value: "35"
                 # INSERT INTO system.backup_actions to execute backup
                 - name: API_CREATE_INTEGRATION_TABLES
                   value: "true"
                 - name: REMOTE_STORAGE
                   value: "azblob"
                 - name: AZBLOB_ACCOUNT_NAME
                   value: "xxx"
                 - name: AZBLOB_CONTAINER
                   value: "backup"
                 - name: AZBLOB_PATH
                   value: clickhouse/backup/{replica}
                 - name: AZBLOB_ACCOUNT_KEY
                   valueFrom:
                      secretKeyRef:
                        name: clickhouse-secret
                        key: account_key
              ports:
                 - name: backup-rest
                   containerPort: 7171

Image

Image

Image

kubectl get pod --all-namespaces | grep backup

Image

Received exception from server (version 24.5.1):

Image

Code: 86. DB::Exception: Received from chi-adgroup1-advbi-3-2:9000. DB::HTTPException. DB::HTTPException: Received error from remote server /backup/actions. HTTP status code: 500 Internal Server Error, body: {"status":"error","operation":"create chi-adgroup1-advbi-3-2-full-2025-06-23-00-00-01","error":"another operation is currently running"}
. (RECEIVED_ERROR_FROM_REMOTE_IO_SERVER)
(query: INSERT INTO system.backup_actions(command) VALUES('create chi-adgroup1-advbi-3-2-full-2025-06-23-00-00-01'))

NeuZhou avatar Jun 23 '25 02:06 NeuZhou

could you stop share text information as pictures, this is mental degradation share SELECT * FROM system.backup_actions from chi-adgroup1-advbi-3-2

Slach avatar Jun 23 '25 03:06 Slach

image: campaignplatform.azurecr.io/dspbi/clickhouse-backup:latest

could you share clickhouse-backup version ?

Slach avatar Jun 23 '25 03:06 Slach

@Slach

Image

Image

NeuZhou avatar Jun 23 '25 05:06 NeuZhou

@kazhou2024 1.0.0 is 4 years outdated, upgrade to 2.6.22

Slach avatar Jun 23 '25 05:06 Slach

@Slach sorry 1.0.0 is manually download binary, but the image of the container is 2.6.5 verion

@Slach any suggestion? do we need to upgarade the version or is there any way to stop the "in progress" job? and resume the backup pipeline?

Image

NeuZhou avatar Jun 23 '25 06:06 NeuZhou

try upgrade to latest version first

share logs from stuck pod

kubectl logs -n clickhouse chi-adgroup1-advbi-3-2-0 --container=clickhouse-backup --since=24h

Slach avatar Jun 23 '25 06:06 Slach

Thanks @Slach, here is the log

chi-adgroup1-advbi-3-2-0.log

NeuZhou avatar Jun 23 '25 06:06 NeuZhou

try --since=48h

Slach avatar Jun 23 '25 07:06 Slach

@Slach here is --since=100h chi-adgroup1-advbi-3-2-0_100h.log

NeuZhou avatar Jun 23 '25 09:06 NeuZhou

share logs for 2025-05-30 if you have

upgrade backup to latest version use kubectl exec -n clickhouse chi-adgroup1-advbi-3-2-0 --container=clickhouse-backup --container=clickhiouse-backup -- kill 1 to restart stuck backup upload

Slach avatar Jun 23 '25 09:06 Slach

Thanks @Slach I suspect it stucked due to not enough space, I have increased the side of PV, but how to cancel the upload?

Before run above command

Image

after run it Image

NeuZhou avatar Jun 24 '25 06:06 NeuZhou

@Slach here is the new log

Image

NeuZhou avatar Jun 24 '25 06:06 NeuZhou

thanks @Slach it success now

Image

NeuZhou avatar Jun 24 '25 06:06 NeuZhou

next backup should be sucess

Slach avatar Jun 24 '25 07:06 Slach