Azure-sdk-for-go: Unable to create BOT

Created on 26 Apr 2021  路  5Comments  路  Source: Azure/azure-sdk-for-go

Bug Report

  • import path of package in question:

"github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2018-07-12/botservice"

  • SDK version e.g. master, latest, 18.1.0

_go.mod_ file shows this information: github.com/Azure/azure-sdk-for-go v53.4.0+incompatible

  • output of go version

go version go1.16.3 windows/amd64

  • What happened?

Tried to create a bot using the following code save to a file named bot.go:

package main

import (
    "context"
    "fmt"
    "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2018-07-12/botservice"
    "github.com/Azure/go-autorest/autorest/azure/auth"
    "github.com/Azure/go-autorest/autorest/to"
)

func main() {
    botClient := botservice.NewBotsClient("<subscription_id>")
    authorizer, err := auth.NewAuthorizerFromEnvironment()
    if err == nil {
        botClient.Authorizer = authorizer
    } else {
        fmt.Println("Error authorizing.")
    }
    theBot, err := botClient.Create(
        context.Background(),
        "<rg_name>",
        "<some_bot_name>",
        botservice.Bot{
            Sku:      &botservice.Sku{Name: "F0"},
            Location: to.StringPtr("global"),
        },
    )
    if err != nil {
        fmt.Printf("Error: %v", err)
    }
    fmt.Println(theBot.ID)
}

Credentials were setup using environment variables.

Tried to run with go run bot.
After approximately 5 minutes waiting, got the following error back:

Error: botservice.BotsClient#Create: Failure responding to request: StatusCode=500 -- Original Error: autorest/azure: Service returned an error. Status=500 Code="InternalServerError" Message="Encountered internal server error. Please try again."

Looking at activity log on azure portal I see the cryptic "Internal Server Error" message only. No additional info...

  • What did you expect or want to happen?

The bot to have been successfully created on my Azure subscription resource group

  • How can we reproduce it?

Probably using the code I provided above using the latest stable release ofr azure sdk for go.

  • Anything we should know about your environment.

Running on Windows 10. Probably using the "latest stable" version of azure-sdk-for-go (just added the dependency to the code and ran go mod init)

Bot Service Service Attention bug customer-reported

All 5 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sgellock.


Issue Details

Bug Report

  • import path of package in question:

"github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2018-07-12/botservice"

  • SDK version e.g. master, latest, 18.1.0

_go.mod_ file shows this information: github.com/Azure/azure-sdk-for-go v53.4.0+incompatible

  • output of go version

go version go1.16.3 windows/amd64

  • What happened?

Tried to create a bot using the following code save to a file named bot.go:

package main

import (
    "context"
    "fmt"
    "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2018-07-12/botservice"
    "github.com/Azure/go-autorest/autorest/azure/auth"
    "github.com/Azure/go-autorest/autorest/to"
)

func main() {
    botClient := botservice.NewBotsClient("<subscription_id>")
    authorizer, err := auth.NewAuthorizerFromEnvironment()
    if err == nil {
        botClient.Authorizer = authorizer
    } else {
        fmt.Println("Error authorizing.")
    }
    theBot, err := botClient.Create(
        context.Background(),
        "<rg_name>",
        "<some_bot_name>",
        botservice.Bot{
            Sku:      &botservice.Sku{Name: "F0"},
            Location: to.StringPtr("global"),
        },
    )
    if err != nil {
        fmt.Printf("Error: %v", err)
    }
    fmt.Println(theBot.ID)
}

Credentials were setup using environment variables.

Tried to run with go run bot.
After approximately 5 minutes waiting, got the following error back:

Error: botservice.BotsClient#Create: Failure responding to request: StatusCode=500 -- Original Error: autorest/azure: Service returned an error. Status=500 Code="InternalServerError" Message="Encountered internal server error. Please try again."

Looking at activity log on azure portal I see the cryptic "Internal Server Error" message only. No additional info...

  • What did you expect or want to happen?

The bot to have been successfully created on my Azure subscription resource group

  • How can we reproduce it?

Probably using the code I provided above using the latest stable release ofr azure sdk for go.

  • Anything we should know about your environment.

Running on Windows 10. Probably using the "latest stable" version of azure-sdk-for-go (just added the dependency to the code and ran go mod init)

Author: rmsilva1973
Assignees: -
Labels: `Bot Service`, `Service Attention`, `customer-reported`, `needs-triage`, `question`
Milestone: -

Hi @rmsilva1973 thank for this issue!

I am sorry this happens, and the error message reads like this is something wrong in the service side - therefore I just tagged this issue so that the corresponding service team could take a look at this.

Hi @rmsilva1973. Sorry you've run into this. I own bot framework and supporting tools. Bot Framework doesn't yet support Go language. We currently support Python, Java, JavaScript and C#. this looks like a migration effort by a team outside of my team. Let me try and track down who owns this. the code for the bot service api is autogenerated using openapi definitions. that much I can see from looking at the code.

Hi @rmsilva1973 Looking at this, it appears the underlying cause is the usage of an old Swagger file. I've filed #14627 to update this SDK to use the newest swagger file, at which point we can push a new release.

The updated package was published in v54.2.0. Please ping back if you're still having problems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

salameer picture salameer  路  5Comments

colemickens picture colemickens  路  3Comments

njuCZ picture njuCZ  路  3Comments

mbfrahry picture mbfrahry  路  4Comments

ncw picture ncw  路  4Comments