-
Notifications
You must be signed in to change notification settings - Fork 742
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
Log to standard output result in garbage character in add function #1248
Comments
Thanks for opening the issue @ozaditya . Looking into it. |
We did a initial code walk through, pending root cause. Currently we are seeing the below log in kubelet -
Error is at Call trace-
[1] https://github.com/containernetworking/cni/blob/2d4bc3d57aae747b6d68df7c3631bc9c120dfcde/libcni/api.go#L429 Need to add more tracing and check around this and
Also based on the spec - https://github.com/containernetworking/cni/blob/master/SPEC.md#result recommendation is to use "stderr can be used for unstructured output such as logs". Verified "stderr" instead of "stdout" and issue is not seen. For completeness, Call trace from CNI -
|
I did some further testing last night to see if it is possible set As @jayanthvn mentioned above, we use That said, I am trying to understand the use-case here. CNI plugin is a binary on the host which is invoked by kubelet whenever we want to add/del a pod. If we are writing PLUGIN logs to IMO, we should make a change to documentation stating that we do not support WDYT, @jayanthvn @SaranBalaji90 |
This bug hit me and has been confusing me all week. I didn't believe in the Quantum Observer Effect until today! I do think that having the debug logs to to stdout would be a massively useful feature though if it could be made to work. |
@wtistio Thanks, will explore the options to see if it is doable for CNI plugin. |
#1251 is merged and planning to release part of 1.7.6 release. Closing this issue for now. |
What happened:
After setting environment variable AWS_VPC_K8S_PLUGIN_LOG_FILE to stdout and deploying CNI version 1.7.3.
I have observed that CFN fails to add ip to pods.
Logs from CNI:
Send AddNetworkReply: IPv4Addr 10.1.161.151, DeviceNumber: 0, err: \u003cnil\u003e"}
Received DelNetwork for Sandbox 4da84e08dd17a4e2cceacbf31d04801575cfab2e19fae462a17c95921b422ee5"}
DelNetworkRequest: ClientVersion:\"v1.7.3\" K8S_POD_NAME:\"datadog-agent-wt4hd\" K8S_POD_NAMESPACE:\"datadog\" K8S_POD_INFRA_CONTAINER_ID:\"4da84e08dd17a4e2cceacbf31d04801575cfab2e19fae462a17c95921b422ee5\" Reason:\"PodDeleted\" ContainerID:\"4da84e08dd17a4e2cceacbf31d04801575cfab2e19fae462a17c95921b422ee5\"
Logs from kubelet:
Error adding datadog_datadog-agent-wt4hd/4da84e08dd17a4e2cceacbf31d04801575cfab2e19fae462a17c95921b422ee5 to network aws-cni/aws-cni: invalid character '{' after top-level value
RunPodSandbox from runtime service failed: rpc error: code = Unknown desc = failed to set up sandbox container "4da84e08dd17a4e2cceacbf31d04801575cfab2e19fae462a17c95921b422ee5" network for pod "datadog-agent-wt4hd": NetworkPlugin cni failed to set up pod "datadog-agent-wt4hd_datadog" network: invalid character '{' after top-level value
What you expected to happen:
Since its documented in Read Me that CNI log can be sent on stdout. I expect CNI to function properly.
snippet:
AWS_VPC_K8S_CNI_LOG_FILE
Type: String
Default: /host/var/log/aws-routed-eni/ipamd.log
Valid Values: stdout or a file path
Specifies where to write the logging output of ipamd. Either to stdout or to override the default file (i.e., /var/log/aws-routed-eni/ipamd.log).
How to reproduce it (as minimally and precisely as possible):
Set above environment variable to stdout or simply change cni config file present at path “/etc/cni/net.d” with name “10-aws.conflist” to below.
{
"cniVersion": "0.3.1",
"name": "aws-cni",
"plugins": [
{
"name": "aws-cni",
"type": "aws-cni",
"vethPrefix": "eni",
"mtu": "9001",
"pluginLogFile": "stdout",
"pluginLogLevel": "Debug"
},
{
"type": "portmap",
"capabilities": {"portMappings": true},
"snat": true
}
]
}
Anything else we need to know?:
I believe error was generated by add function.
amazon-vpc-cni-k8s/pkg/ipamd/rpc_handler.go
Line 159 in e2e1900
I believe it trace back to project https://github.com/containernetworking/cni/
Environment:
kubectl version
): Currrently tested on version 1.15cat /etc/os-release
): Amazon linux 2uname -a
): Linux ip-172-31-45-225.ec2.internal 4.14.171-136.231.amzn2.x86_64 Initial commit of amazon-vpc-cni-k8s #1 SMP Thu Feb 27 20:22:48 UTC 2020 x86_64 x86_64 x86_64 GNU/LinuxThe text was updated successfully, but these errors were encountered: