jina-ai / examples

Jina examples and demos to help you get started
https://docs.jina.ai
Apache License 2.0
455 stars 142 forks source link

Exceptions running my-first-jina-app #172

Closed davidecadamuro closed 4 years ago

davidecadamuro commented 4 years ago

I have an exception following the tutorial my-first-jina-app. After changing the code as described in the tutorial, downloading the data as I described answering this issue, I got this exception running the app.py index:

        encoder@17475[S]:terminated
           Flow@17457[S]:flow is closed and all resources should be released already, current build level is 0
Traceback (most recent call last):
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/jina/clients/python/grpc.py", line 72, in start
    self.call(*args, **kwargs)
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/jina/clients/python/__init__.py", line 123, in call
        crafter@17474[I]:#sent: 2 #recv: 2 sent_size: 633 Bytes recv_size: 543 Bytes
    for resp in self._stub.Call(req_iter):
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/grpc/_channel.py", line 416, in __next__
        crafter@17474[I]:#sent: 2 #recv: 2 sent_size: 633 Bytes recv_size: 543 Bytes
        crafter@17474[S]:terminated
    return self._next()
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/grpc/_channel.py", line 706, in _next
    raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.UNKNOWN
    details = "Exception iterating requests!"
    debug_error_string = "None"
>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "app.py", line 50, in <module>
    index()
  File "app.py", line 26, in index
    f.index_lines(filepath='data/startrek_tng.csv', batch_size=64, read_mode='r', size=num_docs)
  File "/Users/Q481942/.pyenv/versions/3.8.0/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 "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/jina/clients/python/__init__.py", line 212, in index
    self.start(output_fn, **kwargs)
  File "/Users/Q481942/.pyenv/versions/3.8.0/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

Nothing has been written in the folder workspace. Trying a dryrun I got a different exception:

        gateway@23355[C]:unknown exception: AttributeError("'WSGIServer' object has no attribute 'socket'")
Traceback (most recent call last):
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/jina/peapods/pea.py", line 333, in run
    self.loop_body()
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/jina/peapods/gateway.py", line 243, in loop_body
    self.get_http_server()
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/jina/peapods/gateway.py", line 310, in get_http_server
    server.serve_forever()
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/gevent/baseserver.py", line 398, in serve_forever
    self.start()
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/gevent/baseserver.py", line 339, in start
    self.start_accepting()
  File "/Users/Q481942/.pyenv/versions/3.8.0/lib/python3.8/site-packages/gevent/baseserver.py", line 186, in start_accepting
    self._watcher = self.loop.io(self.socket.fileno(), 1)
AttributeError: 'WSGIServer' object has no attribute 'socket'
        gateway@23355[S]:terminated

pip freeze gives me:

jina==0.4.11
grpcio==1.31.0
gevent==20.6.2
denysthegitmenace commented 4 years ago

Same issue here. I ran into the first exception when querying southpark-search tutorial

alexcg1 commented 4 years ago

Hi there,

Apologies for these issues. Unfortunately cookiecutter-jina no longer works with Jina's latest code, so we've made the difficult decision to retire this tutorial until we have a more effective way for new users to bootstrap a simple Jina project.

When I wrote the tutorial (when Jina 0.3.0 was the latest release) it worked perfectly. Alas with the breaking changes of 0.4.0 that's no longer the case.

Please let me know if you have any other questions or feedback!