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

Stuck applicationset progressive rollout #12202

Open
3 tasks done
billyshambrook opened this issue Jan 29, 2023 · 10 comments
Open
3 tasks done

Stuck applicationset progressive rollout #12202

billyshambrook opened this issue Jan 29, 2023 · 10 comments
Labels
appset/progressive-syncs Issues related to the ApplicationSet progressive syncs feature. bug Something isn't working

Comments

@billyshambrook
Copy link

billyshambrook commented Jan 29, 2023

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

A progressive rollout enabled ApplicationSet sometimes get's stuck between rollout steps.

Not sure if this is related, but I have noticed that the applicationset conditions seem to continuously flip between the following, seems like the controller does not append these but keeps overwriting itself:

...
  - lastTransitionTime: '2023-01-29T22:35:24Z'
    message: Successfully generated parameters for all Applications
    reason: ParametersGenerated
    status: 'True'
    type: ParametersGenerated
...
...
  - lastTransitionTime: '2023-01-29T22:34:44Z'
    message: ApplicationSet Rollout Rollout started
    reason: ErrorOccurred
    status: 'False'
    type: ParametersGenerated
...

After inspecting the code, it seems to be caused by the controller calling r.setApplicationSetStatusCondition here https://github.com/argoproj/argo-cd/blob/master/applicationset/controllers/applicationset_controller.go#L1154 with the paramtersGenerated argument set to false and then the controller within the same reconcile calls the function again here (maybe) https://github.com/argoproj/argo-cd/blob/master/applicationset/controllers/applicationset_controller.go#L277 with the parametersGenerated set to true which overwrites the progressive condition.

To Reproduce

Apply this applicationset.yaml. If the applicationset rollout works, try deleting the applicationset and re-applying it a few times.

Expected behavior

All applications rollout successfully.

Screenshots

Screenshot 2023-01-29 at 2 26 39 PM

Version

argocd: v2.6.0-rc5+e790028
  BuildDate: 2023-01-25T17:57:49Z
  GitCommit: e790028e5cf99d65d6896830fc4ca757c91ce0d5
  GitTreeState: clean
  GoVersion: go1.18.10
  Compiler: gc
  Platform: linux/amd64
@billyshambrook billyshambrook added the bug Something isn't working label Jan 29, 2023
@billyshambrook billyshambrook changed the title stuck applicationset progressive rollout Stuck applicationset progressive rollout Jan 29, 2023
@thober35
Copy link

thober35 commented Feb 3, 2023

We also observed a similar issue. After debugging the code we found a possible culprit here:
https://github.com/argoproj/argo-cd/blob/master/applicationset/controllers/applicationset_controller.go#L1023
App Status is stuck in "pending" even though the sync was successful. The operationPhaseString is "Succeeded" therefore an update to the status is never performed. Possible fix there would be to check for (operationPhaseString == "Succeeded" && !appOutdated).
Don't know if this relates to your issue as we did not check the ApplicationSetStatus.

@crenshaw-dev please add label appset/progressive-rollouts. Thanks.

@crenshaw-dev crenshaw-dev added the appset/progressive-syncs Issues related to the ApplicationSet progressive syncs feature. label Feb 3, 2023
@riuvshyn
Copy link

same happens on 2.7.1

@mike-serchenia
Copy link

Same on 2.8

@bhutkovskyysos
Copy link

any updates on this issue?

@vitaly-dt
Copy link

Hi - does anyone have any insights on this one?

@grosenba
Copy link

I can only say that I still have the problem with 2.10.4.

@thomaspetit
Copy link

thomaspetit commented Mar 22, 2024

Has anyone found a workaround for this one?

I notice this too:

- lastTransitionTime: "2024-03-22T13:01:35Z"
    message: Successfully generated parameters for all Applications
    reason: ApplicationSetUpToDate
    status: "False"
    type: ErrorOccurred

Meanwhile these errors pop-up in the appset controller:

time="2024-03-22T13:07:17Z" level=error msg="unable to set application set status: Operation cannot be fulfilled on applicationsets.argoproj.io \"argocd\": the object has been modified; please apply your changes to the latest version and try again" applicationset=argocd/argocd

The latter seems unrelated to the initial issue logged here but it is interesting to see that the progressive rollout also has issues with ArgoCD being managed by the progressive rollout.

@Qwiko
Copy link

Qwiko commented Mar 27, 2024

I also have this issue on 2.10.4

@gmauleon
Copy link

gmauleon commented Sep 17, 2024

I believe @carlosrejano added some retries that might fix that in #19535.

What worries me is that from my outsider perspective, an application status in the applicationset should always be able to move forward based on the real application statuses, it should not get stuck in a state based on its stored status.

It seems like some re-work is needed of the pseudo state machine but I have a hard time to grasp all the logic 😅

@gmauleon
Copy link

Allright after some more digging I believe the logic I was talking about was rewritten in #17296 released in v2.12.
There is also a reconciliation issue in v2.12 that will be cherry picked and released soon, I believe, via #19995.

I'm currently running a custom version with the cherry pick and it seems to work so far.
The only caveat is that the applications that were stuck in "Pending" were not moved automatically, I had to patch the status to "Progressing" myself but after that, no more problems appeared.

There still seems to be potential "stuck in pending" problems mentioned in #19535 though with consecutive commits during a rolling sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appset/progressive-syncs Issues related to the ApplicationSet progressive syncs feature. bug Something isn't working
Projects
None yet
Development

No branches or pull requests