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

Bug? - Manual Snapshot Only Setting Not Overriding Global Policy #3344

Open
apb2019 opened this issue Sep 22, 2023 · 7 comments
Open

Bug? - Manual Snapshot Only Setting Not Overriding Global Policy #3344

apb2019 opened this issue Sep 22, 2023 · 7 comments

Comments

@apb2019
Copy link

apb2019 commented Sep 22, 2023

My global policy for a repository has "Manual Snapshots Only" set to "yes". However for a particular folder I want to run regular 10min snapshots so during the snapshot setup using the UI I set the "Snapshot Frequency" to "every 10 Minutes" and set "Manual Snapshots Only" to "no" instead of "inherit from parent" then save the policy, but when I reopen the policy, the "Manual snapshots Only" setting has been reset back to "inherit from parent" and the blue tick mark next to defined by Global policy is still set.
Is the a bug?

@apb2019
Copy link
Author

apb2019 commented Sep 23, 2023

Should have mentioned that when I set the local policy "Snapshot Frequency" to "every 10 Minutes" there was no error message ("invalid scheduling policy: manual cannot be combined with other scheduling policies") that I would have expected due to the scheduling being a conflict with the Manual Snapshots Only=yes in the global policy.
When the local policy is reopened the "Snapshot Frequency" setting is still showing "every 10 Minutes" though no "upcoming snapshots" are listed.

@PhracturedBlue
Copy link
Contributor

How did you set 'manual policy only' for the global policy?
When I tried to reproduce your case, I get:

kopia policy set --global --manual
Setting policy for (global)
 - setting manual snapshot field to true

ERROR can't save policy for (global): failed to validate policy: invalid scheduling policy: invalid scheduling policy: manual cannot be combined with other scheduling policies

Also, what version of Kopia are you running?

@apb2019
Copy link
Author

apb2019 commented Sep 23, 2023

Policy was set via UI. I get a similar message if the snapshot frequency for the global policy is set to something other than the default (none) and then try to set manual snapshots to yes. Originally saw this in v13 but just recreated the problem in V14.1 as follows
Using UI (14.1)
Create new local repository without changing any of the defaults.
edit/save global policy to change "Manual snapshots only" to yes - leaving all other options unchanged ie snapshot frequency = (none) etc
Create new snapshot - changing Snapshot frequency from (none) to "every 10 mins" and Manual snapshots only from "inherit from parent" to "no"
take snapshot
If I the open policy for snapshot just taken. I see Snapshot frequency still says "every 10 Min" but Manual snapshot only has reverted back to "no" and no upcoming snapshots are listed
Hope this helps

@PhracturedBlue
Copy link
Contributor

I was able to reproduce this on v0.14.1. But apparently I introduced an issue in the changes to --run-missed that makes it impossible to set 'run manually' to true on --global.

So there are 2 issues here:

  • The current nightlies won't let you set --manual --global
  • After that is addresses, if --manual is set on --global it can't be disabled.

I think the 2nd issue is due to --manual being a bool instead of a tri-state. this is basically the same type of problem I was trying to fix in the --run-missed changes.

I will work on both of these issues. Thanks.

@PhracturedBlue
Copy link
Contributor

I have submitted pull-requests for both issues which will make it possible to override --manual from true->false

@lupusA
Copy link
Contributor

lupusA commented Sep 25, 2023

Hi @PhracturedBlue,

can you link your PRs with this issue, if the PRs solve it? This way, we keep track of resolved and unresolved issues.

Cheers,

@PhracturedBlue
Copy link
Contributor

PhracturedBlue commented Sep 25, 2023

@lupusA I'm not sure what you are looking for. When I look at this bug for instance I see:
image

Both PRs mention this issue.

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

3 participants