Skip to content

Got panic Error while trying to execute the command subctl gather #1684

@kanrenibm

Description

@kanrenibm

What happened:

This is in continuation to the issue https://github.com/submariner-io/submariner/issues/1601 , while trying to perform subctl gather got the following messages

oot@kantest-worker:~# subctl deploy-broker --kubeconfig broker_config
 ✓ Setting up broker RBAC
⢆⡱ Deploying the Submariner operator 
=========
root@kantest-worker:~# subctl gather
Cluster "kind-broker"
Gathering information from cluster "kind-broker"
 ⚠ Gathering connectivity logs
 ⚠ The Submariner connectivity components are not installed
 ⚠ Gathering connectivity resources
 ⚠ The Submariner connectivity components are not installed
 ⚠ Gathering service-discovery logs
 ⚠ The Submariner service discovery components are not installed
 ⚠ Gathering service-discovery resources
 ⚠ The Submariner service discovery components are not installed
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.outputPreviousPodLog(0xc000680800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/logs.go:145 +0x599
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.outputPodLogs(0xc000680800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/logs.go:68 +0x12e
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.gatherPodLogsByContainer.func1(0xc00028a900, 0xc0007ed220, 0x293e990, 0xc000522840, 0x28d3e00, 0xc000186b60, 0x0, 0x0, 0xc000044bf0, 0xb, ...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/logs.go:52 +0x298
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.gatherPodLogsByContainer(0x253fd7b, 0x18, 0x0, 0x0, 0xc00028a900, 0xc0007ed220, 0x293e990, 0xc000522840, 0x28d3e00, 0xc000186b60, ...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/logs.go:55 +0x92
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.gatherPodLogs(...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/logs.go:35
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.gatherSubmarinerOperatorPodLogs(...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/operator.go:74
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.gatherOperator(0x251f634, 0x4, 0xc00028a900, 0xc0007ed220, 0x293e990, 0xc000522840, 0x28d3e00, 0xc000186b60, 0x0, 0x0, ...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/gather.go:291 +0xd8
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.gatherDataByCluster(0xc00050cfa0, 0xc0004363e0, 0x19)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/gather.go:175 +0x5d5
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.gatherData(0xc00050cfa0, 0xc000044bf0)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/gather.go:119 +0xf3
github.com/submariner-io/submariner-operator/pkg/subctl/cmd.ExecuteMultiCluster(0x262a5f8)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/execute.go:103 +0x1a7
github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather.glob..func1(0x389d640, 0x38fa318, 0x0, 0x0)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/gather/gather.go:100 +0x2d
github.com/spf13/cobra.(*Command).execute(0x389d640, 0x38fa318, 0x0, 0x0, 0x389d640, 0x38fa318)
        github.com/spf13/cobra@v1.2.0/command.go:863 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x389cbc0, 0x38cb7c0, 0x0, 0xc000066778)
        github.com/spf13/cobra@v1.2.0/command.go:977 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.2.0/command.go:905
github.com/submariner-io/submariner-operator/pkg/subctl/cmd.Execute(...)
        github.com/submariner-io/submariner-operator/pkg/subctl/cmd/root.go:59
main.main()
        command-line-arguments/main.go:32 +0x32
root@kantest-worker:~# 
``

**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:

**Anything else we need to know?**:

**Environment**:
same as submariner-io/submariner-operator#1683 
- Diagnose information (use `subctl diagnose all`):
- Gather information (use `subctl gather`):
- Cloud provider or hardware configuration:
- Install tools:
- Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions