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: missing mandatory check field: 2.storage #42

Open
bifkit opened this issue Apr 23, 2019 · 3 comments
Open

Error: missing mandatory check field: 2.storage #42

bifkit opened this issue Apr 23, 2019 · 3 comments

Comments

@bifkit
Copy link

bifkit commented Apr 23, 2019

Attempting to run duplicacy-util on Windows Server 2012. I consistently get the following:

PS C:\users\daniel> duplicacy-util -f serverfolders 19:21:47 Using global config: C:\Users\daniel\.duplicacy-util\duplicacy-util.yaml Error: missing mandatory check field: 2.storage

I have also run the command explicitly providing the -sd flag, with the same result. The -v and -d flags provide no further information.

The local config file is in the same directory as the global one, and is named serverfolders.yaml. It contains:

repository: D:/ServerFolders

storage:
    - name: usbdrive
      vss: true
      vss-timeout: 360

copy:
    - from: usbdrive
      to: dreamobjects
      threads: 20

prune:
    - storage: usbdrive
      keep: "0:365 30:180 7:30 1:7"
    - storage: dreamobjects
      keep: "0:365 30:180 7:30 1:7"

check:
    - storage: usbdrive
      all: true
    - storage: dreamobjects
    - all: true

I have tried many variations: repository name (serverfolders), repository location (D:\ServerFolders), storage name (usbdrive), storage location (h:\duplicacy_backup), etc.

The repository has been initialized to use a directory on an external hard drive as storage, and to copy to cloud storage. I have successfully run the backup and copy operations directly with duplicacy several times, but I can't get duplicacy-util started.

Have I misunderstood something about the configuration options?

@jeffaco
Copy link
Owner

jeffaco commented Apr 24, 2019

That took me a perusal of the source code, and then I understood what is happening:

For the check information, you have:

check:
    - storage: usbdrive
      all: true
    - storage: dreamobjects
    - all: true

The - characters are critical here, as it delineates a new repository to check. (It's kind of weird that you're checking storages that you're not backing up, but I'm sure you have a reason for that.)

In any case, the above segment says you have three storages to check (numbered from 0 due to how Go numbers these).

Check 0: Name=usbdrive, all=true
Check 1: Name=dreamobjects, no all flag (it will be defaulted)
Check 2: No name, all=true

You can't check something without a storage name, so duplicacy-util complained.

Make the check segment look like this instead:

check:
    - storage: usbdrive
      all: true
    - storage: dreamobjects
      all: true

That should fix you up.

@jeffaco jeffaco closed this as completed Apr 24, 2019
@bifkit
Copy link
Author

bifkit commented Apr 24, 2019

Thanks for spotting that. I would have looked at it for days before I caught it.

@jeffaco
Copy link
Owner

jeffaco commented Apr 24, 2019

The error message is historical. We used to have numbered sections in prior versions. When you had numbered sections, 2.storage made more sense (check session 2, field storage).

I'm going to to reopen this issue (as a reminder) and run through the code making sure error messages make sense given the current YAML format.

This would have been better to say something like Error: 'storage' definition missing in check entry 2 (or something like that). That might have made more sense to you, and would have given you more of a hint as to what the problem was.

@jeffaco jeffaco reopened this Apr 24, 2019
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