# 'EAI\_AGAIN' error while setting the docs example up with a could instance. Javascript, Node

**URL:** <https://forum.weaviate.io/t/eai-again-error-while-setting-the-docs-example-up-with-a-could-instance-javascript-node/609>\
**Category:** Support\
**Created:** [September 4, 2023, 9:59am UTC](https://forum.weaviate.io/t/eai-again-error-while-setting-the-docs-example-up-with-a-could-instance-javascript-node/609 "2023-09-04T09:59:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.weaviate.io/u/Robert)\
**Post date:** [September 4, 2023, 9:59am UTC](https://forum.weaviate.io/t/eai-again-error-while-setting-the-docs-example-up-with-a-could-instance-javascript-node/609/1 "2023-09-04T09:59:28Z")

</div>

Error stack:

FetchError: request to [https://https//bbb-328x3047.weaviate.network/v1/schema](https://https//bbb-328x3047.weaviate.network/v1/schema) failed, reason: getaddrinfo EAI\_AGAIN https  
at ClientRequest. (/var/www/html/app/node\_modules/node-fetch/lib/index.js:1505:11)  
at ClientRequest.emit (node:events:513:28)  
at TLSSocket.socketErrorListener (node:\_http\_client:502:9)  
at TLSSocket.emit (node:events:513:28)  
at emitErrorNT (node:internal/streams/destroy:151:8)  
at emitErrorCloseNT (node:internal/streams/destroy:116:3)  
at process.processTicksAndRejections (node:internal/process/task\_queues:82:21) {  
type: ‘system’,  
errno: ‘EAI\_AGAIN’,  
code: ‘EAI\_AGAIN’  
}

This is the only code I have.

const client = weaviate.client({  
scheme: “https”,  
host: “[https://bbb-328x3047.weaviate.network](https://bbb-328x3047.weaviate.network)”,  
apiKey: “API KEY”  
});

```
const className = 'Question';
const classObj = {
    class: className,
    vectorizer: 'text2vec-openai',
};

let result = await client.schema.classCreator().withClass(classObj).do();

console.log(JSON.stringify(result, null, 2));

```

The step generating the error is the let result line. The client variable seems to be holding the db object.

I’m new to weaviate. If anyone has a working example of Javascript code with a connection to the database, adding a schema, and doing a simple search that would be great.

Thanks

---

<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:** [September 4, 2023, 3:22pm UTC](https://forum.weaviate.io/t/eai-again-error-while-setting-the-docs-example-up-with-a-could-instance-javascript-node/609/2 "2023-09-04T15:22:45Z")

</div>

Hi! Welcome to our community 🤗

The issue here is that you are providing the schema together with the hostname.

Try this:

```auto
const client = weaviate.client({
scheme: “https”,
host: “bbb-328x3047.weaviate.network”,
apiKey: “API KEY”
});

```

Let me know if this helps 🙂

---

<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:** [September 4, 2023, 3:23pm UTC](https://forum.weaviate.io/t/eai-again-error-while-setting-the-docs-example-up-with-a-could-instance-javascript-node/609/3 "2023-09-04T15:23:59Z")

</div>

Ah, and regarding examples, check out our examples repository:

> <https://github.com/weaviate/weaviate-examples/blob/main/README.md>
