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

Unable to filter traffic based on container ID and pod name. #192

Open
liuhaibin0528 opened this issue Dec 19, 2024 · 4 comments
Open

Unable to filter traffic based on container ID and pod name. #192

liuhaibin0528 opened this issue Dec 19, 2024 · 4 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@liuhaibin0528
Copy link

Describe the bug
使用kyanos 对容器id和pod名称进行watch时,无法正常执行,提示没有该容器id和pod名称

To Reproduce
使用最新版本的即可重新

Expected behavior
正常对容器id和pod进行watch抓取流量

Screenshots
watch-pod
watch-container

Information (please complete the following information):

  • OS: openEuler 22.03 LTS
    内核:5.10.0-60.139.0.166.oe2203.aarch64
@dosubot dosubot bot added the bug Something isn't working label Dec 19, 2024
Copy link

dosubot bot commented Dec 19, 2024

@liuhaibin0528 你好!我是Dosu 🤖

When Kyanos fails to find a specified container or pod, it typically generates error messages such as "can not find any running container by id %s" or "can not find any running pod by name %s in namespace %s" [1][2]. Common causes for these errors include:

  1. Incorrect Container ID or Pod Name: Ensure that the container ID or pod name you are using matches exactly with the running instances. Even a small typo can cause Kyanos to fail in identifying the correct resource.

  2. Namespace Mismatch: Verify that the namespace specified in your command matches the namespace where the pod is running. In Kubernetes, pods are often organized into different namespaces, and specifying the wrong one will lead to errors.

  3. Multiple Containers with the Same Name: If there are multiple containers with the same name, Kyanos might not be able to identify the correct one. Ensure that the container name is unique or use the container ID for more precise identification.

  4. CRI Endpoint Issues: Kyanos interacts with container runtimes via CRI endpoints. Ensure that the CRI endpoints are correctly configured and accessible. If there are issues with these endpoints, Kyanos might not be able to retrieve the necessary information.

Given that you are using openEuler 22.03 LTS, ensure that there are no compatibility issues with the kernel version you are using, although no specific issues have been documented [3]. Additionally, make sure that Kyanos is running with the necessary privileges, especially if it is being executed within a container or Kubernetes pod [3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@hengyoush
Copy link
Owner

hengyoush commented Dec 19, 2024

Are there any logs similar to kyanos_xxx.log under the /tmp path? If so, please provide them. @liuhaibin0528

@liuhaibin0528
Copy link
Author

liuhaibin0528 commented Dec 19, 2024

kyanos.log content:
image

only exec watch container printing

@hengyoush hengyoush self-assigned this Dec 19, 2024
@hengyoush hengyoush added this to v1.5.0 Dec 19, 2024
@hengyoush hengyoush moved this to Todo in v1.5.0 Dec 19, 2024
@hengyoush hengyoush added the question Further information is requested label Dec 19, 2024
@hengyoush hengyoush moved this from Todo to In Progress in v1.5.0 Dec 19, 2024
@hengyoush hengyoush changed the title 无法正常watch容器id和pod Unable to filter traffic based on container ID and pod name. Dec 20, 2024
@hengyoush
Copy link
Owner

hengyoush commented Dec 21, 2024

@liuhaibin0528
There two problems here:

  1. You execute kubectl get pods -n devops, then use kyanos to filter traffic by the pod name ***-agent-***, after that kyanos tell you that the pod with the name can't be found.

The reason is that you must ensure the machine running Kyanos is on the same host as the specified pod.

  1. The second issue is that filtering by container-id is not working.

Currently, Kyanos supports filtering by either the full untruncated container-id or the 12-character short id. The container-id you're using is actually a 13-character id truncated by crictl, so Kyanos fails to filter. Before we fix this(#204, #205 ), you can use the first 12 characters for filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Status: In Progress
Development

No branches or pull requests

2 participants