You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've pasted the output of argocd version. (caveat below)
Describe the bug
The SyncWindow code has no error checking and fails with a nilpointer deref when the user provides an invalid schedule such as * * * * 2-7. The invalid code is repeated multiple times in application/v1alpha1/types.go:
schedule, _ := specParser.Parse(w.Schedule) // returns nil on error
[...]
nextWindow := schedule.Next(currentTime.Add(timeZoneOffsetDuration - duration)) // crashes if schedule is nil
In one instance they tried to handle the error but don't check sErr until after the nil deref:
schedule, sErr := specParser.Parse(w.Schedule) // returns nil on error
[...]
nextWindow := schedule.Next(currentTime.Add(timeZoneOffsetDuration - duration)) // crashes if schedule is nil
if !nextWindow.Before(currentTime.Add(timeZoneOffsetDuration)) && sErr == nil && dErr == nil { // never reached if sErr != nil
inactive = append(inactive, w)
}
You can work around this by copy-pasting all your schedules into the Go Playground to check the format: https://go.dev/play/p/Vfg1RJtIGdA
Checklist:
argocd version
. (caveat below)Describe the bug
The SyncWindow code has no error checking and fails with a nilpointer deref when the user provides an invalid schedule such as
* * * * 2-7
. The invalid code is repeated multiple times in application/v1alpha1/types.go:In one instance they tried to handle the error but don't check sErr until after the nil deref:
You can work around this by copy-pasting all your schedules into the Go Playground to check the format: https://go.dev/play/p/Vfg1RJtIGdA
To Reproduce
Create an AppProject with an invalid schedule:
Then try to Sync in the UI.
Expected behavior
User sees an error message explaining why their schedule is invalid, eg
end of range (7) above maximum (6): 2-7
.Version
I gave up at this point. I'm using ArgoCD v2.11.5.
Logs
See also previous report: #16701
The text was updated successfully, but these errors were encountered: