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

bc: backup feature is not working as expected #513

Closed
Stezido opened this issue Jul 6, 2020 · 3 comments · Fixed by #712
Closed

bc: backup feature is not working as expected #513

Stezido opened this issue Jul 6, 2020 · 3 comments · Fixed by #712
Labels
bug Something isn't working

Comments

@Stezido
Copy link
Contributor

Stezido commented Jul 6, 2020

Description

Sometimes the exported backup cannot be restored due to an invalid hash. The hash of the multichain directory is created by the blockchain project when the backup endpoint is called. The hash is stored in the metadata.yml file inside the tar'ed backup file. When trying to restore the backup the hash of the backup multichain directory is calculated again and is compared to the directory hash saved in the metadata.yml file. This hash seems to be incorrect sometimes?

The bc endpoints GET/POST /chain should be checked again.

@Stezido Stezido added the bug Something isn't working label Jul 6, 2020
@Stezido Stezido added this to the Trubudget 1.13.0 milestone Jul 9, 2020
@georgimld
Copy link
Collaborator

This problem happens when the hash stored in the metadata.yml file during backup is not the same as the hash that is being calculated during restore, so it is recognised as an invalid trubudget backup. The problem could either be in the creation of the metadata file, when the hash is generated, or when the new hash is created, in the restore feature. I believe that the hash in the metadata.yml file is the one that is invalid, because some backup files can never be restored and always lead to this problem. I didn't find a connection between a certain blockchain instance and this issue, seeing as the feature sometimes works (most of the time) and sometimes doesn't, on the same blockchain, without it being restarted and/or altered in some way.

@Stezido
Copy link
Contributor Author

Stezido commented Oct 23, 2020

Implemented a workaround in #548
The issue is postponed to Milestone 2.0.0 since the way we hash/zip the Chain is inconsistent.
If we change the hash/zip function, backups made with earlier Trubudget versions wouldn't be useable anymore so the change is a breaking one.

@galethil
Copy link
Collaborator

galethil commented Dec 16, 2020

Issue with hashing was resolved by replacing MD5 hashing with SHA256 hashing and skipping of metadata.yml file from hash. Implementation done in issue #693
Old backups are still valid, since restore backup endpoint is accepting both MD5 and SHA256 types of hashing. New backups are created only with SHA256 hashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants