Hi,
This may not necessarily be a Weaviate issue and instead a node.js/unidici issue, or more likely, an issue with my lack of understanding of docker-compose networking on Windows, but I thought someone here might have come across it and may be able to help.
I have a node.js app that I run as a service in a docker-compose setup. Weaviate is the other service in the setup.
The node.js tries to communicate through the typescript client on http://weaviate:8080
(weaviate being the correct service name).
This works completely fine on MacOS. However, when deployed using Docker Desktop on Windows, I am experiencing some frustrating behaviour.
The live check succeeds, and so too does setting up the schema in the DB. However, when I make a request to get an item based on uuid (getterById()
), the call times out and throws a fetch error
.
If I run the node.js source code on the machine with just Weaviate running in docker (using the default docker-compose file), I have no troubles when setting the Weaviate URL in the node.js app to 127.0.0.1:8080
but get the same errors when using localhost:8080
. Setting the Weaviate endpoint to 127.0.0.1:8080
when the node.js is running as a container within the docker-compose setup does not work (as http://weaviate:8080
should work).
This suggests some form of networking issue. As I mentioned, it works fine on MacOS machines. I’ve tried with node.js versions from 18.16.0 onwards.
These are the error logs:
ERROR error getting User: TypeError: fetch failed
ERROR TypeError: fetch failed
at node:internal/deps/undici/undici:12500:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getUser (file:///app/backend/db/user.js:145:25)
at async file:///app/backend/routes/authRoutes.js:63:22
Server Setup Information
- Weaviate Server Version: 1.24.10 (also tested on 1.24.0)
- Deployment Method: Docker compose. Weaviate is service 1, and the node.js app is a separate service within the same docker-compose file.
- Number of Running Nodes: 1
- Client Language and Version: typescript latest