Skip to content

ValueError: Invalid file descriptor: -1 when building KafkaAdminClient #177

Closed
@etripier

Description

@etripier
  File "/usr/local/lib/python3.11/site-packages/kafka/admin/client.py", line 369, in _send_request_to_node
    self._client.poll()
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 594, in poll
    self._poll(timeout / 1000)
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 649, in _poll
    self._selector.modify(
  File "/usr/local/lib/python3.11/selectors.py", line 377, in modify
    key = self._fd_to_key[self._fileobj_lookup(fileobj)]
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/selectors.py", line 225, in _fileobj_lookup
    return _fileobj_to_fd(fileobj)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/selectors.py", line 42, in _fileobj_to_fd
    raise ValueError("Invalid file descriptor: {}".format(fd))
ValueError: Invalid file descriptor: -1

We started seeing this error after upgrading to 2.1.0. We think it's caused by https://github.com/wbarnha/kafka-python-ng/pull/156/files. We'll put a repro case together later if we can, but in the meantime - do you have an idea of what could be going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions