Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Failed notifications affect multiple subscribers #79

Closed
vliu18 opened this issue Apr 24, 2020 · 4 comments · Fixed by #116
Closed

Failed notifications affect multiple subscribers #79

vliu18 opened this issue Apr 24, 2020 · 4 comments · Fixed by #116
Labels
bug Something isn't working
Milestone

Comments

@vliu18
Copy link

vliu18 commented Apr 24, 2020

A trigger with multiple subscribers would resend the notification to every subscriber irrespective of successful action by that subscriber. For instance, I have

subscriptions:
  - recipients:
    - webhook:XXX
    triggers:
    - sync-succeeded
  - recipients:
    - slack:YYY
    triggers: 
    - sync-succeeded
    - sync-failed

If the webhook failed for some reason, notifications would keep on being (re)sent to the webhook (which is the correct behavior) as well as the slack subscriber (which seems wrong to me).

Is there a way to configure the tool so that it only resubmit the notification to failed subscribers? Or would this be a new feature?

@alexmt
Copy link
Collaborator

alexmt commented May 6, 2020

Hello @vliu18 ,

I agree with you. In described scenario notifications should be resent only to slack. A code change is required to support it. I think the current behavior is rather a bug, so we should prioritize it accordingly.

@alexmt alexmt added the bug Something isn't working label May 6, 2020
@alexmt alexmt added this to the v0.8 milestone May 11, 2020
@xakraz
Copy link

xakraz commented Jul 28, 2020

I just faced the exact same issue !

I have a ConfigMap defined like that

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
data:
  config.yaml: |
    subscriptions:
    # global subscription for all type of notifications
    - recipients:
      - slack:my-channel
    triggers:
      - name: on-sync-status-unknown
        enabled: true
      - name: on-sync-failed
        enabled: true
      - name: on-sync-running
        enabled: true
      - name: on-sync-succeeded
        enabled: true
      - name: on-health-degraded
        enabled: true

Which behaves as expected ✔️

Today, I have setup the bot deployment to let my teammate subscribe to some application by them self.

so

/argocd subscribe proj:my-pro

Only visible to you
17:50
The slack:channel1 is subscribed to 0 applications and 2 projects.
Projects: argocd/production, argocd/staging.

But when an update is deployed by Argo, the channel did not get notifications and the one defined in the ConfigMap was flooded by notifications.

I found in argocd-notifications-controller's logs:

"Failed to notify recipient slack:back-deploy defined in app argocd/public-api-prod: not_in_channel" app=argocd/public-api-prod

Once I invited the bot to the channel, the notification was successfully delivered and the flood in the default channel stopped ...

image: argoprojlabs/argocd-notifications:v0.6.1

@booleanbetrayal
Copy link

@alexmt - Is it possible to get a new release cut with this fix? Thanks!

@jonathonbattista
Copy link

jonathonbattista commented Nov 16, 2020

When will there be a new release with this fix?

v0.8 doesn't look close to be done.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants