scope icon indicating copy to clipboard operation
scope copied to clipboard

Error fetching app details: only encoded map or array can be decoded into a struct

Open Calpicow opened this issue 8 years ago • 6 comments

Running scope v1.9.0 with Kubernetes v1.7. Error logs are not very useful, below:

time="2018-07-02T21:07:56Z" level=info msg="publishing to: weave.jws:443" 
<probe> INFO: 2018/07/02 21:07:56.991032 command line args: --mode=probe --probe-only=true --probe.docker=true --probe.docker.bridge=docker0 --probe.insecure=true --probe.kubernetes=true --weave=false weave.jws:443
<probe> INFO: 2018/07/02 21:07:56.991297 probe starting, version 1.9.0, ID 8d069c657b78c3a
<probe> ERRO: 2018/07/02 21:07:57.116622 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:07:57.118318 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> INFO: 2018/07/02 21:07:57.614628 kubernetes: targeting api server https://10.0.0.1:443
<probe> ERRO: 2018/07/02 21:07:57.684642 conntrack stderr:NOTICE: Netlink socket buffer size has been set to 8388608 bytes.
<probe> ERRO: 2018/07/02 21:07:58.451025 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:07:58.471302 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:00.384524 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:00.384728 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:04.243500 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:04.247383 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:12.236634 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:12.237983 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:22.342833 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2018/07/02 21:08:22.347560 Error fetching app details: only encoded map or array can be decoded into a struct

Calpicow avatar Jul 02 '18 21:07 Calpicow

Same issue here with Kubernetes v1.10.5 and scope 1.9.0. Scope worked before I enabled kubelet webhook authentication/authorization to get prometheus operator kube monitoring going. (--read-only-port=10255 --authentication-token-webhook --authorization-mode=Webhook)

PaulRitzkat avatar Jul 05 '18 12:07 PaulRitzkat

@Calpicow I found out why my scope wasn't working. My scope is running in the kube-system namespace, but the default installation of scope expects in the weave-scope-agent DaemonSet the url weave-scope-app.weave.svc.cluster.local changing .weave. to .kube-system. and scope is working again for me. Check if the URL is working in your cluster (service/weave-scope-app ClusterIP == needs to resolve to your configured URL for the agent).

PaulRitzkat avatar Aug 09 '18 15:08 PaulRitzkat

I revisited this, and it looks like I've accounted for the URL. I'm pointing it to the ingress path.

I'm not using the service DNS however, since hostNetwork pods don't have access to pod networking (calico+flannel).

Calpicow avatar Aug 09 '18 17:08 Calpicow

I'm having a similar problem on my Kubernetes Cluster running 1.13.1. The cluster is a mixed architecture with AMD64 and ARM64. I've build the images myself from master and pushed to my DockerHub (https://hub.docker.com/r/carlosedp/scope/tags).

On the ARM64 nodes, Scope works perfectly but on AMD64 I get the same error (Error fetching app details: only encoded map or array can be decoded into a struct <).

I see the exact same problem running the official install command (kubectl apply -f "https://cloud.weave.works/k8s/scope.yaml?k8s-version=$(kubectl version | base64 | tr -d '\n')" ) with Weaveworks image 1.10.1.

ARM64

Pod: weave-scope-agent-p84q9

time="2019-01-02T16:09:25Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2019/01/02 16:09:25.937735 Basic authentication disabled
<probe> INFO: 2019/01/02 16:09:25.960279 command line args: --mode=probe --probe-only=true --probe.docker=true --probe.docker.bridge=docker0 --probe.kubernetes=true weave-scope-app.weave.svc.cluster.local:80
<probe> INFO: 2019/01/02 16:09:25.961509 probe starting, version fdd1c263, ID 56074fb796af7197
<probe> WARN: 2019/01/02 16:09:25.970880 Cannot resolve 'scope.weave.local.': dial tcp 172.17.0.1:53: connect: connection refused
<probe> WARN: 2019/01/02 16:09:25.981804 Error setting up the eBPF tracker, falling back to proc scanning: error while loading map "maps/tcp_event_ipv4": function not implemented
<probe> INFO: 2019/01/02 16:09:25.982493 kubernetes: targeting api server https://10.96.0.1:443
<probe> INFO: 2019/01/02 16:09:26.006283 Control connection to weave-scope-app.weave.svc.cluster.local starting
<probe> INFO: 2019/01/02 16:09:26.025623 Success collecting weave status
<probe> INFO: 2019/01/02 16:09:26.029894 Publish loop for weave-scope-app.weave.svc.cluster.local starting
<probe> INFO: 2019/01/02 16:09:26.094202 volumesnapshots are not supported by this Kubernetes version
<probe> INFO: 2019/01/02 16:09:26.094505 volumesnapshotdatas are not supported by this Kubernetes version

AMD64

Pod: weave-scope-agent-q7bth

time="2019-01-02T16:08:59Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2019/01/02 16:08:59.177211 Basic authentication disabled
<probe> INFO: 2019/01/02 16:08:59.181511 command line args: --mode=probe --probe-only=true --probe.docker=true --probe.docker.bridge=docker0 --probe.kubernetes=true weave-scope-app.weave.svc.cluster.local:80
<probe> INFO: 2019/01/02 16:08:59.181571 probe starting, version fdd1c263, ID 54e1c6933d8cadbc
<probe> WARN: 2019/01/02 16:08:59.183174 Cannot resolve 'scope.weave.local.': dial tcp 172.17.0.1:53: connect: connection refused
<probe> ERRO: 2019/01/02 16:08:59.188391 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:08:59.316568 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.9.0-8-amd64&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=aQpuYTyXCepHkt6ZdLCmcrF3iLRNfKBESF9yzyM7Gyk%3D&version=fdd1c263: x509: certificate is valid for 5b1bd4b3972f2b9d3691884406780cef.b194ca607c140fa214520496835c1d4b.traefik.default, not checkpoint-api.weave.works
<probe> ERRO: 2019/01/02 16:08:59.386701 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.9.0-8-amd64&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=aQpuYTyXCepHkt6ZdLCmcrF3iLRNfKBESF9yzyM7Gyk%3D&version=fdd1c263: x509: certificate is valid for 5b1bd4b3972f2b9d3691884406780cef.b194ca607c140fa214520496835c1d4b.traefik.default, not checkpoint-api.weave.works
<probe> INFO: 2019/01/02 16:08:59.764975 kubernetes: targeting api server https://10.96.0.1:443
<probe> INFO: 2019/01/02 16:08:59.816997 Success collecting weave status
<probe> INFO: 2019/01/02 16:08:59.829338 volumesnapshotdatas are not supported by this Kubernetes version
<probe> INFO: 2019/01/02 16:08:59.843608 volumesnapshots are not supported by this Kubernetes version
<probe> ERRO: 2019/01/02 16:09:00.195277 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:09:02.194797 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:09:06.192071 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:09:14.197398 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:09:24.192437 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:09:34.196710 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:09:44.196081 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:09:54.196212 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:10:04.196528 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:10:14.197570 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:10:24.203136 Error fetching app details: only encoded map or array can be decoded into a struct
<probe> ERRO: 2019/01/02 16:10:34.197187 Error fetching app details: only encoded map or array can be decoded into a struct

All my pods are in the correct namespace and also when I run Scope standalone on this AMD64 node with the same image, it runs.

Pods

NAMESPACE        NAME                                          READY   STATUS    RESTARTS   AGE     IP             NODE           NOMINATED NODE   READINESS GATES
weave            weave-scope-agent-p84q9                       1/1     Running   0          13m     192.168.1.71   k8s-armnode1   <none>           <none>
weave            weave-scope-agent-q7bth                       1/1     Running   0          13m     192.168.1.60   k8s-master     <none>           <none>
weave            weave-scope-agent-xb58w                       1/1     Running   0          12m     192.168.1.72   k8s-armnode2   <none>           <none>
weave            weave-scope-app-644fff9dbf-j8lmw              1/1     Running   0          13m     10.32.0.6      k8s-master     <none>           <none>

Standalone

$ docker run -d --name=weavescope --privileged --userns=host --net=host --pid=host -v /var/run/docker.sock:/var/run/docker.sock -v /var/run/scope/plugins:/var/run/scope/plugins -v /sys/kernel/debug:/sys/kernel/debug -e CHECKPOINT_DISABLE carlosedp/scope:master-fdd1c263  --probe.docker=true
115c81563d6e44758778ab4c49fb480051772001460e25508d227bf337d40275 

$ docker logs -f weavescope
<app> INFO: 2019/01/02 16:17:29.275180 app starting, version fdd1c263, ID 2fef1801eba3997a
<app> INFO: 2019/01/02 16:17:29.275337 command line args: --mode=app --probe.docker=true
<app> INFO: 2019/01/02 16:17:29.276026 Basic authentication disabled
<app> INFO: 2019/01/02 16:17:29.279079 listening on :4040
time="2019-01-02T16:17:29Z" level=info msg="publishing to: 127.0.0.1:4040"
<probe> INFO: 2019/01/02 16:17:29.283338 Basic authentication disabled
<probe> INFO: 2019/01/02 16:17:29.287133 command line args: --mode=probe --probe.docker=true
<probe> INFO: 2019/01/02 16:17:29.287188 probe starting, version fdd1c263, ID 24e09e19072af0c
<probe> INFO: 2019/01/02 16:17:29.300598 Control connection to 127.0.0.1 starting
<probe> WARN: 2019/01/02 16:17:29.301316 Cannot resolve 'scope.weave.local.': dial tcp 172.17.0.1:53: connect: connection refused
<app> WARN: 2019/01/02 16:17:29.334439 Error updating weaveDNS, backing off 20s: Got 404
<probe> WARN: 2019/01/02 16:17:29.336849 Error setting up the eBPF tracker, falling back to proc scanning: cannot write "p:pfd_install fd_install\n" to kprobe_events: write /sys/kernel/debug/tracing/kprobe_events: device or resource busy
<probe> INFO: 2019/01/02 16:17:29.358847 Success collecting weave status
<probe> INFO: 2019/01/02 16:17:29.360604 Publish loop for 127.0.0.1 starting
<app> WARN: 2019/01/02 16:17:49.410488 Error updating weaveDNS, backing off 40s: Got 404

carlosedp avatar Jan 02 '19 16:01 carlosedp

Something was messed up on my node where the search prefix was pointing to a different IP than the one with the scope-app. Sorry, my mess.

carlosedp avatar Jan 04 '19 18:01 carlosedp

I've made PR #3702 to report the http error instead of a JSON decoder error, which should make this much easier to debug.

bboreham avatar Oct 06 '19 17:10 bboreham