Sometimes you may run into issues when running the Power Platform CLI, or pac cli. As an example, trying a simple pac auth create stopped working for me. The error produced was:
Sorry, the app encountered a non recoverable error and will need to terminate. The exception details have been captured and will be forwarded to the development team, if telemetry has been enabled. Exception Id: 10ff1f33-efd2-42f8-b5bf-701af0bd5972, Exception Type: System.ComponentModel.Win32Exception
The diagnostic logs can be found at: C:\Users\CarldeSouza\AppData\Local\Microsoft\PowerAppsCLI\Microsoft.PowerApps.CLI.1.29.11\tools\logs\pac-log.txt
I tried the usual troubleshooting:
- Connecting to different orgs
- Uninstalling and installing the Microsoft PowerApps CLI
- Clearing app data located at C:\Users\<profile>\AppData\Local\Microsoft\PowerAppsCLI
- Ensuring I have the latest code through pac install latest
- Restarting my computer
None of the above worked. Note my error came from the installation from the Power Platform Tools Windows MSI located here. So there were 2 other options as well:
- Installing through dotnet tool install –global Microsoft.PowerApps.CLI.Tool
- Installing through Visual Studio Code
I tried installing through dotnet tool:
This immediately resolved the issue, I was able to create an auth connection using the same command! This is obviously strange as the version of the CLI was the same.
Even though my issue was resolved, I was curious if the error would return going back to the Windows MSI.
I tried uninstalling through the dotnet tool (dotnet tool uninstall –global Microsoft.PowerApps.CLI.Tool) and reinstalling through the Windows MSI and the original error returned!
There’s a couple of other things that may be useful here. First, let’s say there was a bug with the version installed through dotnet tool. In this case, you can install a different/prior version of the pac cli, and this may resolve your issue:
dotnet tool install --version 1.29.10 --global Microsoft.PowerApps.CLI.Tool
And alternatively, you can use the Power Platform Tools extension inside VS Code to perform your actions (this also worked for me). This won’t work in a command prompt outside VS Code but maybe it will be enough to unblock you from working.
I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.
IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.
THANK YOU, AND LET'S KEEP LEARNING TOGETHER.
CARL