Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup not working using azblob with use_embedded_backup_restore flag as true #1031

Closed
hermeswaldemarin opened this issue Oct 22, 2024 · 5 comments
Assignees
Milestone

Comments

@hermeswaldemarin
Copy link

hermeswaldemarin commented Oct 22, 2024

The backup for azure is not working like expected when using the use_embedded_backup_restore: true.

This is the env variable I'm using.

AZBLOB_ACCOUNT_NAME=myaccount
AZBLOB_ENDPOINT_SUFFIX=core.windows.net
AZBLOB_ACCOUNT_KEY=my_access_key
AZBLOB_CONTAINER=my-backup-bucket

In this method, used by clickhouse-backup to access the container, the BlobEndpoint is constructed correctly
azblob.go#L94

But when it sends the backup command to clickhouse the BlobEndpoint constructed is different and we receive an error by clickhouse in the command.
backuper.go#L352

This is how the command is created to send to clickhouse.

BACKUP TABLE myschema.json_layouts TO AzureBlobStorage('DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=my_access_key;BlobEndpoint=https://core.windows.net/myaccount;','my-backup-bucket','/chi-clickhouse-clickhouse-0-1-full-2024-10-22-15-48-46/') SETTINGS allow_azure_native_copy=1

image

the Blob endpoint is wrong, should be BlobEndpoint=https://myaccount.blob.core.windows.net; instead.

BACKUP TABLE myschema.json_layouts TO AzureBlobStorage('DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=my_access_key;BlobEndpoint=https://myaccount.blob.core.windows.net;', 'my-backup-bucket', '/chi-clickhouse-clickhouse-0-1-full-2024-10-22-15-48-46/') SETTINGS allow_azure_native_copy = 1

I also tried omitting the BlobEndpoint in the config and it also works. This command bellow also works...

BACKUP TABLE myschema.json_layouts TO AzureBlobStorage('DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=my_access_key', 'my-backup-bucket', '/chi-clickhouse-clickhouse-0-1-full-2024-10-22-15-48-46/') SETTINGS allow_azure_native_copy = 1

@hermeswaldemarin hermeswaldemarin changed the title Backup Error using azblob with embedded flag as true Backup not working using azblob with use_embedded_backup_restore flag as true Oct 22, 2024
@hermeswaldemarin
Copy link
Author

hermeswaldemarin commented Oct 22, 2024

Clickhouse Version: 24.8.4.13
clickhouse-backup Version: 2.6.0

@Slach Slach added this to the 2.6.3 milestone Oct 22, 2024
@Slach Slach self-assigned this Oct 22, 2024
@Slach Slach closed this as completed in e568996 Oct 22, 2024
@hermeswaldemarin
Copy link
Author

hermeswaldemarin commented Oct 23, 2024

Hi @Slach , I was locking at the changes.

This should be

azblobBackupURL.Host = b.cfg.AzureBlob.AccountName + ".blob." + b.cfg.AzureBlob.EndpointSuffix

instead correct?

I tried to run with BlobEndpoint=https://myaccount.core.windows.net and didn't work..
need to be https://myaccount.blob.core.windows.net

@Slach
Copy link
Collaborator

Slach commented Oct 23, 2024

@hermeswaldemarin thanks for reporting, now should works

@hermeswaldemarin
Copy link
Author

It's working now @Slach . I did the tests with the "altinity/clickhouse-backup:master" image.

Just to organize myself here, when will the release 2.6.3 be released?

@Slach
Copy link
Collaborator

Slach commented Oct 23, 2024

i can't provide any ETA look to https://github.com/Altinity/clickhouse-backup/milestone/74
and watch the progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants