Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test run fails with panic: runtime error: invalid memory address or nil pointer dereference with an wrong Tracing Backend #3855

Open
danielbdias opened this issue May 16, 2024 · 0 comments
Labels
bug Something isn't working triage requires triage

Comments

@danielbdias
Copy link
Contributor

danielbdias commented May 16, 2024

Describe the bug

I'm running the example located on https://github.com/kubeshop/tracetest/tree/main/examples/datadog-propagation with:

cd examples/datadog-propagation
TRACETEST_API_KEY=my-api-key docker compose -f ./docker-compose.step4.yaml up -d

With a tracing backend set by mistake to a tempo backend with address tempo:9095.

Next, I'm creating a test like this as ./tracebased-tests/otel_sdk_instrumented_api_to_datadog_instrumented_api.yaml:

type: Test
spec:
  id: CdhJp_xIR
  name: OTelSDK-instrumented API to Datadog-instrumented API
  trigger:
    type: http
    httpRequest:
      method: GET
      url: http://api-otel:8080/remotehello
      headers:
      - key: Content-Type
        value: application/json

When I run the following command:

tracetest run test -f ./tracebased-tests/otel_sdk_instrumented_api_to_datadog_instrumented_api.yaml

I'm receiving the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x162aeec]

goroutine 1 [running]:
github.com/kubeshop/tracetest/cli/formatters.testRun.pretty({_, _, _}, {0x1, 0x1, {0xc000ac0aa0, 0xc000ac0ac0, 0x0, 0xc000620090, 0xc00011bf68, ...}, ...})
        /home/runner/work/tracetest/tracetest/cli/formatters/test_run.go:90 +0x32c
github.com/kubeshop/tracetest/cli/formatters.testRun.Format({_, _, _}, {0x1, 0x1, {0xc000ac0aa0, 0xc000ac0ac0, 0x0, 0xc000620090, 0xc00011bf68, ...}, ...}, ...)
        /home/runner/work/tracetest/tracetest/cli/formatters/test_run.go:59 +0x138
github.com/kubeshop/tracetest/cli/runner.testRunner.FormatResult({{0x42ad280, {0x2af0c02, 0x4}, {0x2af408b, 0x5}, 0xc0008927e0, {0xc000010480, 0x0, {{...}, 0x2bec380}, ...}}, ...}, ...)
        /home/runner/work/tracetest/tracetest/cli/runner/test_runner.go:147 +0x405
github.com/kubeshop/tracetest/cli/formatters.multipleRun[...].pretty(0x3036940?, {{0xc0006f3f80, 0x1, 0x1}, {0xc000901e50, 0x1, 0x1}, 0x1, {{0xc000620d40, 0x9}, ...}, ...})
        /home/runner/work/tracetest/tracetest/cli/formatters/multiple_runs.go:103 +0x7e2
github.com/kubeshop/tracetest/cli/formatters.multipleRun[...].Format(0x3036940?, {{0xc0006f3f80, 0x1, 0x1}, {0xc000901e50, 0x1, 0x1}, 0x1, {{0xc000620d40, 0x9}, ...}, ...}, ...)
        /home/runner/work/tracetest/tracetest/cli/formatters/multiple_runs.go:43 +0x125
github.com/kubeshop/tracetest/cli/cloud/runner.orchestrator.Run({0xc00091ccb0, {0x3018de0, 0xc0009006e0}, {0x42ad280, {0x2b1139a, 0xb}, {0x2b15a16, 0xc}, 0xc00091cd90, {0xc00011ae88, ...}}, ...}, ...)
        /home/runner/work/tracetest/tracetest/cli/cloud/runner/multifile_orchestrator.go:202 +0x12e8
github.com/kubeshop/tracetest/cli/cloud/cmd.RunMultipleFiles({0x302abd8, 0x42df4a0}, 0x0?, 0x42adae0, 0x42ae380, {0xc0008733e0?, 0xc000873410?, 0xc000892930?}, {0x0, 0x0})
        /home/runner/work/tracetest/tracetest/cli/cloud/cmd/run_cmd.go:35 +0x4fb
github.com/kubeshop/tracetest/cli/cmd.init.11.func1({0x302abd8?, 0x42df4a0?}, 0xc0008a2450?, {0x0?, 0x0?, 0x0?})
        /home/runner/work/tracetest/tracetest/cli/cmd/resource_run_cmd.go:32 +0xb2
github.com/kubeshop/tracetest/cli/cmd.WithResourceMiddleware.WithResourceMiddleware.WithParamsHandler.func1.func2({0x302abd8, 0x42df4a0}, 0x0?, {0xc0008a2450, 0x1, 0x3})
        /home/runner/work/tracetest/tracetest/cli/cmd/middleware.go:138 +0x1ce
github.com/kubeshop/tracetest/cli/cmd.WithResourceMiddleware.WithResultHandler.func3(0xc0007cb800?, {0xc0008a2450, 0x1, 0x3})
        /home/runner/work/tracetest/tracetest/cli/cmd/middleware.go:50 +0x6c
github.com/spf13/cobra.(*Command).execute(0xc0001f7800, {0xc0008a23f0, 0x3, 0x3})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:944 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x429b0a0)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:992
github.com/kubeshop/tracetest/cli/cmd.Execute()
        /home/runner/work/tracetest/tracetest/cli/cmd/root.go:34 +0x1a
main.main()

My OS is a MacOS Ventura 13.6.6 and the Tracetest CLI is v1.0.0

@danielbdias danielbdias added bug Something isn't working triage requires triage labels May 16, 2024
@danielbdias danielbdias changed the title Test run fails with panic: runtime error: invalid memory address or nil pointer dereference Test run fails with panic: runtime error: invalid memory address or nil pointer dereference with an wrong Tracing Backend May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage requires triage
Projects
None yet
Development

No branches or pull requests

1 participant