# Weaviate.connect\_to\_local() error

**URL:** <https://forum.weaviate.io/t/weaviate-connect-to-local-error/2662>\
**Category:** Support\
**Created:** [June 10, 2024, 1:34am UTC](https://forum.weaviate.io/t/weaviate-connect-to-local-error/2662 "2024-06-10T01:34:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmy\_6](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jimmy_6/32/1608_2.png) [@jimmy\_6](https://forum.weaviate.io/u/jimmy_6)\
**Post date:** [June 10, 2024, 1:34am UTC](https://forum.weaviate.io/t/weaviate-connect-to-local-error/2662/1 "2024-06-10T01:34:48Z")

</div>

Hi, I have the problem with connecting weaviate container

I tried to solve it with many topics in here, but it is not solved

the error is this:

> Traceback (most recent call last):  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_transports/default.py”, line 69, in map\_httpcore\_exceptions  
> yield  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_transports/default.py”, line 233, in handle\_request  
> resp = self.\_pool.handle\_request(req)  
> File “/usr/local/lib/python3.9/site-packages/httpcore/\_sync/connection\_pool.py”, line 216, in handle\_request  
> raise exc from None  
> File “/usr/local/lib/python3.9/site-packages/httpcore/\_sync/connection\_pool.py”, line 196, in handle\_request  
> response = connection.handle\_request(  
> File “/usr/local/lib/python3.9/site-packages/httpcore/\_sync/connection.py”, line 99, in handle\_request  
> raise exc  
> File “/usr/local/lib/python3.9/site-packages/httpcore/\_sync/connection.py”, line 76, in handle\_request  
> stream = self.\_connect(request)  
> File “/usr/local/lib/python3.9/site-packages/httpcore/\_sync/connection.py”, line 122, in \_connect  
> stream = self.\_network\_backend.connect\_tcp(\*\*kwargs)  
> File “/usr/local/lib/python3.9/site-packages/httpcore/\_backends/sync.py”, line 213, in connect\_tcp  
> sock.setsockopt(socket.IPPROTO\_TCP, socket.TCP\_NODELAY, 1)  
> File “/usr/lib64/python3.9/contextlib.py”, line 137, in **exit**  
> self.gen.throw(typ, value, traceback)  
> File “/usr/local/lib/python3.9/site-packages/httpcore/\_exceptions.py”, line 14, in map\_exceptions  
> raise to\_exc(exc) from exc  
> httpcore.ConnectError: [Errno 111] Connection refused

> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):  
> File “/usr/local/lib/python3.9/site-packages/weaviate/connect/v4.py”, line 258, in \_create\_clients  
> response = client.get(oidc\_url)  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_client.py”, line 1054, in get  
> return self.request(  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_client.py”, line 827, in request  
> return self.send(request, auth=auth, follow\_redirects=follow\_redirects)  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_client.py”, line 914, in send  
> response = self.\_send\_handling\_auth(  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_client.py”, line 942, in \_send\_handling\_auth  
> response = self.\_send\_handling\_redirects(  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_client.py”, line 979, in \_send\_handling\_redirects  
> response = self.\_send\_single\_request(request)  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_client.py”, line 1015, in \_send\_single\_request  
> response = transport.handle\_request(request)  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_transports/default.py”, line 233, in handle\_request  
> resp = self.\_pool.handle\_request(req)  
> File “/usr/lib64/python3.9/contextlib.py”, line 137, in **exit**  
> self.gen.throw(typ, value, traceback)  
> File “/usr/local/lib/python3.9/site-packages/httpx/\_transports/default.py”, line 86, in map\_httpcore\_exceptions  
> raise mapped\_exc(message) from exc  
> httpx.ConnectError: [Errno 111] Connection refused
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):  
> File “”, line 1, in   
> File “/usr/local/lib/python3.9/site-packages/weaviate/connect/helpers.py”, line 213, in connect\_to\_local  
> return \_\_connect(client)  
> File “/usr/local/lib/python3.9/site-packages/weaviate/connect/helpers.py”, line 401, in \_\_connect  
> raise e  
> File “/usr/local/lib/python3.9/site-packages/weaviate/connect/helpers.py”, line 397, in \_\_connect  
> client.connect()  
> File “/usr/local/lib/python3.9/site-packages/weaviate/client.py”, line 287, in connect  
> self.\_connection.connect(self.\_\_skip\_init\_checks)  
> File “/usr/local/lib/python3.9/site-packages/weaviate/connect/v4.py”, line 711, in connect  
> super().connect(skip\_init\_checks)  
> File “/usr/local/lib/python3.9/site-packages/weaviate/connect/v4.py”, line 138, in connect  
> self.\_create\_clients(self.\_auth, skip\_init\_checks)  
> File “/usr/local/lib/python3.9/site-packages/weaviate/connect/v4.py”, line 260, in \_create\_clients  
> raise WeaviateConnectionError(  
> weaviate.exceptions.WeaviateConnectionError: Connection to Weaviate failed. Error: [Errno 111] Connection refused.  
> Is Weaviate running and reachable at [http://localhost:8080](http://localhost:8080)?

And then, I checked the container logs:

> {“action”:“startup”,“error”:“init bolt\_db: open "/var/lib/weaviate/schema.db": open /var/lib/weaviate/schema.db: permission denied”,“level”:“fatal”,“msg”:“could not initialize schema repo”,“time”:“2024-06-10T00:48:06Z”}

so, I tried to remove /var/lib/weaviate folder but it can’t

How can I solve this connecting error?  
Please, help

my code is simple:

> import weaviate  
> client = weaviate.connect\_to\_local()  
> print(“Connecting success”)  
> client.close()

- weaviate docker image: [cr.weaviate.io/semitechnologies/weaviate:1.25.2](http://cr.weaviate.io/semitechnologies/weaviate:1.25.2)
- weaviate-client version: 4.6.4
- python version: 3.9.18
- podman version: 4.9.4
- podman-compose version: 1.0.6

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [June 10, 2024, 6:11pm UTC](https://forum.weaviate.io/t/weaviate-connect-to-local-error/2662/2 "2024-06-10T18:11:19Z")

</div>

Hi Jimmy!

Can you share your docker compose?

It seems it doesn’t have permission to write on the path you set for persistence.

try commenting out the volume and check if it will docker compose up.

If that’s the case, you need to check the permission on the mount point or volume you have defined.

Let me know if this helps.

Thanks!
