Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Watching third party resources gives client error: "Unable to decode an event from the watch stream: got invalid watch event type:" #26003
Comments
|
I think that's because the dynamic client returns UnstructuredList with Unstructured items, when listing. These do not match api.Node. |
mikedanese
added
the
sig/api-machinery
label
May 25, 2016
|
I'm not working on this ATM. However, this is a big limitation of the dynamic client right now so if anyone wants to take it on, please feel free. |
|
We are seeing this as well. |
wfarr
commented
Nov 4, 2016
|
There's a relevant issue in kubernetes/client-go#8 where, thanks to @caesarxuchao, we have some work-arounds that have been working well for me thus far (there are also some examples of working code linked in that issue). |
|
i am also seeing that watching tpr, causes the tpr to always change, even when no update has been performed. Is this a known issue ? I am seeing this on 1.3.6 ? |
|
@wfarr @caesarxuchao do you know what's the exact fix or workaround for this problem? I followed the issue client-go#8 but don't seem to find what is the workaround for this periodical error in the log. |
|
@caesarxuchao it would be nice if you added an example with watch on TPR. There are many unobvious issues on the way. For example, you can't use The "Unable to decode an event from the watch stream..." error could be another one. Such issues are hard to cover in the docs (since they are deep technical details), but having a proper example would be really useful. |
|
It seems I have found the cause of the issue and the fix.
This is the event that is received by a watch when it cannot be re-established. It cannot be deserialized by a custom Can someone please confirm this is the right thing to do? |
|
Hm, it seems the problem with the original code in this report is slightly different but the cause is the same. In my case a new client is used for specific type with new Scheme object. To fix the code in this report a new Scheme should be created and used for unversioned objects which dynamic client uses. This is my understanding but I might be wrong. |
nilebox
referenced this issue
Mar 13, 2017
Closed
ThirdPartyResource example: added watcher example, code cleanup #43027
liggitt
added
the
area/custom-resources
label
Apr 14, 2017
This was referenced Apr 22, 2017
enisoc
added this to Backlog
in CustomResourceDefinition
Jul 13, 2017
fejta-bot
commented
Dec 23, 2017
|
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
mjg59 commentedMay 21, 2016
Creating a third party resource type from https://gist.github.com/mjg59/b24995501a7064b0b2e1768b7fe71426 , adding an object (https://gist.github.com/mjg59/98b85a924fddecbd08018f1e2f60e17d) and then running https://gist.github.com/mjg59/3c4a2ef23bc0844342774d1ed71f46fc gives a stream of:
New policy
E0521 00:33:16.589647 31839 streamwatcher.go:109] Unable to decode an event from the watch stream: got invalid watch event type:
W0521 00:33:16.589717 31839 reflector.go:343] k8s.io/kubernetes/cmd/watchtest/watchtest.go:70: watch of *api.Node ended with: very short watch
Updated policy
E0521 00:33:17.592341 31839 streamwatcher.go:109] Unable to decode an event from the watch stream: got invalid watch event type:
W0521 00:33:17.592365 31839 reflector.go:343] k8s.io/kubernetes/cmd/watchtest/watchtest.go:70: watch of *api.Node ended with: very short watch
Updated policy
E0521 00:33:18.595440 31839 streamwatcher.go:109] Unable to decode an event from the watch stream: got invalid watch event type:
W0521 00:33:18.595475 31839 reflector.go:343] k8s.io/kubernetes/cmd/watchtest/watchtest.go:70: watch of *api.Node ended with: very short watch
repeating forever. This is with current master and sitepod/kubernetes@d0e9c02 applied.