Git Product home page Git Product logo

Comments (5)

tamilmani1989 avatar tamilmani1989 commented on August 19, 2024

@kingliantop - can you please try the following commands in your setup and send me the output?

  1. "cat /etc/issue"
  2. "uname -r"

from azure-container-networking.

sharmasushant avatar sharmasushant commented on August 19, 2024

@kingliantop Can you please provide output as requested by @tamilmani1989 ?

from azure-container-networking.

IvanovOleg avatar IvanovOleg commented on August 19, 2024

I have the same issue on CoreOS, kubernetes 1.10.3

May 24 11:45:19 orion-stg-k8s-agentpool1-0 env[13385]: panic: runtime error: index out of range
May 24 11:45:19 hostname env[13385]: goroutine 1 [running]:
May 24 11:45:19 hostname env[13385]: github.com/Azure/azure-container-networking/telemetry.(*Report).GetOSDetails(0xc4200786e0)
May 24 11:45:19 hostname  env[13385]:         /go/src/github.com/Azure/azure-container-networking/telemetry/telemetry_linux.go:112 +0x55c
May 24 11:45:19 hostname  env[13385]: github.com/Azure/azure-container-networking/telemetry.(*ReportManager).GetReport(0xc420048300, 0x6ee1ba, 0x3, 0x711914, 0x6)
May 24 11:45:19 hostname  env[13385]:         /go/src/github.com/Azure/azure-container-networking/telemetry/telemetry.go:139 +0xa3
May 24 11:45:19 hostname  env[13385]: main.main()

no logs related to the azure-cni in /var/log

May 24 12:30:50 hostname kubelet[32015]: E0524 12:30:50.128638 32015 pod_workers.go:186] Error syncing pod 84dae85a-5f41-11e8-8057-000d3a2cf959 ("kube-dns-v20-59b4f7dc55-dzcf9_kube-system(84dae85a-5f41-11e8-8057-000d3a2cf959)"), skipping: failed to "CreatePodSandbox" for "kube-dns-v20-59b4f7dc55-jncbg_kube-system(84d8c6f3-5f41-11e8-8057-000d3a2cf959)" with CreatePodSandboxError: "CreatePodSandbox for pod \"kube-dns-v20-59b4f7dc55-jncbg_kube-system (ccd3d42df7d396bda96532379497dd06963af2fddfc5eded247c3d3331ce9758) failed: rpc error: code = Unknown desc = failed to setup network for sandbox \"ccd3d42df7d396bda96532379497dd06963af2fddfc5eded247c3d3331ce9758\": netplugin failed but error parsing its diagnostic message \"\": unexpected end of JSON input"

from azure-container-networking.

IvanovOleg avatar IvanovOleg commented on August 19, 2024

cat /etc/issue in Ubuntu returns Ubuntu 16.04.3 LTS
but in the CoreOS this command returns a list of host keys

This is \n (\s \m \r) \t
SSH host key: SHA256:4436436b46346g43 (RSA)
SSH host key: SHA256:f436346f46f436f46 (ECDSA)
SSH host key: SHA256:f63464f646 (ED25519)
SSH host key: SHA256:f34f634f6436f43f63 (DSA)
eth0: \4{eth0} \6{eth0}

This is the reason of my issue!!!

func (report *Report) GetOSDetails() {

Maybe it's a good idea to retrieve /etc/os-release (PRETTY_NAME)?

NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1786.0.1
VERSION_ID=1786.0.1
BUILD_ID=2018-05-23-1022
PRETTY_NAME="Container Linux by CoreOS 1786.0.1 (Rhyolite)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="amd64-usr"
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

Please apply this change:

// This function  creates a report with os details(ostype, version).
func (report *Report) GetOSDetails() {
	linesArr, err := ReadFileByLines("/etc/os-release")
	if err != nil || len(linesArr) <= 0 {
		report.OSDetails = &OSInfo{OSType: runtime.GOOS}
		report.OSDetails.ErrorMessage = "reading /etc/os-release failed with" + err.Error()
		return
	}

	osInfoArr := make(map[string]string)
	
	for i := range linesArr {
                s := strings.Split(linesArr[i], "=")
                osInfoArr[s[0]] = strings.TrimSuffix(s[1], "\n")
        }

	out, err := exec.Command("uname", "-r").Output()
	if err != nil {
		report.OSDetails = &OSInfo{OSType: runtime.GOOS}
		report.OSDetails.ErrorMessage = "uname -r failed with " + err.Error()
		return
	}

	kernelVersion := string(out)
	kernelVersion = strings.TrimSuffix(kernelVersion, "\n")

	report.OSDetails = &OSInfo{
		OSType:         runtime.GOOS,
		OSVersion:      osInfoArr["VERSION"],
		KernelVersion:  kernelVersion,
		OSDistribution: osInfoArr["ID"],
	}
}

from azure-container-networking.

IvanovOleg avatar IvanovOleg commented on August 19, 2024

I've just tested this fix and it works fine!

from azure-container-networking.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.