Failed to download the configuration file from the storage

gui

#17

Try this command:

duplicacy -d list -reset-passwords

The -reset-passwords option will instruct Duplicacy to ignore passwords stored in keyring/keychain and instead to prompt for new ones.

This error is definitely caused by a wrong storage password. If it is macOS, you can check what password is stored in KeyChain on machines where the backups are working. It is much harder on Windows, but it is possible.


#18

Same here. This is an archive. I stopped using TheBat! eight, maybe ten years ago…


#19

First machine added few repositories to the storage, this was not one of them. TheBatMailExport folder exists only on the second machine - “AAPLUS”. There’s no such snapshot in OneDrive because init fails. Exactly the same is happening on first machine - trying to add new repository to existing storage - getting “failed to download configuration”. Am I making this clear now?


#20

There’s no space, I checked. It sneaked in somehow when I was pasting log here.


#21

-d list -reset-passwords says
Repository has not been initialized

Both machines are Windows. I’d like to try to recover password if possible. Can you provide instructions, please?


#22

Could it be that the config file got corrupted?

If you login to OneDrive’s web interface and right-click on the config file in the storage folder you might be able to see the OneDrive’s maintained versions of the file and restore it to a previous version.


#23

So, I have init the same repo from the windows machine and it all worked just fine.

then I went to OneDrive and damaged the config file. Just modified a bunch of numbers there (it’s a text file).
And then tried to access the storage again:

mymbp:test02 me$ duplicacy backup
Storage set to one://test-bucket
Failed to download the configuration file from the storage: Failed to retrieve the config file: cipher: message authentication failed

So, this message is not only result of a wrong password, but also config file corruption. Which makes sense totally – in both cases decryption will fail and there is no way to distinguish bad password from bad data.

How could the file get corrupted? Easy. OneDrive is very flaky. When I said it did not work from work earlier ? Well, I eventually SSHed home and it did not work from there either. It started working after several attempts with intermittent dropped connections. In the evening it started working reliably every time.

Perhaps indeed in one of the backup runs the config file upload got interrupted. What is the size of your config file? (mine is always around 830 bytes)

@gchen – are there any safeguards in place when uploading the config file to ensure atomicity? ie. rename the existing one and if upload of a new config file fails/gets interrupted/ to restore the previous one?
Also, would it be possible to sign the config file in addition to encrypting it to validate its integrity before attempting to decrypt it? Config file is the only file that get re-written and is the Achilles heel here.


#24

You probably know this but just in case: you need to execute duplicacy in the root folder of the repository.

Could you try initializing some other storage than onedrive, just to see if this has anything to do with onedrive.


#25

Open brackets

This is an interesting idea… :+1:

Now I’m worried about my config files … :smile:

Close brackets, back to topic.


#26

My config has single version and has not been modified


#27

Killed .duplicacy folder under E:\TheBatMailExport and initialized new repository for Google Drive storage. (Created folder z-duplicacy-backups first on Drive). Success. Backup is up and running.

HOWEVER, GUI never asked me about password for the new storage! How come? Not supported on Google Drive?

10:50:26.000    Command: duplicacy -background -log -d info -repository "E:\TheBatMailExport" -storage-name gui1 "gcd://z-duplicacy-backups"
10:50:28.617    Reading the environment variable DUPLICACY_GUI1_GCD_TOKEN
10:50:28.657    Reading gcd_token from keychain/keyring
10:51:51.000    Command: duplicacy -background -log -d init -storage-name gui1 "AAPLUS-Administrator-TheBatMailExport" "gcd://z-duplicacy-backups"
10:51:51.243    Reading the environment variable DUPLICACY_GUI1_GCD_TOKEN
10:51:51.248    Reading gcd_token from keychain/keyring
10:51:55.379    Compression level: 100
10:51:55.380    Average chunk size: 4194304
10:51:55.380    Maximum chunk size: 16777216
10:51:55.380    Minimum chunk size: 1048576
10:51:55.380    Chunk seed: 6475706c6963616379
10:51:55.381    E:\TheBatMailExport will be backed up to gcd://z-duplicacy-backups with id AAPLUS-Administrator-TheBatMailExport
10:52:07.000    Command: duplicacy -background -log -d info -repository "E:\TheBatMailExport" -storage-name gui1 "gcd://z-duplicacy-backups"
10:52:07.844    Reading the environment variable DUPLICACY_GUI1_GCD_TOKEN
10:52:07.850    Reading gcd_token from keychain/keyring
10:52:09.699    Chunk read levels: [1], write level: 1
10:52:09.699    Compression level: 100
10:52:09.699    Average chunk size: 4194304
10:52:09.699    Maximum chunk size: 16777216
10:52:09.699    Minimum chunk size: 1048576
10:52:09.699    Chunk seed: 6475706c6963616379

#28

That is because either your Google Drive storage was initialized without encryption or you selected to initialize it without encryption.


#29

You need to insert the line to print out the password here:

For example:

		password := keyringGet(passwordID)
		if password != "" {
			LOG_DEBUG("PASSWORD_KEYCHAIN", "Reading %s from keychain/keyring", passwordType)
                        LOG_INFO("PASSWORD", "Password: %s", password)  // insert this line
			return password
		}

And then compile it to get the executable.


#30

I’m using GUI and I didn’t see any encryption options during Google Drive storage init. :frowning:


#31

I can clone the repository, but I have zero experience with Go. Is there a batch file/script for building Windows version or just installing plain vanilla Go dev environment and typing “go build” should do the job? Thanks in advance.


#32

The explanations are here: Build Duplicacy from source.

As a hint/bonus take a look in Duplicacy User Guide. There may be other helpful tips.


#33

On a Windows, yes, go build duplicacy/duplicacy_main.go should do it.

It is also fairly easy to cross-build on a macOS/linux machine:

env GOOS=windows GOARCH=amd64 go build duplicacy/duplicacy_main.go

#34

It took me some time to realize that the build works with go\src\github.com\gilbertchen\duplicacy\src, not \src folder I downloaded as a part of zip


#35

Thanks, problem solved, password recovered. For some reason it was completely different from the one I put in password manager. Copy-Paste issue perhaps.


#36

For anyone: Feel free to use the :heart: button on the posts that you found useful.

For the OP of any support topic: you can mark the post that solved your issue by ticking the image box under the post. That of course may include your own post :slight_smile: