cloud-barista / cb-tumblebug

Cloud-Barista Multi-Cloud Infra Management Framework
Apache License 2.0
40 stars 46 forks source link

Report that abnormal log appears when creating MCIS #1561

Closed yunkon-kim closed 2 months ago

yunkon-kim commented 2 months ago

Still, I'm unsure if it is a bug, abnormal behavior, or a problem with my execution environment... So, I posted a report.

What happened : When I clicked and created an MCIS on MapUI. : I encountered logs as below. : It seems related to CBStore or the generated key for spec.

...
10:50AM WRN ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1671 > cannot find the key /ns/kdemo-ns01/resources/spec/azure+koreacentral+standard_b1s
10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1675 > Use the common VMSpecName: Standard_B1s
subGroupSize: 1
...
10:50AM WRN ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1671 > cannot find the key /ns/kdemo-ns01/resources/spec/aws+ap-northeast-2+t3a.nano
10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1675 > Use the common VMSpecName: t3a.nano
...
10:50AM WRN ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1671 > cannot find the key /ns/kdemo-ns01/resources/spec/gcp+asia-northeast3+g1-small
10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1675 > Use the common VMSpecName: g1-small
in UpdateResourceObject; extracted resourceId: kdemo-ns01-systemdefault-aws-ap-northeast-2
10:51AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1570 > 2024-05-08 10:51:24
in UpdateResourceObject; extracted resourceId: kdemo-ns01-systemdefault-azure-koreacentral
in UpdateResourceObject; extracted resourceId: kdemo-ns01-systemdefault-gcp-asia-northeast3
Click to see more logs ```bash 10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:924 > Create MCIS object subGroupSize: 1 10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:976 > Create MCIS subGroup object 10:50AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1008 > vmInfoData.Name: g1-1 subGroupSize: 1 10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:976 > Create MCIS subGroup object 10:50AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1499 > Start to add VM To MCIS 10:50AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1008 > vmInfoData.Name: g2-1 10:50AM WRN ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1671 > cannot find the key /ns/kdemo-ns01/resources/spec/azure+koreacentral+standard_b1s 10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1675 > Use the common VMSpecName: Standard_B1s subGroupSize: 1 10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:976 > Create MCIS subGroup object 10:50AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1499 > Start to add VM To MCIS 10:50AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1008 > vmInfoData.Name: g3-1 10:50AM WRN ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1671 > cannot find the key /ns/kdemo-ns01/resources/spec/aws+ap-northeast-2+t3a.nano 10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1675 > Use the common VMSpecName: t3a.nano 10:50AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1499 > Start to add VM To MCIS 10:50AM WRN ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1671 > cannot find the key /ns/kdemo-ns01/resources/spec/gcp+asia-northeast3+g1-small 10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1675 > Use the common VMSpecName: g1-small in UpdateResourceObject; extracted resourceId: kdemo-ns01-systemdefault-aws-ap-northeast-2 10:51AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1570 > 2024-05-08 10:51:24 in UpdateResourceObject; extracted resourceId: kdemo-ns01-systemdefault-azure-koreacentral in UpdateResourceObject; extracted resourceId: kdemo-ns01-systemdefault-gcp-asia-northeast3 10:51AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1570 > 2024-05-08 10:51:49 10:51AM DBG ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1570 > 2024-05-08 10:51:50 ```

Anything else we need to know? : From my observation, CBStore.Get(key) may return nil.

// GetCspResourceId is func to retrieve CSP native resource ID
func GetCspResourceId(nsId string, resourceType string, resourceId string) (string, error) {
    key := GenResourceKey(nsId, resourceType, resourceId)
    if key == "/invalidKey" {
        return "", fmt.Errorf("invalid nsId or resourceType or resourceId")
    }
    keyValue, err := CBStore.Get(key)
    if err != nil {
        log.Error().Err(err).Msg("")
        return "", err
    }
    if keyValue == nil {
        //log.Error().Err(err).Msg("")
        // if there is no matched value for the key, return empty string. Error will be handled in a parent function
        return "", fmt.Errorf("cannot find the key " + key)
    }

Environment

yunkon-kim commented 2 months ago

It turned out to be a normal process. Let me describe the understanding process and close this issue.

  1. Find a spec that a user registered in Tumblebug in advance.

    10:50AM WRN ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1671 > cannot find the key /ns/kdemo-ns01/resources/spec/azure+koreacentral+standard_b1s
  2. If the user's spec cannot be found, find the common spec in Tumblebug.

    10:50AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/provisioning.go:1675 > Use the common VMSpecName: Standard_B1s

Log level Warn and message will be updated later.