web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Error while creating a...
Copilot Studio
Suggested Answer

Error while creating a copilot based on a template

(2) ShareShare
ReportReport
Posted on by 14

I'm using Power Platform CLI to try to duplicate a copilot. To do this, I first retrieve the template of my initial copilot with the following command :
pac copilot extract-template --bot BOT_NAME --environment ENV_ID --templateFileName FILE_NAME

 

Once the template has been successfully retrieved, I try to create a new copilot with the following command:
pac copilot create --displayName BOT_NAME --schemaName SCHEMA_NAME -s Default --templateFileName TEMPLATE_FILE_NAME -env ENV_ID

The response is : 

NicolasGeolives_1-1708012689248.png


And in the logs it says : 
bolt.cli.CommandProcessor :: EndExecutingVerb (Success: False, Execution Time(ms): 984)
bolt.Session :: HTTP Status:BadRequest, ServiceRequestId: SERVICE_REQUEST_ID [0x80048408:InvalidStateCodeStatusCode] 2 is not a valid status code for state code botcomponentState.Active on botcomponent with Id ID.|EXCEPTION: Microsoft.Bot.Platform.Content.Exceptions.DataverseBadRequestException: HTTP Status:BadRequest, ServiceRequestId: SERVICE_REQUEST_ID [0x80048408:InvalidStateCodeStatusCode] 2 is not a valid status code for state code botcomponentState.Active on botcomponent with Id ID.

On the other hand, if I try this technique again, but this time with a blank copilot (created using copilot studio), then the technique works and my new copilot is well created.

 

Any advice or guidance would be greatly appreciated.

 

Thank you.

Categories:
I have the same question (0)
  • adilei Profile Picture
    on at

    Here are the steps to follow: Solved: Re: How to duplicate a Copilot? - Power Platform Community (microsoft.com)

    See if this helps.

  • NicolasGeolives Profile Picture
    14 on at

    Unfortunately, these were the steps I had already taken. I've tried both the new pac copilot commands and the pac virtual-agent commands, but I keep getting the same error. Do you have any other suggestions?

  • LimeLeaf Profile Picture
    278 on at

    @NicolasGeolives I stumbled over a similiar error trying to create a copy of a copilot from template file by using the Power Platform tools CLI. I followed the instructions mentioned by @adilei described in the post (Solved: Re: How to duplicate a Copilot? - Power Platform Community (microsoft.com))

    I didn't found a solution yet. Did you?

    The error message in my case says:

    LimeLeaf_1-1710833434018.png
    A error unhandled error appeared in the app, it had to be terminated. Error Type: Microsoft.Bot.Platform.Content.Exception.DataverseNotFoundException.

    The targeted environment contains a Dataverse instance for sure. 🙂



  • guna_ Profile Picture
    2 on at

    I have had the same error.

    2 is not a valid status code for state code botcomponentState.Active on botcomponent with Id <botcomponentId>

    It just means that some of your Topics or other bot components are inactive. When cloning a Copilot you need all of its components to be active. Try once with all the components active.

  • Suggested answer
    louis_J Profile Picture
    12 on at
    @Guna is right
     
    Please, delete or activate the non-enabled topics from your copilot before exporting it
     
    Then the import back to copilot should work perfectly
     
    I had the same issue and doing so solved it

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 261 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 198 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard