在非开放管道上调用读取

Called read on non-open pipe

我正在执行一些 osquery,但我遇到了异常

代码

import osquery

inst = osquery.SpawnInstance("C:\ProgramData\osquery\osqueryi.exe")
inst.open()

cursor = inst.client

cursor.query("select name, version from programs;")

完全例外

Traceback (most recent call last):
  File "app.py", line 8, in <module>
    cursor.query("select name, version from programs;")
  File "C:\Users\malware-test\Anaconda3\lib\site-packages\osquery\extensions\ExtensionManager.py", line 181, in query
    self.send_query(sql)
  File "C:\Users\malware-test\Anaconda3\lib\site-packages\osquery\extensions\ExtensionManager.py", line 190, in send_query
    self._oprot.trans.flush()
  File "C:\Users\malware-test\Anaconda3\lib\site-packages\thrift\transport\TTransport.py", line 177, in flush
    self.__trans.write(out)
  File "C:\Users\malware-test\Anaconda3\lib\site-packages\osquery\TPipe.py", line 128, in write
    message='Called read on non-open pipe')
thrift.transport.TTransport.TTransportException: Called read on non-open pipe

安装 Apache thrift 及其 python 模块后错误得到解决