-
Notifications
You must be signed in to change notification settings - Fork 185
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
socketenricher: Print warning rather than error when problem with kal… #2270
Conversation
98aee2d
to
d507172
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
1 suggested comment, LGTM after that.
@@ -74,7 +74,7 @@ func (se *SocketEnricher) start() error { | |||
|
|||
err = kallsyms.SpecUpdateAddresses(specIter, []string{"socket_file_ops"}) | |||
if err != nil { | |||
return fmt.Errorf("updating socket_file_ops address with ksyms: %w", err) | |||
log.Warnf("updating socket_file_ops address with ksyms: %v\nThis may result in network related information missing. Possible cause can be lack access of /proc/kallsyms due to CAP_SYSLOG not being set.", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be due to a kernel that does not provide the symbol socket_file_ops
in /proc/kallsyms
because the constant is declared as static
.
That's a too long explanation to add in the log.Warnf
. But you can add a comment before.
…lsyms. Fixes: f088401 ("socketenricher: Catch SpecUpdateAddresses() error.") Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
d507172
to
681c370
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (once the CI is green)
For the record, here is the problem with $ ./kubectl-gadget trace dns -A
INFO[0000] Experimental features enabled
K8S.NODE K8S.NAMESPACE K8S.POD PID TID COMM QR TYPE QTYPE NAME RCODE NUM…
^Z
zsh: suspended ./kubectl-gadget trace dns -A
...
$ ../kubectl logs -n gadget gadget-dj428
...
time="2023-12-05T10:26:32Z" level=info msg="OS detected: Buildroot 2021.02.12"
time="2023-12-05T10:26:32Z" level=info msg="Kernel detected: 5.10.57"
time="2023-12-05T10:26:32Z" level=info msg="Gadget Image: ghcr.io/inspektor-gadget/inspektor-gadget:v0.23.0"
...
time="2023-12-05T10:26:32Z" level=info msg="Gadget Image: ghcr.io/inspektor-gadget/inspektor-gadget:v0.23.0" And with this commit, everything is OK: $ ./kubectl-gadget trace dns -A
INFO[0000] Experimental features enabled
K8S.NODE K8S.NAMESPACE K8S.POD PID TID COMM QR TYPE QTYPE NAME RCODE NUM…
^Z
zsh: suspended ./kubectl-gadget trace dns -A
$ ../kubectl logs -n gadget gadget-8wmhf
time="2023-12-05T10:34:45Z" level=info msg="OS detected: Buildroot 2021.02.12"
time="2023-12-05T10:34:45Z" level=info msg="Kernel detected: 5.10.57"
time="2023-12-05T10:34:45Z" level=info msg="Gadget Image: francis/gadget:francis-fix-kallsyms"
...
time="2023-12-05T10:34:51Z" level=warning msg="updating socket_file_ops address with ksyms: file does not exist\nEither you cannot access /proc/kallsyms or this file does not contain socket_file_ops"
...
$ bg
[1] + continued ./kubectl-gadget trace dns -A
$ ../kubectl run test-pod --image debian -- sleep inf francis/fix-kallsyms *% u=
pod/test-pod created
francis@pwmachine:~/Codes/kinvolk/inspektor-gadget$ minikube 919 1125 dockerd Q OUTGOING AAAA registry-1.dock… 0
minikube 919 1514 dockerd Q OUTGOING A registry-1.dock… 0
minikube 919 1125 dockerd R HOST AAAA registry-1.dock… NoError 3
minikube 919 1514 dockerd R HOST A registry-1.dock… NoError 3
minikube 919 1125 dockerd Q OUTGOING A auth.docker.io. 0 |
Issue #2268 |
…lsyms.
Fixes: f088401 ("socketenricher: Catch SpecUpdateAddresses() error.")