# Unable to add source engine to a meta-engine

**URL:** <https://discuss.elastic.co/t/unable-to-add-source-engine-to-a-meta-engine/308848>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [July 5, 2022, 4:11am UTC](https://discuss.elastic.co/t/unable-to-add-source-engine-to-a-meta-engine/308848 "2022-07-05T04:11:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aniket\_todoroki](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@aniket\_todoroki](https://discuss.elastic.co/u/aniket_todoroki)\
**Post date:** [July 5, 2022, 4:11am UTC](https://discuss.elastic.co/t/unable-to-add-source-engine-to-a-meta-engine/308848/1 "2022-07-05T04:11:09Z")

</div>

Hi I'm trying to add a source-engine to my meta-engine but having this error

I'm using the version shown below.

```auto
    "@elastic/app-search-node": "^7.12.0",

```

Can anyone let me know what I'm doing wrong here.

```auto
Error: Not Found
    at Request._callback (/home/ctp/git/nodejs-backend/node_modules/@elastic/app-search-node/lib/client.js:95:26)
    at Request.self.callback (/home/ctp/git/nodejs-backend/node_modules/request/request.js:185:22)
    at Request.emit (node:events:527:28)
    at Request.<anonymous> (/home/ctp/git/nodejs-backend/node_modules/request/request.js:1154:10)
    at Request.emit (node:events:527:28)
    at IncomingMessage.<anonymous> (/home/ctp/git/nodejs-backend/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (node:events:641:28)
    at IncomingMessage.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errorMessages: ['Not Found']

```

```auto
const AppSearchClient = require("@elastic/app-search-node");
const private_key = process.env.elastic_private_key;
const search_key = process.env.elastic_search_key;
const baseUrlFn = () => " ";
const client = new AppSearchClient(undefined, private_key, baseUrlFn);

```

Here is my code.

```auto
const AppSearchClient = require("@elastic/app-search-node");
const private_key = process.env.elastic_private_key;
const search_key = process.env.elastic_search_key;
const baseUrlFn = () => "https://my-deployment-a685d4.kb.us-central1.gcp.cloud.es.io:9243/internal/app_search/engines";
const client = new AppSearchClient(undefined, private_key, baseUrlFn);

addSourceEng(metaName, source_engine) {
    client
      .addMetaEngineSources('all', [source_engine])

      .then((response) => console.log(response))
      .catch((error) => console.log(error))

  }

```

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [July 6, 2022, 3:00pm UTC](https://discuss.elastic.co/t/unable-to-add-source-engine-to-a-meta-engine/308848/2 "2022-07-06T15:00:50Z")

</div>

> const baseUrlFn = () =\> "[https://my-deployment-a685d4.kb.us-central1.gcp.cloud.es.io:9243/internal/app\_search/engines](https://my-deployment-a685d4.kb.us-central1.gcp.cloud.es.io:9243/internal/app_search/engines)";

This looks too long. If you navigate to the "Credentials" tab in the App Search UI it should give you the correct base URL to use here.

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [July 6, 2022, 3:01pm UTC](https://discuss.elastic.co/t/unable-to-add-source-engine-to-a-meta-engine/308848/3 "2022-07-06T15:01:11Z")

</div>

I'm guessing it would be:

> [https://my-deployment-a685d4.kb.us-central1.gcp.cloud.es.io:9243](https://my-deployment-a685d4.kb.us-central1.gcp.cloud.es.io:9243)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 3, 2022, 3:01pm UTC](https://discuss.elastic.co/t/unable-to-add-source-engine-to-a-meta-engine/308848/4 "2022-08-03T15:01:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
