Skip to main content

Notifications

Copilot Studio - General
Unanswered

Error while creating a copilot based on a template

Posted on by 10

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.

  • guna_ Profile Picture
    guna_ 2 on at
    Re: Error while creating a copilot based on a template

    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.

  • LimeLeaf Profile Picture
    LimeLeaf 278 on at
    Re: Error while creating a copilot based on a template

    @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. 🙂



  • NicolasGeolives Profile Picture
    NicolasGeolives 10 on at
    Re: Error while creating a copilot based on a template

    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?

  • adilei Profile Picture
    adilei on at
    Re: Error while creating a copilot based on a template

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

    See if this helps.

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 137,998

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard