New Reply

Good news! We have migrated all the Q&A on this site to https://forums.inedo.com, and are currently monitoring questions there!

Here are some important links:

All posts here are permanently locked (and will be redirected soon), and if you have any issues with the new site, please submit a support ticket, use the contact form, or visit our Slack Workspace.

The following error shows up in the logs after completion of a stage that has an ApprovalRequiredEventListener attached as a Post-Deployment action.

Unhandled exception: Unable to cast object of type 'Inedo.BuildMaster.Events.ExecutionCompleteEvent' to type 'Inedo.BuildMaster.Events.BuildPromotionCompletedEvent'.

I found the previous entries for BM-2370 - FIX: "System.InvalidCastException" attempting to run Approval Required event listener in the service. However that entry seems to apply to BuildMaster 5.6.8 and was fixed in 5.6.9 I am currently evaluating using version6.1.7.

Product: BuildMaster
Version: 6.1.7

Mark,

Approval Required listens for Build Promotion Completed events, so the pipeline stage filter should have the name of the stage of the pipeline immediately before the approval gate, not the stage that is blocked by the approval gate.

Will this resolve your issue?

Thanks,
Jason

I do not think so, or at least perhaps the instructions and advice were not perfectly clear.

I am unable to upload am image, so I will try reducing it to text.

There are 3 Pipeline Stages: Build Ready -> Testing -> Production

Build Ready: Imports artifacts from Jenkins. No approvals required, automatically deploys to the next stage (Testing)

Testing: Deploys to the test environment. No approvals required, 2 post-deployment notifications are registered: Notify on deployment complete,  and Notify for Approvals. Automatically deploys to the next stage (Production)

Production Deploys to the production environment. 2 approvals required: Group Approval, and All Issues Closed, 1 post-deployment notification is registered: Notify on deployment complete.

The problem is that the Group Approval notification is never sent. Instead the Unhandled exception: Unable to cast object of type 'Inedo.BuildMaster.Events.ExecutionCompleteEvent' to type 'Inedo.BuildMaster.Events.BuildPromotionCompletedEvent'. error is recorded.

However, if I remove the Group Approval and replace it with a User Approval (and subsequently make sure that the user has an entry in "My Event Listeners") then the approval email notification is successfully sent.

Hi Mark,

We have created an issue for this and will be prioritizing this for a future release.

Thanks,
Jason