Issue: Notifications (slack etc) for failed builds triggered on every build

Drone server: 0.8
Drone agent: 0.8

I have noticed that if there are any recent failed builds for any project on Drone, triggering a new build will cause notifications from previous failed builds to be sent again. As you can imagine, this is very annoying for everyone on Slack. I’m unsure exactly what the criteria is for the failed notifications, but they appear to be the same builds.

Any help with this would be greatly appreciated, and do let me know if I can be any help as I have some familiarity with Go.

David

triggering a new build will cause notifications from previous failed builds to be sent again.

I do not have enough information to assess why multiple notifications are displayed in your screenshots, but I can say with certainty that a new build cannot trigger duplicate notifications from previous builds.

The only way to trigger duplicate notifications with the same sha and branch would be:

  1. you configure multiple notification steps in the same yaml
  2. github is sending multiple, duplicate webhooks for the same commits, thus causing duplicate builds to execute
  3. someone is re-starting your build causing it to re-execute and re-send notifications
  4. your agents become unhealthy or lose communication with the server or are killed before the build is complete, causing the build to re-queue and eventually re-execute

Thanks for your response @bradrydzewski, much appreciated. I’ll look more into it. Thus far:

  1. We do have multiple notification steps, but I think they’re configured correctly. This is what we have:

    slack:
    image: plugins/slack
    channel: android-dev
    username: drone
    branch: develop
    secrets: [ slack_webhook ]
    when:
    status: [ failure ]

    slack:
    image: plugins/slack
    channel: app-deploys
    username: drone
    secrets: [ slack_webhook ]
    when:
    event: tag

  2. We’re using bitbucket in this case, but this is possible, will check.

  3. I don’t believe anyone is manually doing this, as there’s only one build running when I check, the notifications are also for a different codebase to the one being worked on, it’s being triggered from pushes to other repos.

  4. We only have one agent server and one agent running at the moment via docker compose. It’s possible there’s a comms issue here though, are there good ways to diagnose this?

Forgive the incorrect indentation on the YAML here, having trouble formatting here. It is correct in the .drone.yml file.