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

intercept with --local-only and --docker-run crashes #3171

Closed
mleclercq opened this issue May 9, 2023 · 0 comments · Fixed by #3181
Closed

intercept with --local-only and --docker-run crashes #3171

mleclercq opened this issue May 9, 2023 · 0 comments · Fixed by #3181
Assignees

Comments

@mleclercq
Copy link

mleclercq commented May 9, 2023

Describe the bug

When running an intercept with --local-only and --docker-run telepresence crashes with the following error:

telepresence intercept my-deployment --local-only --docker-run -- alpine:latest
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x101774fd2]

goroutine 1 [running]:
github.com/telepresenceio/telepresence/v2/pkg/client/cli/intercept.(*state).startInDocker(0xc000206050, {0x1027a2ac8, 0xc000a58b70}, {0xc0001a1510, 0xd}, {0xc00005e140, 0x43}, {0xc0005a59f0, 0x1, 0x8})
        github.com/telepresenceio/telepresence/v2@v2.13.1/pkg/client/cli/intercept/docker_run.go:200 +0x952
github.com/telepresenceio/telepresence/v2/pkg/client/cli/intercept.runCommand({0x1027a8438, 0xc00037c030}, {0x1027a2ac8, 0xc00056d230})
        github.com/telepresenceio/telepresence/v2@v2.13.1/pkg/client/cli/intercept/state.go:387 +0x497
github.com/telepresenceio/telepresence/v2/pkg/client.WithEnsuredState[...]({0x1027a2ac8, 0xc00056d230}, {0x1027a8438, 0xc00037c030}, 0x10001bb53, 0x10251b7f0?, 0x10251b7e0)
        github.com/telepresenceio/telepresence/v2@v2.13.1/pkg/client/ensured_state.go:39 +0x1b9
github.com/telepresenceio/telepresence/v2/pkg/client/cli/intercept.Run({0x1027a2ac8, 0xc00056d230}, {0x1027a8438?, 0xc00037c030?})
        github.com/telepresenceio/telepresence/v2@v2.13.1/pkg/client/cli/intercept/state.go:202 +0x170
github.com/datawire/telepresence-pro/pkg/client/cli/intercept.Run({0x1027a2ac8, 0xc00056d230}, {0x1027a8438?, 0xc00037c030?}, {0xc00032ac00, 0x24})
        github.com/datawire/telepresence-pro/pkg/client/cli/intercept/state.go:51 +0xbc
github.com/datawire/telepresence-pro/pkg/client/cli/intercept.(*Command).Run(0xc000384d80, 0xc000a0a900, {0xc0005a59e0, 0x2, 0x9})
        github.com/datawire/telepresence-pro/pkg/client/cli/intercept/intercept.go:238 +0x41e
github.com/spf13/cobra.(*Command).execute(0xc000a0a900, {0xc0005a5950, 0x9, 0x9})
        github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000a0bb00)
        github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/telepresenceio/telepresence/v2/pkg/client/cli/output.Execute(0x1027a2ac8?)
        github.com/telepresenceio/telepresence/v2@v2.13.1/pkg/client/cli/output/output.go:114 +0x3d
github.com/telepresenceio/telepresence/v2/pkg/client/cli.Main({0x1027a2ac8, 0xc0009e1020})
        github.com/telepresenceio/telepresence/v2@v2.13.1/pkg/client/cli/main.go:68 +0x30f
main.main()
        github.com/datawire/telepresence-pro/cmd/telepresence/main.go:11 +0x2c

To Reproduce
Steps to reproduce the behavior:

  1. Run telepresence intercept my-deployment --local-only --docker-run -- alpine:latest
  2. telepresence crash

Versions (please complete the following information):

> telepresence version         
Client             : v2.13.1
Daemon in container: v2.13.1
Traffic Manager    : v2.13.1

Running on MacOS Monterey and GKE

Additional context

Looking at the code it seems to be failing at:

I think s.info is null when --local-only flag is set because of the early return at

if s.AgentName == "" {
// local-only
return true, nil

Note: I've tried to add --mount false since the code is crashing when trying to create the mounts but this doesn't work either as I get this error instead

telepresence intercept: error: a local-only intercept cannot have mounts

Which is a bit misleading since I'm actually saying I don't want mounts.

@thallgren thallgren self-assigned this May 14, 2023
thallgren added a commit that referenced this issue May 14, 2023
Also fixes an incorrect message when using `--local-only` with
`--mount false`.

Closes #3171

Signed-off-by: Thomas Hallgren <thomas@datawire.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants