Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while fetching server API version: HTTPConnection.request() got an unexpected keyword argument 'chunked' #1259

Closed
2 of 10 tasks
MuPp3t33r opened this issue Jul 24, 2023 · 6 comments

Comments

@MuPp3t33r
Copy link

System Info

fresh setup as per current version using python 3.11.2

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • backend
  • bindings
  • python-bindings
  • chat-ui
  • models
  • circleci
  • docker
  • api

Reproduction

docker-compose up --build gpt4all_api

`Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
return self.version(api_version=False)["ApiVersion"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 181, in version
return self._result(self._get(url), json=True)
^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/docker/api/client.py", line 237, in _get
return self.get(url, **self._set_request_timeout(kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
TypeError: HTTPConnection.request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/docker-compose", line 33, in
sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
command_func()
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command
project = project_from_options('.', options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options
return get_project(
^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project
client = get_client(
^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client
client = docker_client(
^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 170, in docker_client
client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/docker/api/client.py", line 197, in init
self._version = self._retrieve_server_version()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: HTTPConnection.request() got an unexpected keyword argument 'chunked'`

Expected behavior

Expect API to start

@MuPp3t33r
Copy link
Author

MuPp3t33r commented Jul 24, 2023

ok nevermind I fixed that issue. Still having issues with model not instantiating

docker-compose up --build gpt4all_api
Recreating gpt4all_api ... done
Attaching to gpt4all_api
gpt4all_api | Checking for script in /app/prestart.sh
gpt4all_api | There is no script /app/prestart.sh
gpt4all_api | INFO: Will watch for changes in these directories: ['/app']
gpt4all_api | WARNING: "workers" flag is ignored when reloading is enabled.
gpt4all_api | INFO: Uvicorn running on http://0.0.0.0:4891 (Press CTRL+C to quit)
gpt4all_api | INFO: Started reloader process [1] using WatchFiles
gpt4all_api | INFO: Started server process [8]
gpt4all_api | INFO: Waiting for application startup.
gpt4all_api | [2023-07-24 11:16:30,314 8:MainThread] api_v1.events - INFO -
gpt4all_api | Starting up GPT4All API
gpt4all_api | | events.py:22
gpt4all_api | [2023-07-24 11:16:30,314 8:MainThread] main - INFO - Downloading/fetching model: /models/ggml-mpt-7b-chat.bin | main.py:37
gpt4all_api | Invalid model file
gpt4all_api | ERROR: Traceback (most recent call last):
gpt4all_api | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 677, in lifespan
gpt4all_api | async with self.lifespan_context(app) as maybe_state:
gpt4all_api | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 566, in aenter
gpt4all_api | await self._router.startup()
gpt4all_api | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 654, in startup
gpt4all_api | await handler()
gpt4all_api | File "/app/main.py", line 40, in startup
gpt4all_api | model = GPT4All(model_name=settings.model, model_path=settings.gpt4all_path)
gpt4all_api | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt4all_api | File "/usr/local/lib/python3.11/site-packages/gpt4all/gpt4all.py", line 90, in init
gpt4all_api | self.model.load_model(self.config["path"])
gpt4all_api | File "/usr/local/lib/python3.11/site-packages/gpt4all/pyllmodel.py", line 192, in load_model
gpt4all_api | raise ValueError("Unable to instantiate model")
gpt4all_api | ValueError: Unable to instantiate model
gpt4all_api |
gpt4all_api | ERROR: Application startup failed. Exiting.
gpt4all_api | Found model file at /models/ggml-mpt-7b-chat.bin

@dmashiahneo
Copy link

@MuPp3t33r
How did you fixed the issue?

@KgotsoPhela
Copy link

@MuPp3t33r
How was the issue resolved? I am having the same problem.

@MuPp3t33r
Copy link
Author

Hi @dmashiahneo & @KgotsoPhela
I'm afraid it's been a while since this post and I've tried a lot of things since so don't really remember all the finer details.
What I can tell you is at the time of this post I was actually using an unsupported CPU (no AVX or AVX2) so I would never have been able to use GPT on it, which likely caused most of my issues. However I am doing more testing now on modern hardware and still having issues but playing around with some things, maybe I'll write up a guide if I get it working. What OS/hardware are you running under?

@dmashiahneo
Copy link

@KgotsoPhela @MuPp3t33r
My issue was due to lack space i think...
i ran it over lxc before, then installed a full VM with more disk space.

@cebtenzzre
Copy link
Member

cebtenzzre commented Oct 10, 2023

This is an upstream issue: docker/docker-py#3113 (fixed in docker/docker-py#3116)
Either update docker-py to 6.1.0 or newer, or downgrade the python requests module to 2.28.1 and your urllib3 module to 1.26
.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants