matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.78k stars 275 forks source link

[Bug]: Backup Command Fails with is_minio Parameter When Targeting Tencent Cloud COS #14492

Closed sukki37 closed 7 months ago

sukki37 commented 8 months ago

Is there an existing issue for the same bug?

Branch Name

1.1-dev

Commit ID

9426e1c

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

{"level":"ERROR","time":"2024/02/01 00:50:44.660353 +0800","name":"log-service.frontend","caller":"frontend/util.go:511","msg":"query trace status","uuid":"7c4dccb4-4d3c-41f8-b482-5251dc7a41bf","connection_id":8107,"statement":"backup '2024-02-01 00:27:51' s3option{\"endpoint\"='cos.ap-guangzhou.myqcloud.com',\"region\"='ap-guangzhou',\"access_key_id\"='**',\"secret_access_key\"='**',\"bucket\"='mo-backup-test-1308875761',\"filepath\"='backup/',\"compression\"='',\"role_arn\"='',\"is_minio\"='false'}","status":"fail","error":"internal error: bad s3 config: operation error S3: HeadBucket, https response error StatusCode: 403, RequestID: NjViYTdhNjRfNDQxMTdlMWVfMTZlNGRfNTRlNjZlYg==, HostID: , api error Forbidden: Forbidden","span":{"trace_id":"c39093dd-03e5-a732-2fba-cdbd673aa616","span_id":"da1d32cf2fd146fd"},"session_info":"connectionId 8107|127.0.0.1:54701|{account sys:dump:moadmin -- 0:1:0}|goRoutineId 1017|018d606e-058c-70c9-a0ae-f85c0ec6b4cd","session_id":"018d606e-058c-70c9-a0ae-f85c0ec6b4cd","statement_id":"018d606e-0596-7a96-8039-1df6a930a8b8"}

WeChatWorkScreenshot_1a7f87d6-dd49-4436-a6ec-e4668e944bff

Upon inspecting the logs, it became evident that the backup command execution with the is_minio parameter led the process into the logic branch where MINIO is True, which in turn caused the failure. Interestingly, when the is_minio parameter is removed from the command, the backup operation to Tencent Cloud COS executes successfully without any issues.

Expected Behavior

No response

Steps to Reproduce

start mo locally

execute: `backup '2024-02-01 00:27:51' s3option{\"endpoint\"='cos.ap-guangzhou.myqcloud.com',\"region\"='',\"access_key_id\"='******',\"secret_access_key\"='******',\"bucket\"='mo-backup-test-1308875761',\"filepath\"='backup/',\"compression\"='',\"role_arn\"='',\"is_minio\"='false'}`

Additional information

No response

YANGGMM commented 8 months ago

https://github.com/LeftHandCold/matrixone/pull/52 需要测试一下

aronchanisme commented 7 months ago

Fixed.

root@test0:/data/tools/mo-backup# S3_ID="***"
S3_KEY="***"
S3_EP="https://cos.ap-guangzhou.myqcloud.com"
S3_BUCKET="mo-backup-test-1308875761"
S3_PATH="bktest/"
S3_REGION="ap-guangzhou"
root@test0:/data/tools/mo-backup# ./mo_br backup --host "127.0.0.1" --port 6001 --user "dump" --password "111" --backup_dir "s3" --endpoint "${S3_EP}" --access_key_id "${S3_ID}" --secret_access_key "${S3_KEY}" --bucket "${S3_BUCKET}" --filepath "${S3_PATH}" --region "${S3_REGION}"
Backup ID
    a610854c-d14a-11ee-83d9-0800278dc04d
root@test0:/data/tools/mo-backup# ./mo_br list 
+--------------------------------------+--------+-----------------------------------------+---------------------------+------------------+---------------------------+
|                  ID                  |  SIZE  |                  PATH                   |          AT TIME          |     DURATION     |       COMPLETE TIME       |
+--------------------------------------+--------+-----------------------------------------+---------------------------+------------------+---------------------------+
| ad253e59-bc23-11ee-8a64-0800278dc04d | 5.6 GB |      BackupDir: filesystem  Path:       | 2024-01-26 16:18:35 +0800 | 1m15.569172489s  | 2024-01-27 00:19:50 +0800 |
|                                      |        |              /tmp/bk_test               |                           |                  |                           |
| f3b4eb06-bc5f-11ee-8670-0800278dc04d | 5.6 GB |      BackupDir: filesystem  Path:       | 2024-01-26 23:30:01 +0800 | 1m17.290991102s  | 2024-01-27 07:31:19 +0800 |
|                                      |        | /data/mo-backup/202401/20240126_233001/ |                           |                  |                           |
| c4f286d9-c116-11ee-bd54-0800278dc04d | 1.9 MB |      BackupDir: filesystem  Path:       | 2024-02-01 23:30:02 +0800 |   886.993701ms   | 2024-02-02 07:30:03 +0800 |
|                                      |        | /data/mo-backup/202402/20240201_233002/ |                           |                  |                           |
| ef948160-c1df-11ee-8dc2-0800278dc04d | 2.1 MB |      BackupDir: filesystem  Path:       | 2024-02-02 23:30:02 +0800 |   1.102857309s   | 2024-02-03 07:30:03 +0800 |
|                                      |        | /data/mo-backup/202402/20240202_233002/ |                           |                  |                           |
| 19d77604-c2a9-11ee-b863-0800278dc04d | 2.5 MB |      BackupDir: filesystem  Path:       | 2024-02-03 23:30:02 +0800 |   1.081489544s   | 2024-02-04 07:30:03 +0800 |
|                                      |        | /data/mo-backup/202402/20240203_233002/ |                           |                  |                           |
| 44105612-c372-11ee-943d-0800278dc04d | 2.7 MB |      BackupDir: filesystem  Path:       | 2024-02-04 23:30:01 +0800 |   1.247458493s   | 2024-02-05 07:30:03 +0800 |
|                                      |        | /data/mo-backup/202402/20240204_233001/ |                           |                  |                           |
| 6ee1b121-c43b-11ee-9d42-0800278dc04d | 2.8 MB |      BackupDir: filesystem  Path:       | 2024-02-05 23:30:02 +0800 |   1.401682045s   | 2024-02-06 07:30:03 +0800 |
|                                      |        | /data/mo-backup/202402/20240205_233002/ |                           |                  |                           |
| 82a0a867-c5cf-11ee-be85-0800278dc04d | 48 GB  |      BackupDir: filesystem  Path:       | 2024-02-07 23:30:02 +0800 | 12m31.079802725s | 2024-02-08 07:42:33 +0800 |
|                                      |        | /data/mo-backup/202402/20240207_233002/ |                           |                  |                           |
| b275d013-d0cd-11ee-926f-0800278dc04d | 894 kB |      BackupDir: filesystem  Path:       | 2024-02-21 23:27:16 +0800 |   803.147214ms   | 2024-02-21 23:27:17 +0800 |
|                                      |        |                /tmp/123/                |                           |                  |                           |
| a610854c-d14a-11ee-83d9-0800278dc04d | 32 MB  |        BackupDir: s3  Endpoint:         | 2024-02-22 14:20:31 +0800 | 1m14.606435567s  | 2024-02-22 14:21:44 +0800 |
|                                      |        |  https://cos.ap-guangzhou.myqcloud.com  |                           |                  |                           |
|                                      |        |     AccessKeyId:   SecretAccessKey:     |                           |                  |                           |
|                                      |        |    Bucket: mo-backup-test-1308875761    |                           |                  |                           |
|                                      |        |        Filepath: bktest/  Region:       |                           |                  |                           |
|                                      |        |  ap-guangzhou  Compression:   RoleArn:  |                           |                  |                           |
|                                      |        |              IsMinio: false             |                           |                  |                           |
+--------------------------------------+--------+-----------------------------------------+---------------------------+------------------+---------------------------+

root@test0:/data/tools/mo-backup# git log -n 1 
commit 4fa21f14081e89f11489cfed2cf75323bed7c69b (HEAD -> main, origin/main, origin/HEAD)
Author: YANGGMM <www.yangzhao123@gmail.com>
Date:   Wed Feb 7 15:38:48 2024 +0800

    Mo br list enhancement (#12)

    * mo_br list information enhancement

    * fix
image