SQL-DACPAC is community step template
when we run the to deploy DACPAC very often getting below error ,
The step template run till the $decservice.Deploy() in the above image ,
after that we getting error in Unregister-Event cmdlet
| The step failed: Activity Deploy {stepname }on Workers-Pool-LE failed with error ‘The remote script failed with exit code 1’
Hi @yuvarajit07 and welcome to the Octopus Community.
Firstly, would you please expand on this: when we run the to deploy DACPAC very often getting below error
Does this mean that sometimes the command is working?
If so, we might want to look at what failing and succeeding “Unregister-Event” commands have in common.
What version of Powershell are you using?
Would you be able to change those last two “Unregister-Event” lines to the following:
Hi Dane,
We are using octopus community template , if we do any changes in that , we need to save as copy of that right ?
In this case, we don’t get any new updates for the step template right ?
kindly suggest
For testing, yes, you would need to save a copy of the Step Template currently linked to the Community Step Template to make changes. However, the SQL - Deploy DACPAC Step Templates are maintained by a member of our Solutions Team. I’ve sent a message for them to have a look at this for us as well.
Either he or I will get back to you once he’s had a chance to review this post.
Greetings! Would you be able to provide a full log file for review? I’m thinking the register event may not be working so the unregister-event may be failing because of it.
Thank you for providing the log file, it was useful in determining if the event registration was working correctly. The messages in the log like DacServices: Extracting schema from database are indeed from the event as the code block prefixes the messages with DacServices: so that’s not failing. There are multiple versions of the DACPAC template, would you be able to tell us which one you’re using?
During my analysis, I found the original version of the template had the Unregister-Event call in a Finally block, the others look to have moved it out of the Finally and into the Try portion. I’m not sure as to why this change was made and I’m hesitant to add it back as this is used by quite a few people. Would you be willing to test moving it back into the Finally (or add the Finally block back, actually) and see if that fixes your issue? I tried it locally and it seemed to work fine, but before implementing it, I’d like to see if it actually resolves your issue.
if we do any changes in that , we need to save as copy of the community template
In this case, we need to do changes in many places and we don’t get any new updates for the step template right ?
kindly suggest,
Which version having the finally block code ? , is it possible can we use it ?
Version 16 (the latest available) was the one I was looking at which had it in the finally block. You could upgrade the template to that and then test it out on one of your projects to see if that fixes it. I’m not terribly confident that it will, unfortunately.