jina-ai / langchain-serve

⚡ Langchain apps in production using Jina & FastAPI

Home Page:https://cloud.jina.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with lc-serve deploy jcloud

bigKeter opened this issue · comments

Hello,

When running lc-serve deploy jcloud app with the example code snippet given in the readme (updated agent code app.py, the refactored one), I get the following error:
Exception: DownstreamServiceFailureError: Executor normalization failed(5000): 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte session_id: c006e4bf-e9e8-11ed-bb99-80913334fb46

The session ID is the following:
[yellow bold]c006e4bf-e9e8-11ed-bb99-80913334fb46[/]

  • I have made sure that the file is encoded with UTF-8 and I'm still getting the error
  • lc-serve deploy local app works
  • I'm using Windows 10

Thank you for the help.

@bigKeter Thanks for trying lc-serve. Can you rerun the command with --verbose flag and share the error?

lc-serve deploy jcloud app --verbose

Thank you for the swift answer. Here's the error:

(venv) PS C:\Users\user\Projects\qna> lc-serve deploy jcloud app --verbose
⠇ Pushing `C:\Users\user\AppData\Local\Temp\tmp6csh2vmn` ...🔐 You are logged in to Jina AI as bigKeter (username: bigKeter). To log out, use jina auth logout.
Please report this session_id: [yellow bold]1d73de80-ea6b-11ed-a7ba-80913334fb46[/] to
https://github.com/jina-ai/jina-hubble-sdk/issues
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user\Projects\qna\venv\scripts\lc-serve.exe\__main__.py", line 7, in <module>
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\lcserve\flow.py", line 33, in wrapper
    return asyncio.run(f(*args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\nest_asyncio.py", line 35, in run
    return loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\nest_asyncio.py", line 90, in run_until_complete
    return f.result()
           ^^^^^^^^^^
  File "C:\Python311\Lib\asyncio\futures.py", line 203, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "C:\Python311\Lib\asyncio\tasks.py", line 267, in __step
    result = coro.send(None)
             ^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\lcserve\__main__.py", line 192, in jcloud
    await serve_on_jcloud(
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\lcserve\__main__.py", line 47, in serve_on_jcloud
    gateway_id_wo_tag, is_websocket = push_app_to_hubble(
                                      ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\lcserve\flow.py", line 284, in push_app_to_hubble
    return HubIO(args).push().get('id'), _any_websocket_router(app)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\hubble\__init__.py", line 48, in arg_wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\hubble\executor\hubio.py", line 597, in push
    raise e
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\hubble\executor\hubio.py", line 580, in push
    image = self._send_push_request(
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Projects\qna\venv\Lib\site-packages\hubble\executor\hubio.py", line 376, in _send_push_request
    raise Exception(f'{ msg or "Unknown Error"} session_id: {session_id}')
Exception: DownstreamServiceFailureError: Executor normalization failed(5000): 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte session_id: 1d73de80-ea6b-11ed-a7ba-80913334fb46

@bigKeter We couldn't reproduce this error. Is it possible to try the command on WSL instead of Windows?

@deepankarm I have tried the command on WSL instead of Windows. I have checked the file's encoding with both Notepad and VSCode and it seems to be encoded with UTF-8.

Traceback (most recent call last):
  File "/home/keter/.local/bin/lc-serve", line 8, in <module>
    sys.exit(serve())
  File "/home/keter/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/keter/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/keter/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/keter/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/keter/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/keter/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/keter/.local/lib/python3.10/site-packages/lcserve/flow.py", line 34, in wrapper
    return asyncio.run(f(*args, **kwargs))
  File "/home/keter/.local/lib/python3.10/site-packages/nest_asyncio.py", line 35, in run
    return loop.run_until_complete(task)
  File "/home/keter/.local/lib/python3.10/site-packages/nest_asyncio.py", line 90, in run_until_complete
    return f.result()
  File "/usr/lib/python3.10/asyncio/futures.py", line 201, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 232, in __step
    result = coro.send(None)
  File "/home/keter/.local/lib/python3.10/site-packages/lcserve/__main__.py", line 223, in jcloud
    await serve_on_jcloud(
  File "/home/keter/.local/lib/python3.10/site-packages/lcserve/__main__.py", line 49, in serve_on_jcloud
    gateway_id_wo_tag, is_websocket = push_app_to_hubble(
  File "/home/keter/.local/lib/python3.10/site-packages/lcserve/flow.py", line 235, in push_app_to_hubble
    requirements = f.read().splitlines()
  File "/usr/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte```

This is super weird. Can you please share the output of the command jina -vf?

@deepankarm

- jina 3.15.0
- docarray 0.21.0
- jcloud 0.2.6
- jina-hubble-sdk 0.36.0
- jina-proto 0.1.17
- protobuf 4.22.4
- proto-backend upb
- grpcio 1.47.5
- pyyaml 5.4.1
- python 3.10.6
- platform Linux
- platform-release 5.15.90.1-microsoft-standard-WSL2
- platform-version #1 SMP Fri Jan 27 02:56:13 UTC 2023
- architecture x86_64
- processor x86_64
- uid 162596106609397
- session-id 7685061f-eb59-11ed-8ed2-93e15b2d22f5
- uptime 2023-05-05T18:28:18.986812
- ci-vendor (unset)
- internal False
* JINA_DEFAULT_HOST (unset)
* JINA_DEFAULT_TIMEOUT_CTRL (unset)
* JINA_DEPLOYMENT_NAME (unset)
* JINA_DISABLE_UVLOOP (unset)
* JINA_EARLY_STOP (unset)
* JINA_FULL_CLI (unset)
* JINA_GATEWAY_IMAGE (unset)
* JINA_GRPC_RECV_BYTES (unset)
* JINA_GRPC_SEND_BYTES (unset)
* JINA_HUB_NO_IMAGE_REBUILD (unset)
* JINA_LOG_CONFIG (unset)
* JINA_LOG_LEVEL (unset)
* JINA_LOG_NO_COLOR (unset)
* JINA_MP_START_METHOD (unset)
* JINA_OPTOUT_TELEMETRY (unset)
* JINA_RANDOM_PORT_MAX (unset)
* JINA_RANDOM_PORT_MIN (unset)
* JINA_LOCKS_ROOT (unset)
* JINA_K8S_ACCESS_MODES (unset)
* JINA_K8S_STORAGE_CLASS_NAME (unset)
* JINA_K8S_STORAGE_CAPACITY (unset)
* JINA_STREAMER_ARGS (unset)

@bigKeter do you mind joining our Slack for further discussion on this?

Can you check if your folder has any hidden windows file? @bigKeter

@bigKeter Closing this, since it is fixed now.