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

err:hcnCreateNetwork failed in Win32: Invalid JSON document string #69

Open
keyingliu opened this issue May 27, 2022 · 2 comments
Open

Comments

@keyingliu
Copy link

We trying to run windows containers, but the kubernetes pod cannot be up during network setup. The CNI congiurations are:

{
    "cniVersion": "0.2.0",
    "name": "nat",
    "type": "nat",
    "master": "Ethernet",
    "ipam": {
        "subnet": "10.172.204.0/8",
        "routes": [
            {
                "GW": "10.172.204.178"
            }
        ]
    },
    "capabilities": {
        "portMappings": true,
        "dns": true
    }
}

The output from wincni.log

{"level":"debug","msg":"[cni-net] Plugin wcn-net version .","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"[net] Network interface: {Index:14 MTU:1500 Name:Ethernet HardwareAddr:54:bf:64:98:1d:c6 Flags:up|broadcast|multicast} with IP addresses: [2404:f801:10:124:883:4be4:12ff:53d4/64 fe80::883:4be4:12ff:53d4/64 10.172.204.178/24]","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"[net] Network interface: {Index:1 MTU:-1 Name:Loopback Pseudo-Interface 1 HardwareAddr: Flags:up|loopback|multicast} with IP addresses: [::1/128 127.0.0.1/8]","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"[net] Network interface: {Index:21 MTU:1500 Name:vEthernet (nat) HardwareAddr:00:15:5d:5f:9a:47 Flags:up|broadcast|multicast} with IP addresses: [fe80::c1ed:f301:c00e:2af6/64 172.27.0.1/20]","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"[cni-net] Plugin started.","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"[cni-net] Processing ADD command with args {ContainerID:dcc9786445818f4a843162bfaf0c164d4617ece21ddc692c6ffb554462bafac6 Netns:a19ed0b3-b149-4fd2-9457-66815769ad99 IfName:eth0 Args:K8S_POD_INFRA_CONTAINER_ID=dcc9786445818f4a843162bfaf0c164d4617ece21ddc692c6ffb554462bafac6;K8S_POD_UID=f3c02187-8def-4311-9b2c-13fd75b5440f;IgnoreUnknown=1;K8S_POD_NAMESPACE=kube-system;K8S_POD_NAME=kube-flannel-ds-windows-amd64-tbvjd Path:c:/opt/cni/bin}.","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"[cni-net] Read network configuration \u0026{CniVersion:0.2.0 Name:nat Type:nat Ipam:{Type: Environment: AddrSpace: Subnet:10.172.204.0/8 Address: QueryInterval: Routes:[{Dst:{IP:\u003cnil\u003e Mask:\u003cnil\u003e} GW:10.172.204.178}]} DNS:{Nameservers:[] Domain: Search:[] Options:[]} OptionalFlags:{LocalRoutePortMapping:false AllowAclPortMapping:false ForceBridgeGateway:false EnableDualStack:false LoopbackDSR:false GatewayFromAdditionalRoutes:false} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalRoutes:[] AdditionalArgs:[]}.","time":"2022-05-26T06:44:29-07:00"}
{"level":"info","msg":"[cni-net] Dual stack is disabled","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"Parsing port mappings from []","time":"2022-05-26T06:44:29-07:00"}
{"level":"info","msg":"[cni-net] Creating network.","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"hcn::HostComputeNetwork::Create id=","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"hcn::HostComputeNetwork::Create JSON: {\"Name\":\"nat\",\"Type\":\"nat\",\"MacPool\":{},\"Dns\":{},\"Ipams\":[{\"Type\":\"Static\",\"Subnets\":[{\"IpAddressPrefix\":\"10.0.0.0/8\",\"Routes\":[{\"NextHop\":\"10.172.204.178\",\"DestinationPrefix\":\"0.0.0.0/0\"}]}]}],\"SchemaVersion\":{\"Major\":2,\"Minor\":0}}","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"hcnCreateNetwork failed in Win32: Invalid JSON document string. (0x803b001b) {\"Success\":false,\"Error\":\"Invalid JSON document string. \",\"ErrorCode\":2151350299}","time":"2022-05-26T06:44:29-07:00"}
{"level":"error","msg":"[cni-net] Failed to create network, err:hcnCreateNetwork failed in Win32: Invalid JSON document string. (0x803b001b) {\"Success\":false,\"Error\":\"Invalid JSON document string. \",\"ErrorCode\":2151350299}.","time":"2022-05-26T06:44:29-07:00"}
{"level":"debug","msg":"[cni-net] Plugin stopped.","time":"2022-05-26T06:44:29-07:00"}
{"level":"error","msg":"Failed to Execute network plugin, err:hcnCreateNetwork failed in Win32: Invalid JSON document string. (0x803b001b) {\"Success\":false,\"Error\":\"Invalid JSON document string. \",\"ErrorCode\":2151350299}.\n","time":"2022-05-26T06:44:29-07:00"}
-26T06:33:55-07:00"}

Windows Edition: Windows Server 2019 Datacenter

@MikeZappa87
Copy link
Contributor

MikeZappa87 commented May 31, 2022

Hello, it looks like the example for nat is incorrect. Please disregard my previous.

@keyingliu
Copy link
Author

More details: we are following the guide https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/, and windows node has joined the cluster and became ready, container runtime is containerd latest stable version, we saw the errors when this yaml was applied: kubectl apply -f https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/flannel-overlay.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants