cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
priyeshwagh777
Advocate IV
Advocate IV

Command Line failing with error "Cmd.exe exited with code 1" after Unpack in Command Line in Pipeline

Hi,

I've been trying to export Solution from an environment and trying to import in another on in same tenant. In the first half of the process where we usually go with - Tool Installer -> Export Solution -> Unpack Solution -> Command Line Script.

My Job is failing in Command Line Script which looks like this

echo Write your commands here

echo commit all changes
git config user.email "crmadmin@cft146.onmicrosoft.com"
git config user.name "Joe Danny"
git checkout master
git add --all
git commit -m "solution export"
echo push code to new repo
push origin master

 

I also don't see if my solution was actually exported. The Export Step though was successful.

I'm not using MFA, but I'm not sure if this is correct and where I can find documentation on this. I simply tried to do referring other's articles. Please point me in the correct direction.

Thanks.

6 REPLIES 6
rimatos
Community Support
Community Support

Hi @priyeshwagh777 ,

 

could you let me know from where you are attempting to export your solution from? If you are attempting to export a solution from Power Platform and are using PowerApps, you can simply go to make.powerapps.com, and you can import it directly from the solutions tab:

 

 

image.png

 

Hope this helps!

 

Regards,

Ricardo

,

I'm doing this by using Power App Build Tools in Azure DevOps under PipeLines to automate my CI/CD process.

Greetings, sorry this thread has been quiet - can you pls. try and remove the following line from your script: "echo Write your commands here"

 

MFA is unrelated to this as your solution exports correctly, i.e. you are connected to the environment. Let me know if that helps

 

Thanks

 

prik20
New Member

Hi, 

Was anybody able to solve this issue? I am getting the same error, tried removing the echo statements, then too failing

DianaBirkelbach
Super User
Super User

Hi @prik20 , 

I have the feeling that this is an error caused if in the agent job properties, the "Allow scripts to access the OAuth token" is missing.

DianaBirkelbach_1-1613583124517.png

 

DianaBirkelbach_0-1613583024523.png

Hope this helps!

Kind regards,

Diana

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
taclinard
Frequent Visitor

Ok I had the exact same problem as stated above, and not sure if you figured it out already, but this is what worked for me.

First- Verify the name of your primary repository branch, code from elsewhere calls it "master" but mine was actually called "main".
So I changed the code to :


echo commit all changes
git config user.email "email@comany.com"
git config user.name "<username>"
git checkout main
git add --all
git commit -m "solution init"
echo push code to new repo
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push origin main

 

Then I also had to make sure that the repository had the right permissions.

 

So I went to Project Settings>Repositories Clicked on my repository for settings

 

Then I went to Security and updated the Build Service User as well as my own login with permissions to write, push, and create in the repository.

 

I also updated the permissions on all other repositories for future pipelines.

taclinard_2-1617123119185.png

 

taclinard_3-1617123119200.png

 

After that, it worked.

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,636)