Talk: Failed start up following instructions in docs

Created on 3 Mar 2020  路  6Comments  路  Source: coralproject/talk

Expected behavior: System startup on localhost:3000

Actual behavior:

Secure Connection Failed

First, I tried starting up with docker-compose. I used the exact yml file given in the instructions, with the SIGNING_SECRET set:

version: "2"
services:
  talk:
    image: coralproject/talk:5
    restart: always
    ports:
      - "127.0.0.1:3000:5000"
    depends_on:
      - mongo
      - redis
    environment:
      - MONGODB_URI=mongodb://mongo:27017/coral
      - REDIS_URI=redis://redis:6379
      - SIGNING_SECRET="keyboard cat"
  mongo:
    image: mongo:4.2
    volumes:
      - ./data/mongo:/data/db
  redis:
    image: redis:3.2
    volumes:
      - ./data/redis:/data

Running docker-compose up prints what looks like normal output. Here are the last few lines to demonstrate:

mongo_1  | 2020-03-03T15:28:58.288+0000 I  NETWORK  [listener] connection accepted from 172.20.0.4:42320 #5 (5 connections now open)
mongo_1  | 2020-03-03T15:28:58.300+0000 I  NETWORK  [conn5] received client metadata from 172.20.0.4:42320 conn5: { driver: { name: "nodejs", version: "3.2.7" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.19.76-linuxkit" }, platform: "Node.js v12.15.0, LE, mongodb-core: 3.2.7" }
talk_1   | {"name":"coral","clusterNode":"worker.1","hostname":"63a5c7a35396","pid":29,"level":30,"queries":114,"msg":"loaded persisted queries","time":"2020-03-03T15:28:58.423Z","src":{"file":"/usr/src/app/src/core/server/graph/persisted/loader.ts","line":65,"func":"info"},"v":0}
talk_1   | {"name":"coral","clusterNode":"worker.1","hostname":"63a5c7a35396","pid":29,"level":30,"port":5000,"msg":"now listening","time":"2020-03-03T15:28:58.587Z","src":{"file":"/usr/src/app/src/core/server/index.ts","line":365,"func":"info"},"v":0}

I get the "Secure Connection Failed" message from Firefox when trying to connect to localhost:3000, with the following error:

An error occurred during a connection to localhost:3000. SSL received a record that exceeded the maximum permissible length.

Error code: SSL_ERROR_RX_RECORD_TOO_LONG

The browser won't let me switch from https to http, and other browsers (Safari, Chrome) do not work either.

npm ERR! code ELIFECYCLE

I then tried installation by cloning the source code. After running npm install (which leaves me with an alarming number of vulnerabilities), I run npm run build as per the docs. I get the following error:

[10:58:55] Using gulpfile ~/MRCL/spikes/coral/talk/gulpfile.js
[10:58:55] Starting 'server'...
[10:58:55] Starting 'server:schema'...
[10:58:55] 'server:schema' errored after 191 ms
[10:58:55] TypeError: this.outputPath.endsWith is not a function
    at TypeScriptGenerator.generateEnumType (/Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:123:32)
    at /Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:62:78
    at Array.reduce (<anonymous>)
    at TypeScriptGenerator.<anonymous> (/Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:53:48)
    at step (/Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:32:23)
    at Object.next (/Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:13:53)
    at /Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:3:12)
    at TypeScriptGenerator.generate (/Users/jorlevy/MRCL/spikes/coral/talk/node_modules/graphql-schema-typescript/lib/typescriptGenerator.js:47:16)
[10:58:55] 'server' errored after 193 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @coralproject/[email protected] build:server: `gulp server`
npm ERR! Exit status 1

It feels like I am missing some dependency or have a bad version, but that should be a non-issue in Docker, and I have followed the docs closely. I even tried a different (almost identical) computer but did not get any different results.

I suspected that something was wrong with the SIGNING_SECRET, so I tried adding NODE_ENV=development to docker-compose.yml, but the logs still show the following:

talk_1   | > NODE_ENV=production node dist/index.js

It seems my environment is getting ignored? Not sure if this is related to the other issues.

Versions:

  • NodeJS: 6.13.7
  • NPM: 13.9.0 (stable from NVM)
  • MongoDB: 4.2
  • Redis: 3.2
  • Browser: Firefox 73.0.1
  • OS: MacOS 10.14.6
bug

Most helpful comment

If you're encountering SSL issues, add the following env
- DISABLE_FORCE_SSL=true
And access http://127.0.0.1:3000/ use a private instance if the browser redirects you to the https.

All 6 comments

The default command used by Coral in production containers is npm run start, which adds the production environment variable there. You can swap that out by adding a:

command: node dist/index.js

Note that you should not run this in production, as lots of security features are turned off.

If you're encountering SSL issues, add the following env
- DISABLE_FORCE_SSL=true
And access http://127.0.0.1:3000/ use a private instance if the browser redirects you to the https.

If you're encountering SSL issues, add the following env

  • DISABLE_FORCE_SSL=true
    And access http://127.0.0.1:3000/ use a private instance if the browser redirects you to the https.

Thanks @pe3sos this fixed it

I got this issue too. Worth adding something about this in the docs?

Nope, the bug is in npm scripts, in package.json:
"start": "NODE_ENV=production node dist/index.js"
NODE_ENV will be permanently overridden.
So to fix this either remove NODE_ENV variable or add to your docker talk service following line:
command: ["/usr/local/bin/node", "dist/index.js"]

Thanks for the feedback regarding developer instructions with Coral! We'll be making a pass this week on improving this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattlinares picture mattlinares  路  3Comments

cristiandean picture cristiandean  路  5Comments

schwabing picture schwabing  路  5Comments

deepaksisodiya picture deepaksisodiya  路  5Comments

allanassis picture allanassis  路  3Comments