Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem #14

Open
FionaCang opened this issue Mar 10, 2020 · 3 comments
Open

problem #14

FionaCang opened this issue Mar 10, 2020 · 3 comments

Comments

@FionaCang
Copy link

Hello , thank you for your project, i really like this case. But there some problems for me.

./init.sh

When i run this ./init.sh first , there some problems:

Start sync process
(node:20467) UnhandledPromiseRejectionWarning: RequestError: Error: socket hang up
at new RequestError (/home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/request/request.js:185:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at Request.onRequestError (/home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/request/request.js:881:8)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at Socket.socketOnEnd (_http_client.js:423:9)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
(node:20467) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20467) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

node ./node_modules/sails/bin/sails.js l --redis --safe

When i run this first, i got this problem :

info: Starting app...
error: A hook (userconfig) failed to load!
error:
error: Attempted to require('/home/fabric/Hyperledger/airmedfoundation-terminal/config/datastores.js'), but an error occurred:

Error: Cannot find module '../appconfig.json'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/home/fabric/Hyperledger/airmedfoundation-terminal/config/datastores.js:15:14)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at /home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/include-all/lib/help-include-all-sync.js:293:33
at Array.forEach ()
at _recursivelyIncludeAll (/home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/include-all/lib/help-include-all-sync.js:178:11)
at includeAll (/home/fabric/Hyperledger/airmedfoundation-terminal/node_modules/include-all/lib/help-include-all-sync.js:317:5)

error: Could not load Sails app.
error:
error: Tips:
error: • First, take a look at the error message above.
error: • Make sure you've installed dependencies with npm install.
error: • Check that this app was built for a compatible version of Sails.
error: • Have a question or need help? (http://sailsjs.com/support)

I had try different nodejs version, but i can't solve those problems. Cloud you give me some suggestions? Looking forward to your reply. Thank you very much.

@Alex99y
Copy link
Contributor

Alex99y commented Mar 18, 2020

Hi Fiona! You need to setup the config file, and this mustbe in the root directory of the project.
appconfig.json
{ "email": { "admin":"admin_email@gmail.com", "auth": { "user": "admin_email@gmail.com", "pass": "password" }, "service": "Gmail", "emailVerification": 1 }, "database": { "adapter": "sails-postgresql", "user": "admin", "password": "adminpassword", "port": "5432", "host": "localhost", "database": "airmed" }, "session": { "name": "sails.sid", "secret": "secretKey", "redis": { "url": "redis://: redisPassword@127.0.0.1.com:6379/15", "host": "127.0.0.1", "port": 6379, "pass": "redisPassword", "db": 15 } }, "ipfs": { "host":"127.0.0.1", "port":"5001" } }

The sync process should start after sails.

@FionaCang
Copy link
Author

Hi Alex99y, I appreciate your reply very much.
But when I run "node ./node_modules/sails/bin/sails.js l --redis --safe " , I got a new problem :

events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EACCES 0.0.0.0:80
at Server.setupListenHandle [as _listen2] (net.js:1343:19)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at Object.module.exports.bootstrap (/home/yu/Code/airmedfoundation-terminal/config/bootstrap.js:17:48)
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/lib/app/private/bootstrap.js:71:34
at Sails.runBootstrap (/home/yu/Code/airmedfoundation-terminal/node_modules/sails/lib/app/private/bootstrap.js:97:5)
at Sails.wrapper [as runBootstrap] (/home/yu/Code/airmedfoundation-terminal/node_modules/@sailshq/lodash/lib/index.js:3275:19)
at Sails.initialize (/home/yu/Code/airmedfoundation-terminal/node_modules/sails/lib/app/private/initialize.js:67:9)
at Sails.wrapper [as initialize] (/home/yu/Code/airmedfoundation-terminal/node_modules/@sailshq/lodash/lib/index.js:3275:19)
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/lib/app/lift.js:63:13
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:3853:24
at replenish (/home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:946:17)
at iterateeCallback (/home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:931:17)
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:906:16
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:3858:13
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/lib/app/load.js:279:13
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:421:16
at processQueue (/home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:1565:20)
at taskComplete (/home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:1588:9)
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:1612:17
at /home/yu/Code/airmedfoundation-terminal/node_modules/sails/node_modules/async/dist/async.js:906:16
at Router.load (/home/yu/Code/airmedfoundation-terminal/node_modules/sails/lib/router/index.js:144:3)

I have edited config/policies.js file, added "//" .
And there is not useful to change port. Could you give me more suggestion?
I am looking forward to your reply~
Thank you very much

@Alex99y
Copy link
Contributor

Alex99y commented Mar 20, 2020

Dont forget to use port 80 you need root access. Try using the PORT environment variable to change the port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants