watson-developer-cloud / discovery-nodejs

This is a deprecated Watson Discovery Service Demo. A link to the newly supported demo is below
https://www.ibm.com/demos/live/watson-discovery/self-service
MIT License
76 stars 178 forks source link

Demo code fails to start on IBM Cloud #114

Closed donovat closed 5 years ago

donovat commented 5 years ago

Hi Steps:

  1. Cloned github 'discovery-nodejs' code to local machine.
  2. Created .env file and edited to include required 'Discovery service' elements.
  3. Edited manifest.yml file to include my discovery service, and application name, etc.
  4. ran "cf push" to upload code into my ibm cloud space.
  5. Application starts then crash with following error;
    2018-10-31T07:36:33.45+0000 [APP/PROC/WEB/0]OUT Server running on port: 8080
    2018-10-31T07:36:33.45+0000 [APP/PROC/WEB/0]OUT ERROR: Error: spawn ./node_modules/react-scripts/bin/react-scripts.js ENOENT
    2018-10-31T07:36:33.56+0000 [APP/PROC/WEB/0]OUT Exit status 0
    2018-10-31T07:36:33.58+0000 [CELL/SSHD/0]OUT Exit status 0
    2018-10-31T07:36:33.61+0000 [CELL/0]     OUT Cell a7187c69-5c2d-412a-960d-687d643f9e53 stopping instance 9c569aa7-1d9f-4d57-7e85-5a71
    2018-10-31T07:36:33.61+0000 [CELL/0]     OUT Cell a7187c69-5c2d-412a-960d-687d643f9e53 destroying container for instance 9c569aa7-1d9f-4d57-7e85-5a71
    2018-10-31T07:36:33.66+0000 [API/7]      OUT App instance exited with guid 5cbabf15-a6ea-4bbe-8ed0-9798a3df4229 payload: {"instance"=>"9c569aa7-1d9f-4d57-7e85-5a71", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Codependent step exited", "crash_count"=>61, "crash_timestamp"=>1540971393597529186, "version"=>"9f76e2e9-7d63-4800-ac43-c09ea0de71d0"}
    2018-10-31T07:36:40.24+0000 [CELL/0]     OUT Cell a7187c69-5c2d-412a-960d-687d643f9e53 successfully destroyed container for instance 9c569aa7-1d9f-4d57-7e85-5a71
    2018-10-31T07:52:39.45+0000 [CELL/0]     OUT Cell 38493bb6-b0fc-4c81-a0ef-05c0416d2c3e creating container for instance f101cfcd-e4cb-
  6. Tried some of the fixes detailed in #89 issue, but these also failed.
germanattanasio commented 5 years ago

Try changing the command: in the manifest.yml file to:

command: node server.js
donovat commented 5 years ago

Hi @germanattanasio I have applied the suggestion you mention to the manifest.yml file. However, it has not fixed the issue. I get the following in the browser; 502 Bad Gateway: Registered endpoint failed to handle the request.

And the following in the cloud application logs;

2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR RangeError: Invalid status code: ENOENT
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at ServerResponse.writeHead (_http_server.js:194:11)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at ServerResponse.writeHead (/home/vcap/app/node_modules/on-headers/index.js:55:19)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at ServerResponse._implicitHeader (_http_server.js:185:8)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at write_ (_http_outgoing.js:632:9)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at ServerResponse.end (_http_outgoing.js:751:5)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at ServerResponse.send (/home/vcap/app/node_modules/express/lib/response.js:221:10)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at ServerResponse.json (/home/vcap/app/node_modules/express/lib/response.js:267:15)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at app.use (/home/vcap/app/config/error-handler.js:17:28)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at Layer.handle_error (/home/vcap/app/node_modules/express/lib/router/layer.js:71:5)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]ERR     at trim_prefix (/home/vcap/app/node_modules/express/lib/router/index.js:315:13)
2018-11-02T23:17:13.01+0000 [APP/PROC/WEB/0]OUT GET / 500 10.660 ms - 148
germanattanasio commented 5 years ago

I'm going to spend some time this weekend and let you know what I find

donovat commented 5 years ago

Sorry the updated code does not seem to fix the issue. Still seeing the errors above when I try and open the initial app page.

watson-github-bot commented 5 years ago

:tada: This issue has been resolved in version 1.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: