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

error: repo-hot is not a hot repository! Aborting. #978

Closed
mueckinger opened this issue Dec 31, 2023 · 6 comments · Fixed by rustic-rs/rustic_core#112
Closed

error: repo-hot is not a hot repository! Aborting. #978

mueckinger opened this issue Dec 31, 2023 · 6 comments · Fixed by rustic-rs/rustic_core#112
Labels
A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` C-bug Category: Something isn't working as expected

Comments

@mueckinger
Copy link
Contributor

Hi,

I tried using the hot/cold pattern with scaleway. For scaleway you cannot predefine the storage class for a bucket, so you have to set it in your rclone config as follows:

[scaleway-cold]
type = s3
provider = Scaleway
env_auth = false
endpoint = s3.fr-par.scw.cloud
access_key_id = ***
secret_access_key = ***
region = fr-par
location_constraint =
acl = private
server_side_encryption =
storage_class = GLACIER

[scaleway-hot]
type = s3
provider = Scaleway
env_auth = false
endpoint = s3.fr-par.scw.cloud
access_key_id = ***
secret_access_key = ***
region = fr-par
location_constraint =
acl = private
server_side_encryption =
storage_class = ONEZONE_IA

When running init with rustic v0.6.1 it throws error: repo-hot is not a hot repository! Aborting.

$ rustic -r rclone:scaleway-cold:ca86aad8-771c-43ec-9787-894b03b16c63 --repo-hot rclone:scaleway-hot:ee03f556-8a01-455d-abe5-efaba76ad77b init
using no config file, none of these exist: /home/michael/.config/rustic/rustic.toml, /etc/rustic/rustic.toml, ./rustic.toml
enter password for new key: [hidden]
[INFO] key 5eda87b5 successfully added.
[INFO] repository f2d8c604 successfully created.
error: repo-hot is not a hot repository! Aborting.

Despite the error message both repositories appear to have been initialized correctly and can be used with rustic backup.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Dec 31, 2023
@aawsome
Copy link
Member

aawsome commented Dec 31, 2023

Could it be that at rclone:scaleway-hot:ee03f556-8a01-455d-abe5-efaba76ad77b there is already a repository? init will initialize both the hot and the cold part.

@mueckinger
Copy link
Contributor Author

No, only the buckets were created in advance.
I've just tried it again, with even non-existing buckets, but the output is the same:

$ rustic -r rclone:scaleway-cold:6b80f7ec-6dbb-4648-943a-729885a1367d --repo-hot rclone:scaleway-hot:7c512630-d05a-4dd7-9a0d-6fcc21b1a4e2 init
using no config file, none of these exist: /home/michael/.config/rustic/rustic.toml, /etc/rustic/rustic.toml, ./rustic.toml
enter password for new key: [hidden]
[INFO] key fb8a95ac successfully added.
[INFO] repository 9cd1ec55 successfully created.
error: repo-hot is not a hot repository! Aborting.

@aawsome
Copy link
Member

aawsome commented Dec 31, 2023

Seem like this is a wrong error message introduced by the refactoring into rustic_core. Can you check if the command backup --init is also affected?

@simonsan
Copy link
Contributor

simonsan commented Jan 1, 2024

Seem like this is a wrong error message introduced by the refactoring into rustic_core. Can you check if the command backup --init is also affected?

    fn open_raw(mut self, key: Key, config: ConfigFile) -> RusticResult<Repository<P, OpenStatus>> {
        match (config.is_hot == Some(true), self.be_hot.is_some()) {
            (true, false) => return Err(RepositoryErrorKind::HotRepositoryFlagMissing.into()),
            (false, true) => return Err(RepositoryErrorKind::IsNotHotRepository.into()),
            _ => {}
        }

src.: https://github.com/rustic-rs/rustic_core/blob/c4f44131a3533682c12e5b044aa12163fc108320/crates/core/src/repository.rs#L593

Hmm, it may be that the bug happens before in the assignment logic? Something related to merge maybe?

@mueckinger
Copy link
Contributor Author

mueckinger commented Jan 1, 2024

Seem like this is a wrong error message introduced by the refactoring into rustic_core. Can you check if the command backup --init is also affected?

Happy new year! Appreciate your engagement. I can confirm that backup --init is also affected.

@simonsan simonsan added C-bug Category: Something isn't working as expected A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Jan 1, 2024
@aawsome
Copy link
Member

aawsome commented Jan 1, 2024

@simonsan For the design of the rustic_core API and to introduce the backup --init option, I decided to return an Repository<impl Open> from the init...() commands which means they call open_raw.
I think I missed some case for hot/cold reposiories there. I'll look into it and make a fix.

This repository-opening after initialization is actually not needed for for the plain rustic init command. So, here the repository is completely initialized before the error is wrongly returned. rustic backup --init is however currently broken for hot/cold repositories. I think the same applies to rustic copy --init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` C-bug Category: Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants