Skip to content

IncompleteRead error while streaming to watch some apis #540

Description

@steveum0105

I'm using 6.0.0 with Kubernetes 1.9.
I'm trying using watch API like this.

        w = watch.Watch()
        for event in w.stream(
                self.api_instance_ext_v1Beta1API.
                list_ingress_for_all_namespaces,
                **kwargs):
                 ...

At first loop, it works fine.
However, I got this error from the second loop when there is no change of watching Resources.

  File "/usr/local/lib/python3.6/site-packages/kubernetes/watch/watch.py", line 124, in stream
    for line in iter_resp_lines(resp):
  File "/usr/local/lib/python3.6/site-packages/kubernetes/watch/watch.py", line 45, in iter_resp_lines
    for seg in resp.read_chunked(decode_content=False):
  File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 626, in read_chunked
    self._original_response.close()
  File "/usr/local/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 320, in _error_catcher
    raise ProtocolError('Connection broken: %r' % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

I think it's because k8s disconnects watch api after 10 minutes.
kubernetes-client intentionally let me handle this?

Activity

  1. changed the title [-]I got and error while streaming to watch some apis[/-] [+]I got an error while streaming to watch some apis[/+] on May 25, 2018
  2. changed the title [-]I got an error while streaming to watch some apis[/-] [+]I got IncompleteRead error while streaming to watch some apis[/+] on May 25, 2018
  3. changed the title [-]I got IncompleteRead error while streaming to watch some apis[/-] [+]IncompleteRead error while streaming to watch some apis[/+] on May 29, 2018
  4. abushoeb commented on Jun 18, 2018

    @abushoeb

    I had issues with Watch() while using k8 v1.7 and python client 6.0. Later I changed python client to 2.0 and it's working. What I observed is that the client documentation is not updated for the latest version which 6.0.

  5. steveum0105 commented on Jun 19, 2018

    @steveum0105
    Author

    Now.. I'm doing like this.

    from urllib3.exceptions import ProtocolError
    ...
    w = watch.Watch()
    try:              
        for event in w.stream(list_resources, **kwargs):
    ...
    except ProtocolError:
        print('skip this error... because kubelet disconnect client after default 10m...')  
    ...

    Is it a known exception? then I will close the issue...

  6. fejta-bot commented on Apr 24, 2019

    @fejta-bot

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
    /lifecycle stale

  7. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Apr 24, 2019
  8. fejta-bot commented on May 24, 2019

    @fejta-bot

    Stale issues rot after 30d of inactivity.
    Mark the issue as fresh with /remove-lifecycle rotten.
    Rotten issues close after an additional 30d of inactivity.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
    /lifecycle rotten

  9. added
    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.
    and removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on May 24, 2019
  10. fejta-bot commented on Jun 23, 2019

    @fejta-bot

    Rotten issues close after 30d of inactivity.
    Reopen the issue with /reopen.
    Mark the issue as fresh with /remove-lifecycle rotten.

    Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
    /close

  11. k8s-ci-robot commented on Jun 23, 2019

    @k8s-ci-robot
    Contributor

    @fejta-bot: Closing this issue.

    Details

    In response to this:

    Rotten issues close after 30d of inactivity.
    Reopen the issue with /reopen.
    Mark the issue as fresh with /remove-lifecycle rotten.

    Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
    /close

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions