Uploaded image for project: 'Migration Toolkit for Applications'
  1. Migration Toolkit for Applications
  2. MTA-4951

[CLI] Analysis command fails with panic error when path to the rule file is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • MTA 7.3.0
    • MTA 7.2.2
    • MTA CLI
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • None

      Description of problem:

      Analysis command fails with terrible, not-friendly and not-informative `panic` error when path to the rule file is incorrect

      Version-Release number of selected component (if applicable):

      7.2.2-30

      How reproducible: 100%

      Steps to Reproduce:
      1. Run analysis command and specify incorrect (not-existing) path to a rule file

      Actual results:

      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xbbcf50]
      
      goroutine 1 [running]:
      github.com/konveyor-ecosystem/kantra/cmd.(*analyzeCommand).walkRuleFilesForLabelsContainerless.walkRuleSets.func2({0x7fff1ab2f443, 0x46}, {0x0?, 0x0?}, {0xf54e60, 0xc0005aa450})
              /remote-source/mta-cli/app/cmd/util.go:37 +0x30
      path/filepath.WalkDir({0x7fff1ab2f443, 0x46}, 0xc0005139a8)
              /usr/lib/golang/src/path/filepath/path.go:531 +0x9c
      github.com/konveyor-ecosystem/kantra/cmd.(*analyzeCommand).walkRuleFilesForLabelsContainerless(0xc000152c00, {0xdf6326, 0x12})
              /remote-source/mta-cli/app/cmd/analyze-bin.go:312 +0x29f
      github.com/konveyor-ecosystem/kantra/cmd.(*analyzeCommand).fetchLabelsContainerless(0xc000152c00, {0xc00022db60?, 0xc00022dae0?}, 0x5?, 0xc0?, {0xf54bc0, 0xc00028f860})
              /remote-source/mta-cli/app/cmd/analyze-bin.go:278 +0xef
      github.com/konveyor-ecosystem/kantra/cmd.(*analyzeCommand).Validate(0xc000152c00, {0xf5d9c0, 0xc00017d5e0})
              /remote-source/mta-cli/app/cmd/analyze.go:395 +0xf7
      github.com/konveyor-ecosystem/kantra/cmd.NewAnalyzeCmd.func1(0xc00018b508, {0xc0001e79e0?, 0x4?, 0xde8abe?})
              /remote-source/mta-cli/app/cmd/analyze.go:188 +0x1cc
      github.com/spf13/cobra.(*Command).execute(0xc00018b508, {0xc0001e7950, 0x9, 0x9})
              /remote-source/mta-cli/deps/gomod/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:970 +0xa44
      github.com/spf13/cobra.(*Command).ExecuteC(0x15a5ea0)
              /remote-source/mta-cli/deps/gomod/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
      github.com/spf13/cobra.(*Command).Execute(...)
              /remote-source/mta-cli/deps/gomod/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
      github.com/spf13/cobra.(*Command).ExecuteContext(...)
              /remote-source/mta-cli/deps/gomod/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1034
      github.com/konveyor-ecosystem/kantra/cmd.Execute()
              /remote-source/mta-cli/app/cmd/root.go:66 +0x10c
      main.main()
              /remote-source/mta-cli/app/main.go:8 +0xf
      

      Expected results:

      Informative message about what exactly is not OK with the analysis command

      Additional info:

              emcmulla@redhat.com Emily McMullan
              ibragins@redhat.com Igor Braginsky
              Igor Braginsky Igor Braginsky
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: