cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting a release using command line through Azure DevOps

AdityaPradhan
Level 3
Hello All,

I am trying to automate the creation of a .bprelease file from an existing package using command line "AutomateC.exe" by calling this step from an Azure DevOps pipeline.

I am able to export a process or an object without any problems. When I try to do the same for a release I get the following error:

Error processing action: exportpackage.
BluePrism.Server.Domain.Models.BluePrismException: Failed writing XML for type: releaseout; ID: 19; Name: <***CustomBluePrismReleaseName***>; Error message: The handle is invalid.
---> System.IO.IOException: The handle is invalid.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at AutomateC.AutomateC.w(Int32 perc, Object msg)
at BluePrism.BPCoreLib.clsProgressMonitor.OnProgressChanged(Int32 value, Object data)
at BluePrism.AutomateAppCore.clsRelease.WriteXmlHead(XmlWriter writer)
at BluePrism.AutomateAppCore.PackageComponent.ToXml(XmlWriter writer)
--- End of inner exception stack trace ---
at BluePrism.AutomateAppCore.PackageComponent.ToXml(XmlWriter writer)
at BluePrism.AutomateAppCore.clsRelease.Export(Stream stream, clsProgressMonitor mon)
at BluePrism.AutomateAppCore.clsRelease.Export(FileInfo file, Boolean compress, clsProgressMonitor mon)
at AutomateC.AutomateC.Run(String[] args)
---------------------------------end of error-----------------------------------

The release gets created in the BP application but the creation of .bprelease file fails with "The handle is invalid" error. My command for the above operation is given below:

"C:\Program Files\Blue Prism Limited\Blue Prism Automate\AutomateC.exe" /user <username> <password> /dbconname <connName> /exportpackage <packageName> /release <CustomBluePrismReleaseName>

If anyone has encountered a similar error and has been able to resolve it, kindly assist. The Azure DevOps pipeline could be any DevOps pipeline tool which allows to execute command line scripts.

Thanking you in advance.

Regards,
Adi 
7 REPLIES 7

ewilson
Staff
Staff
@AdityaPradhan,

Are you trying to export a previous version of the most recent package? According to the documentation that's the only reason you would include the /release flag. If you just want the current version of the package all you need to do is include the /exportpackage flag and the package name.​

Cheers,

AdityaPradhan
Level 3

@Eric Wilson,

 Thank you very much for the immediate response!
I wasn't able to find a way to respond to your answer so using the "Answer" option instead...

 I am not trying to export a previous version of the most recent package. The reason I used the /release flag is to be able to give a custom name to my release and the .bprelease file that gets created. I also tried to remove the /release flag but I get the exact same error.

 When I run the command in a command line window it works perfectly creating the custom release name in BP as well as generating the custom named .bprelease file. When I run it through the Azure DevOps pipeline then I get this error. I am able to generate the .bpprocess or .bpobject files by calling the AutomateC from Azure pipeline but it fails only for the release ☹.

 Any guidance on this will be fantastic. Thank you again!

 

Cheers,

Adi

ewilson
Staff
Staff
@AdityaPradhan,

Hmm, so I would think this is a permissions issue, but that doesn't seem to apply if you're able to create some of the files but not others. I'd say you probably want to submit a ticket to the support to determine if this is possibly a bug.

Cheers,
Eric​

AdityaPradhan
Level 3
@ewilson

Thank you again for the quick answer!

I was hoping that someone had faced a similar issue and possibly I was using the command wrongly. Yes, considering that process and object files get exported, I think it could be my usage or a bug. I will contact support and also try playing around a bit. Will update this thread if I get this resolved.

Thank you.
Cheers,
Adi​

MichealCharron
Level 8

While I don't have an answer for you on how to put it into the pipeline tool, I can tell you why you are getting the error. If you look at the behavior of the /exportpackage action in AutomateC you can see that it displays all it's multiple status messages on 1 line which tells us that somewhere in the code the cursor is being reset to the starting position of the line. While this works when outputting to the display it can't be handled when the status is being redirected to a file.

The reason the /export action works is that there is only a single line of status being shown from AutomateC.

Micheal Charron
RBC
Toronto, Ontario
Canada

AdityaPradhan
Level 3
Hello All,

Thank you for your support and the suggested answers. I am writing this so that anyone who faced similar problem may be able to use it. I was able to resolve the issue using powershell command instead of dos command. The powershell command that worked as below:

Start-Process -Wait -FilePath "C:\Program Files\Blue Prism Limited\Blue Prism Automate\AutomateC.exe" -ArgumentList '/user "<username>" "<password>"', '/dbconname "<dbconName>"', '/exportpackage "<packageName>"', '/release "<customReleaseFileName>"'

As you can see it is identical to the command that I was trying to execute using dos command task in Azure DevOps pipeline, but it fails. It succeeds using poweshell task in Azure DevOps Pipeline...not sure what to make of it... I have written to Blue Prism support and awaiting their reply on why it fails using dos command task.

Hope this is helpful 🙂

Cheers,
Adi

ewilson
Staff
Staff
@AdityaPradhan,

Glad to hear you fond a solution. 🙂

Cheers,
Eric​