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

rpk: attempt to print out Redpanda node's stderr on failure to start #13024

Closed
wants to merge 1 commit into from

Conversation

voutilad
Copy link
Contributor

A working example of addressing #13023. It's not covering all possible failure paths and is really for an example of what I'm talking about in the issue.

$ ./linux-arm64/rpk container start
Waiting for the cluster to be ready...

Error: unable to dial: dial tcp 127.0.0.1:38135: connect: connection refused
Errors reported from the Docker container:
+ '[' '' = true ']'
+ exec /usr/bin/rpk redpanda start --node-id 0 --kafka-addr internal://0.0.0.0:9092,external://172.24.1.2:9093 --pandaproxy-addr internal://0.0.0.0:8082,external://172.24.1.2:35717 --schema-registry-addr 172.24.1.2:8081 --rpc-addr 172.24.1.2:33145 --advertise-kafka-addr internal://172.24.1.2:9092,external://127.0.0.1:38135 --advertise-pandaproxy-addr internal://172.24.1.2:8082,external://127.0.0.1:35717 --advertise-rpc-addr 172.24.1.2:33145 --mode dev-container
WARNING: This is a setup for development purposes only; in this mode your clusters may run unrealistically fast and data can be corrupted any time your computer shuts down uncleanly.
<libc++abi: terminating due to uncaught exception of type std::runtime_error: Could not setup Async I/O: Resource temporarily unavailable. The most common cause is not enough request capacity in /proc/sys/fs/aio-max-nr. Try increasing that number or reducing the amount of logical CPUs available for your application

Usage:
  rpk container start [flags]

Flags:
  -h, --help           Help for start
      --image string   An arbitrary container image to use (default "vectorized/redpanda:latest")
  -n, --nodes uint     The number of nodes to start (default 1)
      --pull           Force pull the container image used
      --retries uint   The amount of times to check for the cluster before considering it unstable and exiting (default 10)

Global Flags:
      --config string            Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD, and /etc/redpanda/redpanda.yaml
  -X, --config-opt stringArray   Override rpk configuration settings; '-X help' for detail or '-X list' for terser detail
      --profile string           rpk profile to use
  -v, --verbose                  Enable verbose logging

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.2.x
  • v23.1.x
  • v22.3.x

Release Notes

  • None

Copy link
Contributor

@r-vasquez r-vasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @voutilad , why is this a Draft? this seems awesome and helps with the debugging experience. Thanks!

(Just 2 small comments/nits, otherwise, LGTM)


json, errInspect := c.ContainerInspect(ctx, state.ContainerID)
if errInspect != nil {
return nil, fmt.Errorf("%v\n%v", err, errInspect)
Copy link
Contributor

@r-vasquez r-vasquez Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt of a similar chained error like in L369

Suggested change
return nil, fmt.Errorf("%v\n%v", err, errInspect)
return nil, fmt.Errorf("%v\nCould not inspect container: %v", err, errInspect)

}

scanner := bufio.NewScanner(reader)
errStr := ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Just to keep with rest of the codebase

Suggested change
errStr := ""
var errStr string

@r-vasquez
Copy link
Contributor

Hi @voutilad, as we talked, this can be closed in favor of #17780. I cherry-picked your commit and finished the PR there. Thanks a lot!

@voutilad voutilad closed this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants