Giter VIP home page Giter VIP logo

Comments (8)

joshclark avatar joshclark commented on August 29, 2024 1

success! It works. Thanks

from kube-no-trouble.

stepanstipl avatar stepanstipl commented on August 29, 2024

Hi @swaroop1012, thanks for reporting this. Would you be able to share the complete output, incl. how you execute the kubent? This should help us to further debug the issue, thanks!

from kube-no-trouble.

swaroop1012 avatar swaroop1012 commented on August 29, 2024

Hi @stepanstipl thanks for the reply and apologies for the late reply, I missed the mail. I downloaded the tar file, unzipped it and ran the binary. Please find the full output below.

$ /usr/local/bin/kubent 
1:02PM INF >>> Kube No Trouble `kubent` <<<
1:02PM INF version 0.3.2 (git sha 919129b596890475965cda2b972cb6fded71f40b)
1:02PM INF Initializing collectors and retrieving data
1:02PM INF Retrieved 58 resources from collector name=Cluster
1:02PM INF Retrieved 994 resources from collector name="Helm v2"
1:02PM INF Retrieved 0 resources from collector name="Helm v3"
1:02PM INF Loaded ruleset name=deprecated-1-16.rego
1:02PM INF Loaded ruleset name=deprecated-1-22.rego
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/doitintl/kube-no-trouble/pkg/judge.(*RegoJudge).Eval(0xc000c54430, 0xc00005ea00, 0x41c, 0x4a0, 0x41c, 0x4a0, 0x0, 0x1f4, 0xc0002d84e0)
	/__w/kube-no-trouble/kube-no-trouble/pkg/judge/rego.go:76 +0x7c2
main.main()
	/__w/kube-no-trouble/kube-no-trouble/cmd/kubent/main.go:97 +0x3be

If I use the below command, I get the output without any error but I'm not sure if the list is exhaustive.

/usr/local/bin/kubent --helm2=false

from kube-no-trouble.

 avatar commented on August 29, 2024

After a deeper investigation, we believe this bug has been fixed by a previous release.

the line in question being:

m["Namespace"].(string),

PR which fixed it:

https://github.com/doitintl/kube-no-trouble/pull/95/files

Could you try again with the latest nightly and lets us know if the issue still occurs

from kube-no-trouble.

joshclark avatar joshclark commented on August 29, 2024

I'm getting the same error using nightly-0.4.0-83-g055df4e

❌ . (none) kube-no-trouble ➤ ./kubent
5:28PM INF >>> Kube No Trouble `kubent` <<<
5:28PM INF version nightly-0.4.0-83-g055df4e (git sha 055df4e213a394ad107021724714c5130759b284)
5:28PM INF Initializing collectors and retrieving data
5:28PM INF Target K8s version is 1.15+
5:28PM WRN Failed to retrieve: networking.k8s.io/v1, Resource=ingressclasses: the server could not find the requested resource
5:28PM WRN Failed to retrieve: storage.k8s.io/v1, Resource=csidrivers: the server could not find the requested resource
5:28PM WRN Failed to retrieve: storage.k8s.io/v1, Resource=csinodes: the server could not find the requested resource
5:28PM WRN Failed to retrieve: authorization.k8s.io/v1, Resource=subjectaccessreviews: the server does not allow this method on the requested resource
5:28PM WRN Failed to retrieve: authorization.k8s.io/v1, Resource=selfsubjectaccessreviews: the server does not allow this method on the requested resource
5:28PM WRN Failed to retrieve: authorization.k8s.io/v1, Resource=localsubjectaccessreviews: the server could not find the requested resource
5:28PM WRN Failed to retrieve: authentication.k8s.io/v1, Resource=tokenreviews: the server does not allow this method on the requested resource
5:28PM WRN Failed to retrieve: certificates.k8s.io/v1, Resource=certificatesigningrequests: the server could not find the requested resource
5:28PM WRN Failed to retrieve: apiextensions.k8s.io/v1, Resource=customresourcedefinitions: the server could not find the requested resource
5:28PM WRN Failed to retrieve: admissionregistration.k8s.io/v1, Resource=mutatingwebhookconfigurations: the server could not find the requested resource
5:28PM WRN Failed to retrieve: admissionregistration.k8s.io/v1, Resource=validatingwebhookconfigurations: the server could not find the requested resource
5:28PM WRN Failed to retrieve: node.k8s.io/v1, Resource=runtimeclasses: the server could not find the requested resource
5:28PM WRN Failed to retrieve: policy/v1, Resource=poddisruptionbudgets: the server could not find the requested resource
5:28PM WRN Failed to retrieve: discovery.k8s.io/v1, Resource=endpointslices: the server could not find the requested resource
5:28PM WRN Failed to retrieve: batch/v1, Resource=cronjobs: the server could not find the requested resource
5:28PM INF Retrieved 58 resources from collector name=Cluster
5:28PM INF Retrieved 939 resources from collector name="Helm v2"
5:28PM INF Retrieved 24 resources from collector name="Helm v2"
5:28PM INF Loaded ruleset name=custom.rego.tmpl
5:28PM INF Loaded ruleset name=deprecated-1-16.rego
5:28PM INF Loaded ruleset name=deprecated-1-22.rego
5:28PM INF Loaded ruleset name=deprecated-1-25.rego
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/doitintl/kube-no-trouble/pkg/judge.(*RegoJudge).Eval(0xc00063cc40, 0xc0011e0000, 0x3fd, 0x400, 0xc00063cc40, 0x0, 0x0, 0x0, 0xc0001c3350)
        /__w/kube-no-trouble/kube-no-trouble/pkg/judge/rego.go:55 +0x94d
main.main()
        /__w/kube-no-trouble/kube-no-trouble/cmd/kubent/main.go:135 +0x636

from kube-no-trouble.

stepanstipl avatar stepanstipl commented on August 29, 2024

Hi @joshclark, @swaroop1012,
I'm looking into this issue and can't replicate it. I would really like to fix it though, so if you could help. I have added additional logging, and it's in the latest nightly release. If you could download the relevant binary and run it with trace log level:

$ kubent -l trace

You should get a log line starting with TRC parsing right before the panic, such as:

...
12:00PM TRC parsing +map[ApiVersion:storage.k8s.io/v1beta1 Kind:StorageClass Name:slow Namespace:default ReplaceWith:storage.k8s.io/v1 RuleSet:Deprecated APIs removed in 1.22 Since:1.6]

I would really be interested to see that, and the relevant manifest from your cluster... i.e. in the example above it would be StorageClass named slow.

This should allow me to debug this further.. thanks 🙏

from kube-no-trouble.

joshclark avatar joshclark commented on August 29, 2024
4:42PM TRC parsing +map[ApiVersion:extensions/v1beta1 Kind:DaemonSet Name:cattle-node-agent Namespace:cattle-system ReplaceWith:apps/v1 RuleSet:Deprecated APIs removed in 1.16 Since:1.9]
4:42PM TRC parsing +map[ApiVersion:extensions/v1beta1 Kind:Deployment Name:cattle-cluster-agent Namespace:cattle-system ReplaceWith:apps/v1 RuleSet:Deprecated APIs removed in 1.16 Since:1.9]
4:42PM TRC parsing +map[ApiVersion:apps/v1beta2 Kind:StatefulSet Name:azure-agent Namespace:azure-agent ReplaceWith:apps/v1 RuleSet:Deprecated APIs removed in 1.16 Since:1.9]
4:42PM TRC parsing +map[ApiVersion:extensions/v1beta1 Kind:DaemonSet Name:collection-fluent-bit Namespace:sumologic ReplaceWith:apps/v1 RuleSet:Deprecated APIs removed in 1.16 Since:1.9]
4:42PM TRC parsing +map[ApiVersion:extensions/v1beta1 Kind:DaemonSet Name:collection-falco Namespace:sumologic ReplaceWith:apps/v1 RuleSet:Deprecated APIs removed in 1.16 Since:1.9]
4:42PM TRC parsing +map[ApiVersion:apps/v1beta1 Kind:StatefulSet Name:rcm-journal-reporting-hardclose-service Namespace:<nil> ReplaceWith:apps/v1 RuleSet:Deprecated APIs removed in 1.16 Since:1.9]
panic: interface conversion: interface {} is nil, not string

from kube-no-trouble.

stepanstipl avatar stepanstipl commented on August 29, 2024

Thanks @joshclark, I believe I've found the issue. I have merged a fix (#198) and triggered a nightly build - can you test that one in your environment, to verify the issue is fixed?

from kube-no-trouble.

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.