retina icon indicating copy to clipboard operation
retina copied to clipboard

fix: the ebpf program in the tcpretrans plugin failed to load

Open wenhuwang opened this issue 1 year ago • 4 comments

Description

Fix the issues of abnormal status of retina-agent caused by opening tcpretrans plugin. The retina-agent nil pointer is because the Tracer.socketEnricherMap field of the tcpretrans plugin is nil.

Related Issue

#311

Checklist

  • [x] I have read the contributing documentation.
  • [x] I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • [x] I have correctly attributed the author(s) of the code.
  • [x] I have tested the changes locally.
  • [ ] I have followed the project's style guidelines.
  • [ ] I have updated the documentation, if necessary.
  • [ ] I have added tests, if applicable.

Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

wenhuwang avatar Apr 28 '24 09:04 wenhuwang

@wenhuwang this doesn't seem to fully resolve the problem. Instead of a nil pointer, now there is an error instantiating the socketEnricher:

failed to reconcile plugin tcpretrans: failed to new socketEnricher: read BPF iterator: checking if current pid namespace is host pid namespace: host.Init() must be called before calling isHostNamespace()

rbtr avatar May 01 '24 21:05 rbtr

@wenhuwang this doesn't seem to fully resolve the problem. Instead of a nil pointer, now there is an error instantiating the socketEnricher:

failed to reconcile plugin tcpretrans: failed to new socketEnricher: read BPF iterator: checking if current pid namespace is host pid namespace: host.Init() must be called before calling isHostNamespace()

@rbtr Sorry for the late reply, I'm on vacation recently. I have tested it locally before. I will verify this problem in a few days.

wenhuwang avatar May 04 '24 09:05 wenhuwang

I have not reproduced this problem and retina-agent status is normal in local environment .

failed to reconcile plugin tcpretrans: failed to new socketEnricher: read BPF iterator: checking if current pid namespace is host pid namespace: host.Init() must be called before calling isHostNamespace()

platform: OS: Ubuntu 18.04.5 LTS Kubernetes Version: 1.22.2 Host: self-host Kernel Version: 5.10.87-051087-generic Retina Version: v0.0.8

Do you have any specific steps to reproduce the problem? @rbtr

wenhuwang avatar May 08 '24 13:05 wenhuwang

Thanks for the change. Can you add details as to how you verified this change?

  1. Before adding this change, the retina-agent would panic because of the nil pointer.
  2. After adding this change, retina-agent runs normally and can get tcpretrans plugin metrics.
  3. When troubleshooting the following problem through the logs, I can only see the "Initialized tcpretrans plugin" log but not the "failed to new socketEnricher" related logs.

failed to reconcile plugin tcpretrans: failed to new socketEnricher: read BPF iterator: checking if current pid namespace is host pid namespace: host.Init() must be called before calling isHostNamespace()

wenhuwang avatar May 11 '24 04:05 wenhuwang