# Docker with --rm needs empty PERSISTENCE\_DATA\_PATH

**URL:** <https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410>\
**Category:** General\
**Created:** [March 30, 2025, 5:51pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410 "2025-03-30T17:51:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksrev](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@ksrev](https://forum.weaviate.io/u/ksrev)\
**Post date:** [March 30, 2025, 5:51pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/1 "2025-03-30T17:51:51Z")

</div>

I found out, that if you use the same data-directory with a new created docker container, the client will not work anymore.

I use this Python Code for testing:

```auto
import weaviate

client = weaviate.connect_to_local(host="127.0.0.1", port=7776)
print(client.is_ready())
client.close()

```

With a new container and a new (empty) data-directory the result is: True

With the same and restarted container an the prev. used data-directory the result is: True

With a new container and a prev. used data-directory the result is: False

---

<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:** [March 31, 2025, 1:51pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/2 "2025-03-31T13:51:22Z")

</div>

hi @ksrev !!

Welcome to our community 🤗

Could you detail the step by step used for that outcome?

Also, is there any error logs from the server on the situation it is not working?

Thanks!

---

<div class="post-metadata">

**Author:** ![ksrev](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@ksrev](https://forum.weaviate.io/u/ksrev)\
**Post date:** [March 31, 2025, 6:02pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/3 "2025-03-31T18:02:43Z")

</div>

Hello @DudaNogueira,

there are no special steps required. What I’ve discovered is that when using persistent storage (either a Docker volume or a bound local directory), the database only works correctly with the original container it was initialized with.

It appears that some crucial data is stored outside the designated persistent data directory. As a result, simply reusing the same volume with a new container — even if it’s based on the same image version — leads to issues. The code I posted in my initial message will then return `False`.

To reproduce the issue, just delete the original container, spin up a new one with the same image version, and mount the previously used volume. The problem should reoccur.

I haven’t seen any error messages or hints indicating what exactly went wrong. But to be fair, I’m not an expert when it comes to digging into Docker containers.

---

<div class="post-metadata">

**Author:** ![ksrev](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@ksrev](https://forum.weaviate.io/u/ksrev)\
**Post date:** [March 31, 2025, 6:33pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/4 "2025-03-31T18:33:27Z")

</div>

I compared both containers and eventually noticed a difference. The second container — the one I created later and attached to the data directory of the first — shows recurring error messages in its Docker log.

> {“build\_git\_commit”:“927897e”,“build\_go\_version”:“go1.22.12”,“build\_image\_tag”:“v1.29.2”,“build\_wv\_version”:“1.29.2”,“level”:“info”,“msg”:“attempting to join”,“remoteNodes”:{“70cf1899cd62”:“172.17.0.4:8300”},“time”:“2025-03-31T18:28:23Z”}  
> {“build\_git\_commit”:“927897e”,“build\_go\_version”:“go1.22.12”,“build\_image\_tag”:“v1.29.2”,“build\_wv\_version”:“1.29.2”,“level”:“info”,“msg”:“attempted to join and failed”,“remoteNode”:“172.17.0.4:8300”,“status”:8,“time”:“2025-03-31T18:28:23Z”}  
> {“build\_git\_commit”:“927897e”,“build\_go\_version”:“go1.22.12”,“build\_image\_tag”:“v1.29.2”,“build\_wv\_version”:“1.29.2”,“level”:“info”,“msg”:“attempting to join”,“remoteNodes”:{“70cf1899cd62”:“172.17.0.4:8300”},“time”:“2025-03-31T18:28:24Z”}  
> {“build\_git\_commit”:“927897e”,“build\_go\_version”:“go1.22.12”,“build\_image\_tag”:“v1.29.2”,“build\_wv\_version”:“1.29.2”,“level”:“info”,“msg”:“attempted to join and failed”,“remoteNode”:“172.17.0.4:8300”,“status”:8,“time”:“2025-03-31T18:28:24Z”}  
> …

---

<div class="post-metadata">

**Author:** ![ksrev](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@ksrev](https://forum.weaviate.io/u/ksrev)\
**Post date:** [March 31, 2025, 6:38pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/5 "2025-03-31T18:38:08Z")

</div>

Here are the docker command for the containers:

> docker run   
> –name weaviate\_a   
> -v /data/raid250/weaviate\_data:/var/lib/weaviate   
> -e PERSISTENCE\_DATA\_PATH=/var/lib/weaviate   
> -p 7776:8080   
> -p 50051:50051   
> semitechnologies/weaviate:1.29.2
> 
> docker run   
> –name weaviate\_b   
> -v /data/raid250/weaviate\_data:/var/lib/weaviate   
> -e PERSISTENCE\_DATA\_PATH=/var/lib/weaviate   
> -p 7776:8080   
> -p 50051:50051   
> semitechnologies/weaviate:1.29.2

weaviate\_a works well.  
weaviate\_b works not.

When you stop weaviate\_b and start weaviate\_a it works well again.

---

<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:** [April 1, 2025, 1:21pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/6 "2025-04-01T13:21:48Z")

</div>

Hi!

That’s expected. There is a lock mechanism from Weaviate to take over and manage the data.

You can’t run two instances using the same persistence path.

Each node should have it’s own data path, and they will sync the data.

Here more info on replication in Weaviate:

> **[Replication | Weaviate](https://weaviate.io/developers/weaviate/configuration/replication)**
>
> Weaviate instances can be replicated. Replication can improve read throughput, improve availability, and enable zero-downtime upgrades.

Let me know if this helps.

Thanks!

---

<div class="post-metadata">

**Author:** ![ksrev](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@ksrev](https://forum.weaviate.io/u/ksrev)\
**Post date:** [April 1, 2025, 3:00pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/7 "2025-04-01T15:00:21Z")

</div>

Hello,

but finally I don’t want to run two instances at the same time. What if I setup a new Instance for update or some other reason. I don’t want to vectorize all my data again. I want to reuse my old datadir for sure.

greetings

---

<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:** [April 1, 2025, 3:49pm UTC](https://forum.weaviate.io/t/docker-with-rm-needs-empty-persistence-data-path/20410/8 "2025-04-01T15:49:18Z")

</div>

If you want to migrate your data from a single cluster to a multi node cluster,  
you will need to spin up the new cluster first, create the collection accordingly (making sure to to set the replication factor) and the migrate your data over.
