jina-ai / cookiecutter-jina

Cookiecutter template for a Jina project
Apache License 2.0
10 stars 2 forks source link

jina.excepts.BadClient: StatusCode.UNKNOWN error in grpc: Exception iterating requests! often the case is that you define/send a bad input iterator to jina, please double check your input iterator #23

Closed alexcg1 closed 4 years ago

alexcg1 commented 4 years ago

Problem

Traceback (most recent call last):
  File "app.py", line 54, in <module>
    index()
  File "app.py", line 28, in index
    f.index_lines(filepath=data_path, batch_size=16, read_mode='r', size=num_docs)
  File "/home/alexcg/work/repos/examples/my-first-jina-app/env/lib/python3.8/site-packages/jina/flow/__init__.py", line 648, in index_lines
    self._get_client(**kwargs).index(input_lines(lines, filepath, size, sampling_rate, read_mode), output_fn,
  File "/home/alexcg/work/repos/examples/my-first-jina-app/env/lib/python3.8/site-packages/jina/clients/python/__init__.py", line 212, in index
    self.start(output_fn, **kwargs)
  File "/home/alexcg/work/repos/examples/my-first-jina-app/env/lib/python3.8/site-packages/jina/clients/python/grpc.py", line 83, in start
    raise BadClient('%s error in grpc: %s '
jina.excepts.BadClient: StatusCode.UNKNOWN error in grpc: Exception iterating requests! often the case is that you define/send a bad input iterator to jina, please double check your input iterator

error.log

Environment

pip list gives:

Package          Version
---------------- ---------
arrow            0.16.0
binaryornot      0.4.4
certifi          2020.6.20
chardet          3.0.4
click            7.1.2
cookiecutter     1.7.2
filelock         3.0.12
Flask            1.1.2
Flask-Cors       3.0.9
future           0.18.2
gevent           20.6.2
greenlet         0.4.16
grpcio           1.31.0
idna             2.10
itsdangerous     1.1.0
jina             0.5.0
Jinja2           2.11.2
jinja2-time      0.2.0
joblib           0.16.0
lz4              3.1.0
MarkupSafe       1.1.1
numpy            1.19.1
packaging        20.4
pip              20.2.2
poyo             0.5.0
protobuf         3.13.0
pyparsing        2.4.7
python-dateutil  2.8.1
python-magic     0.4.18
python-slugify   4.0.1
pyzmq            19.0.2
regex            2020.7.14
requests         2.24.0
ruamel.yaml      0.16.10
ruamel.yaml.clib 0.2.0
sacremoses       0.0.43
sentencepiece    0.1.91
setuptools       50.0.3
six              1.15.0
text-unidecode   1.3
tokenizers       0.8.1rc1
torch            1.6.0
tornado          6.0.4
tqdm             4.48.2
transformers     3.0.2
urllib3          1.25.10
uvloop           0.14.0
Werkzeug         1.0.1
wheel            0.35.1
zope.event       4.4
zope.interface   5.1.0

So Flask, etc is now installed

ls -l workspace gives:

workspace/compound_indexer-1:
total 8
-rw-rw-r--. 1 alexcg alexcg 62 Sep  2 17:13 chunk.gz
-rw-rw-r--. 1 alexcg alexcg 58 Sep  2 17:13 vec.gz

workspace/compound_indexer-2:
total 8
-rw-rw-r--. 1 alexcg alexcg 62 Sep  2 17:13 chunk.gz
-rw-rw-r--. 1 alexcg alexcg 58 Sep  2 17:13 vec.gz
JoanFM commented 4 years ago

This error means that no input has been provided, so check the input iterator or generator provided in the input

rutujasurve94 commented 4 years ago

This has been fixed and both indexing and querying work fine.