aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.04k stars 323 forks source link

Panic in websocketchannel.go.174 #408

Open gounselor opened 2 years ago

gounselor commented 2 years ago

SSM Agent version: 3.0.529.0

2021-10-01 09:22:11 ERROR [1 @ websocketchannel.go.174] [ssm-session-worker] [chef-cli-0c6130e6132a14d46] [DataBackend] [pluginName=Port] WebsocketChannel listener run panic: runtime error: invalid memory address or nil pointer dereference 2021-10-01 09:22:11 ERROR [1 @ websocketchannel.go.174] [ssm-session-worker] [chef-cli-0c6130e6132a14d46] [DataBackend] [pluginName=Port] runtime error: invalid memory address or nil pointer dereference: goroutine 69 [running]: runtime/debug.Stack(0xc000032a20, 0xc000344b80, 0x79) runtime/debug/stack.go:24 +0x9f github.com/aws/amazon-ssm-agent/agent/session/communicator.(WebSocketChannel).Open.func1.1(0x5581d5302660, 0xc000032a20) github.com/aws/amazon-ssm-agent/agent/session/communicator/websocketchannel.go:174 +0xcc panic(0x5581d5113b20, 0x5581d5a60590) runtime/panic.go:679 +0x1b6 github.com/aws/amazon-ssm-agent/agent/session/plugins/port.(BasicPortSession).HandleStreamMessage(0xc000081860, 0x5581d5302660, 0xc000032a20, 0x74, 0xc000505a20, 0x11, 0x1, 0x17c3b2942c9, 0x1, 0x0, ...) github.com/aws/amazon-ssm-agent/agent/session/plugins/port/port_basic.go:79 +0x3b2 github.com/aws/amazon-ssm-agent/agent/session/plugins/port.(PortPlugin).InputStreamMessageHandler(0xc000032a50, 0x5581d5302660, 0xc000032a20, 0x74, 0xc000505a20, 0x11, 0x1, 0x17c3b2942c9, 0x1, 0x0, ...) github.com/aws/amazon-ssm-agent/agent/session/plugins/port/port.go:206 +0x8a github.com/aws/amazon-ssm-agent/agent/session/datachannel.(DataChannel).processStreamDataMessage(0xc000090900, 0x5581d5302660, 0xc000032a20, 0x74, 0xc000505a20, 0x11, 0x1, 0x17c3b2942c9, 0x1, 0x0, ...) github.com/aws/amazon-ssm-agent/agent/session/datachannel/datachannel.go:804 +0xbb github.com/aws/amazon-ssm-agent/agent/session/datachannel.(DataChannel).handleStreamDataMessage(0xc000090900, 0x5581d5302660, 0xc000032a20, 0x74, 0xc000505a20, 0x11, 0x1, 0x17c3b2942c9, 0x1, 0x0, ...) github.com/aws/amazon-ssm-agent/agent/session/datachannel/datachannel.go:666 +0x614 github.com/aws/amazon-ssm-agent/agent/session/datachannel.(DataChannel).dataChannelIncomingMessageHandler(0xc000090900, 0x5581d5302660, 0xc000032a20, 0xc000391800, 0xa4, 0x600, 0xc000391800, 0xa4) github.com/aws/amazon-ssm-agent/agent/session/datachannel/datachannel.go:605 +0x9c4 github.com/aws/amazon-ssm-agent/agent/session/datachannel.NewDataChannel.func1(0xc000391800, 0xa4, 0x600) github.com/aws/amazon-ssm-agent/agent/session/datachannel/datachannel.go:205 +0x6d github.com/aws/amazon-ssm-agent/agent/session/communicator.(WebSocketChannel).Open.func1(0x5581d5302660, 0xc000032a20, 0xc0002d8000) github.com/aws/amazon-ssm-agent/agent/session/communicator/websocketchannel.go:207 +0x3d2 created by github.com/aws/amazon-ssm-agent/agent/session/communicator.(WebSocketChannel).Open github.com/aws/amazon-ssm-agent/agent/session/communicator/websocketchannel.go:169 +0x203

YujiaozhAws commented 2 years ago

Thanks for reaching out! Could you please provide below information to investigate this issue further?

  1. Are you using Session Manager port forwarding feature? Please explain your use case.
  2. Above error is the only issue or are you not able to successfully use Session Manager?
  3. Provide few more lines of logs preceding to above error log.
  4. Are you seeing the same error with the latest SSM Agent?
  5. If possible, provide the reproduce steps for this issue.
Palak-1202 commented 11 months ago

@YujiaozhAws Was the issue resolved. I am also facing the same error with SSM port forward