seanmcne / Microsoft.Xrm.Data.PowerShell

This module uses the CRM connection from Microsoft.Xrm.Tooling.CrmConnector.Powershell and provides common functions to create, delete, query, and update data as well as functions for common tasks such as publishing, and manipulating System & CRM User Settings, etc. The module should function for both Dynamics CRM Online and On-Premise environment.
201 stars 64 forks source link

'Microsoft.Xrm.Data.Powershell' failed to be installed #511

Closed satishkotaru closed 1 year ago

satishkotaru commented 1 year ago

Hello, I am facing this error since this morning previously we never encountered this. Can you some one help/address the issue. Error Details:
2022-11-01T16:07:59.0042641Z PackageManagement\Install-Package : Package 'Microsoft.Xrm.Data.Powershell' failed to be installed because: The file 2022-11-01T16:07:59.0043447Z 'C:\Users\VssAdministrator\AppData\Local\Temp\mm3l2sme[Content_Types].xml' already exists. 2022-11-01T16:07:59.0044862Z At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:9711 char:34 2022-11-01T16:07:59.0045451Z + ... talledPackages = PackageManagement\Install-Package @PSBoundParameters 2022-11-01T16:07:59.0046404Z + ~~~~~~~~~~~~ 2022-11-01T16:07:59.0047352Z + CategoryInfo : InvalidResult: (Microsoft.Xrm.Data.Powershell:String) [Install-Package], Exception 2022-11-01T16:07:59.0048498Z + FullyQualifiedErrorId : Package '{0}' failed to be installed because: {1},Microsoft.PowerShell.PackageManagement 2022-11-01T16:07:59.0049189Z .Cmdlets.InstallPackage 2022-11-01T16:07:59.0049618Z
2022-11-01T16:07:59.0393019Z ##[debug]Exit code: 1 2022-11-01T16:07:59.0424647Z ##[debug]Leaving Invoke-VstsTool. 2022-11-01T16:07:59.0666059Z ##[error]PowerShell exited with code '1'. 2022-11-01T16:07:59.0674781Z ##[debug]Processed: ##vso[task.logissue type=error]PowerShell exited with code '1'. 2022-11-01T16:07:59.0720756Z ##[debug]Processed: ##vso[task.complete result=Failed]Error detected 2022-11-01T16:07:59.0737150Z ##[debug]Leaving D:\a_tasks\PowerShell_e213ff0f-5d5c-4791-802d-52ea3e7be1f1\2.210.0\powershell.ps1. 2022-11-01T16:07:59.1095047Z ##[section]Finishing: PowerShell

satishkotaru commented 1 year ago

@seanmcne Can you able to let us know is it happening due to an update to Microsoft.Xrm.Data.Powershell? or due to any other fixes. Thanks you.

seanmcne commented 1 year ago

Will investigate ASAP - looks to be an installation error on update for some reason, will figure that out and republished. Thanks for letting me know!

seanmcne commented 1 year ago

@satishkotaru we should be in good shape now, apologies for the blip it appears a content_type file caused a conflict. I've got it cleaned up now and made 2.8.17 available. Also, this contains the latest connector updates so hopefully it should be working well for you again. Thank you again for the early feedback and heads up - I really appreciate it!

satishkotaru commented 1 year ago

@seanmcne I am seeing the same issue again. This morning it worked fine. Is their any update again? Error : image

seanmcne commented 1 year ago

@satishkotaru - I published an alpha package and unlisted it for testing for unblocking of a current issue (which shouldn't be picked up by nuget unless you specifically allow pre-release packages). I'll be publishing another alpha or beta shortly - does your error or script show which version it was attempting to install? I see 2.8.4 but I don't think that's the version being installed

CHues5Y commented 1 year ago

Hi @seanmcne, I am also experiencing this issue right now running the script as part of an ADO Pipeline deployment. My script doesn't state a version, so I assume it's just taking the latest.

seanmcne commented 1 year ago

It should take the latest "released" version I would expect... just a while back #515 was opened too (as I was looking into this) and I did discover .16 was re-listed and .17 was unlisted and I had to revert that. I'm not sure if it was the result of the release script I used but I will have to make sure I check the UI for the gallery until I get that completely situated/figured out.

Also, I have an alpha build of 19 but that should be ignored unless you explicitly ask it to install pre-release versions.

CHues5Y commented 1 year ago

Locally ran, it definitely calls .17 as the version. But as a workaround I tried forcing it to use .14 as per #515 and this has worked a treat. I'm not sure on the impact of using .14 over latest but that's a conversation I need to have with my colleagues! Thanks for coming back to me and pointing that out

seanmcne commented 1 year ago

I just re-installed (on a test VM) and it grabbed the current .17 version and installed is successfully. If I force the installation of .16, it will fail with the error above. Please do let me know if you are getting any failures with .17 as I'm unable to reproduce that anywhere on my end right now. Thx!

CHues5Y commented 1 year ago

Hi Sean, I've since ran the pipelines that I didn't change the required version on, and it's been running fine ever since. So I think we're all good now!

Thank you!

seanmcne commented 1 year ago

FYI I'm going to ship an updated module 2.8.19, it's been tested on my end and tested by several folks running into the null issue when zero records are returned.