# Odyssey Voyage II - Monolith graph setup

**URL:** <https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889>\
**Category:** Other Apollo Topics\
**Tags:** odyssey\
**Created:** [March 7, 2023, 1:20pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889 "2023-03-07T13:20:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_mogio](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@r\_mogio](https://community.apollographql.com/u/r_mogio)\
**Post date:** [March 7, 2023, 1:20pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/1 "2023-03-07T13:20:00Z")

</div>

Hello all!

I’m trying to get setup for Odyssey Voyage II, and it seems to be broken. I’m following the steps described on video/tutorial but it is failing over and over.

Steps to reproduce:  
1 - clone the repo at `git clone https://github.com/apollographql/odyssey-voyage-II-server`  
2 - navigate to `monolith` folder, and install its dependencies by running `npm install`  
3 - yet in `monolith` folder, run `npm run launch` - as the tutorial said, it should start the application with all “subgraphs”  
4 - Run an example query

On step 3, I’m getting this error:

 ![Screenshot from 2023-03-07 10-18-37](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/8/88513eca4a13b532b38513b16ebf578eb9e461d4.png)

If i ignore this error, and try to run the query, I get this error here:

```json
 "data": {},
  "errors": [
    {
      "message": "request to http://localhost:4010/listing/amenities failed, reason: connect ECONNREFUSED 127.0.0.1:4010",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "listingAmenities"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "stacktrace": [
          "FetchError: request to http://localhost:4010/listing/amenities failed, reason: connect ECONNREFUSED 127.0.0.1:4010",
          " at ClientRequest.<anonymous> (/home/rmogio/projects/learning/apollo-professional/odyssey-voyage-II-server/monolith/node_modules/node-fetch/lib/index.js:1491:11)",
          " at ClientRequest.emit (node:events:513:28)",
          " at Socket.socketErrorListener (node:_http_client:481:9)",
          " at Socket.emit (node:events:513:28)",
          " at emitErrorNT (node:internal/streams/destroy:157:8)",
          " at emitErrorCloseNT (node:internal/streams/destroy:122:3)",
          " at processTicksAndRejections (node:internal/process/task_queues:83:21)"
        ]
      }
    }
  ]

```

All steps can be found here: [https://www.apollographql.com/tutorials/voyage-part2/02-monolith-graph-setup](https://www.apollographql.com/tutorials/voyage-part2/02-monolith-graph-setup)

Does anyone have a clue why I’m getting these errors?

---

<div class="post-metadata">

**Author:** ![lizhennessy](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lizhennessy/32/3894_2.png) [@lizhennessy](https://community.apollographql.com/u/lizhennessy)\
**Post date:** [March 7, 2023, 2:45pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/2 "2023-03-07T14:45:08Z")

</div>

Hi there, @r_mogio ! Thanks for reaching out - and I’m sorry that you’re running into this error! Could you let me know which versions of Node and npm you’re currently running? I’ll take a deeper look and see if I can reproduce this error you’re seeing.

---

<div class="post-metadata">

**Author:** ![r\_mogio](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@r\_mogio](https://community.apollographql.com/u/r_mogio)\
**Post date:** [March 7, 2023, 2:57pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/3 "2023-03-07T14:57:39Z")

</div>

hello @lizhennessy !  
Sure, they are:  
node: v16.17.0  
npm: 8.15.0

---

<div class="post-metadata">

**Author:** ![lizhennessy](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lizhennessy/32/3894_2.png) [@lizhennessy](https://community.apollographql.com/u/lizhennessy)\
**Post date:** [March 8, 2023, 4:39pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/4 "2023-03-08T16:39:19Z")

</div>

Thanks @r_mogio ! Looks like that’s probably not the issue.

I can see that the error is coming from the `index.js` file in `services/listings/sequelize/models/index.js`. There, we’re looking up some configuration details based on the Node environment (which should default to “development” when running locally). I’m curious to see what’s being generated here, as it appears to be coming back as undefined.

In the `services/listings/sequelize/models/index.js` file, would you add a `console.log` statement just below line 8, like so:

```auto
// start of the file....

const env = process.env.NODE_ENV || "development";
const config = require(__dirname + "/../config/config.json")[env];
console.log({ config, __dirname, env });

```

It looks like somewhere along the way we’re not properly accessing those `config` variables, and I think this will get us closer to uncovering why! With this line in place, you can then run `npm run launch` and see what kind of output we get in the console.

Looking forward to hearing back!

Liz

---

<div class="post-metadata">

**Author:** ![r\_mogio](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@r\_mogio](https://community.apollographql.com/u/r_mogio)\
**Post date:** [March 8, 2023, 9:43pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/5 "2023-03-08T21:43:03Z")

</div>

hello @lizhennessy , and thanks for your help!

This is what I’m getting on terminal by logging what you asked:

```plaintext
[listings] CONFIG {
[listings] config: undefined,
[listings] __dirname: '/home/rmogio/projects/learning/odyssey-voyage-II-server/services/listings/sequelize/models',
[listings] env: 'local'
[listings] }

```

![image](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/1/15c1c356d43f142d48688344c0f22c6124553ab9.png)

---

<div class="post-metadata">

**Author:** ![lizhennessy](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lizhennessy/32/3894_2.png) [@lizhennessy](https://community.apollographql.com/u/lizhennessy)\
**Post date:** [March 8, 2023, 10:56pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/6 "2023-03-08T22:56:18Z")

</div>

Aha! Thank you - I think we may have found our issue. Right now the `/../config/config.json` file shown on line 8 is looking specifically for a `NODE_ENV` called “development”, and it’s not finding any config information for one called “local”. Would you jump into that file - specifically, its path is `services/listings/sequelize/config/config.json` - and update the JSON object to look up “local” rather than “development”, like so:

```auto
{
  "local": {
    "username": "root",
    "password": null,
    "database": "database_development",
    "dialect": "sqlite",
    "storage": "./listings.db"
  }
}

```

Then we can try it again and see if we have any luck getting those `config` options back!

Liz

---

<div class="post-metadata">

**Author:** ![r\_mogio](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@r\_mogio](https://community.apollographql.com/u/r_mogio)\
**Post date:** [April 25, 2023, 11:56pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/7 "2023-04-25T23:56:10Z")

</div>

hello @lizhennessy , so sorry for this long delay 😄  
good news, now it is working! Thanks again for your help

---

<div class="post-metadata">

**Author:** ![xibaozhi0](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/xibaozhi0/32/4318_2.png) [@xibaozhi0](https://community.apollographql.com/u/xibaozhi0)\
**Post date:** [May 26, 2023, 6:34am UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/8 "2023-05-26T06:34:23Z")

</div>

sorry, put in in a wrong place

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/odyssey-voyage-ii-monolith-graph-setup/5889/9 "2025-02-06T20:48:48Z")

</div>

Archived on February 6, 2025, 8:48pm UTC


