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

Trouble with install on vanilla Ubuntu 16.04 #23

Closed
tamler opened this issue Oct 29, 2016 · 17 comments
Closed

Trouble with install on vanilla Ubuntu 16.04 #23

tamler opened this issue Oct 29, 2016 · 17 comments

Comments

@tamler
Copy link

tamler commented Oct 29, 2016

Fresh install on Ubuntu 16.04 keeps failing. Logs are empty.
Any suggestion would be greatly appreciated. I'm at a loss for what my error could be.

[email protected] setup /home/prisoner/aiva

bin/setup

Nodejs is already installed
Python3 is already installed
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql is already the newest version (9.5+173).
postgresql-contrib is already the newest version (9.5+173).
The following packages were automatically installed and are no longer required:
libio-string-perl libtimedate-perl
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Postgresql is already started
Pip modules already installed
Npm modules already installed
[Wed Nov 02 2016 09:43:14 GMT-0700 (PDT)] INFO Authenticated database successfully

Sequelize [Node: 6.9.1, CLI: 2.4.0, ORM: 3.24.6]

Loaded configuration file "config/db.json".
Using environment "development".
No migrations were executed, database schema was already up to date.

Sequelize [Node: 6.9.1, CLI: 2.4.0, ORM: 3.24.6]

Loaded configuration file "config/db.json".
Using environment "test".
No migrations were executed, database schema was already up to date.

Sequelize [Node: 6.9.1, CLI: 2.4.0, ORM: 3.24.6]

Loaded configuration file "config/db.json".
Using environment "production".
No migrations were executed, database schema was already up to date.
prisoner@ubuntu:~/aiva$ npm start --debug

[email protected] start /home/prisoner/aiva
bin/start

[ ------- Starting on local machine, not Docker ------- ]

[email protected] development /home/prisoner/aiva
mkdir -p ./logs; NODE_ENV=development ./node_modules/forever/bin/forever --minUptime=1000 --spinSleepTime=1000 --killSignal=SIGTERM --uid aiva-development -m 10 -a index.js | tee ./logs/aiva-development.log

[Wed Nov 02 2016 09:45:16 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #1
[Wed Nov 02 2016 09:45:17 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #2
[Wed Nov 02 2016 09:45:19 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #3
[Wed Nov 02 2016 09:45:20 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #4
[Wed Nov 02 2016 09:45:21 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #5
[Wed Nov 02 2016 09:45:22 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #6
[Wed Nov 02 2016 09:45:23 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #7
[Wed Nov 02 2016 09:45:24 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #8
[Wed Nov 02 2016 09:45:26 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #9
[Wed Nov 02 2016 09:45:27 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0

@tamler tamler closed this as completed Oct 29, 2016
@tamler tamler reopened this Nov 2, 2016
@tamler tamler changed the title Trouble with install on vanilla Ubuntu 14.04 Trouble with install on vanilla Ubuntu 16.04 Nov 2, 2016
@kengz
Copy link
Owner

kengz commented Nov 3, 2016

Hmm, did it just quit directly on npm start --debug? The first it does it to verify the database, a sample full log would start with:

[ ------- Starting on local machine, not Docker ------- ]

> [email protected] development /Users/theredrose/Documents/aiva
> mkdir -p ./logs; NODE_ENV=development ./node_modules/forever/bin/forever --minUptime=1000 --spinSleepTime=1000 --killSignal=SIGTERM --uid aiva-development -m 10 -a index.js | tee ./logs/aiva-development.log

[Thu Nov 03 2016 03:10:06 GMT+0000 (UTC)] INFO Authenticated database successfully
[Thu Nov 03 2016 03:10:08 GMT+0000 (UTC)] DEBUG 
Sequelize [Node: 6.7.0, CLI: 2.4.0, ORM: 3.24.3]

Loaded configuration file "config/db.json".
Using environment "development".
No migrations were executed, database schema was already up to date.

[Thu Nov 03 2016 03:10:08 GMT+0000 (UTC)] INFO Starting aiva process
[Thu Nov 03 2016 03:10:08 GMT+0000 (UTC)] DEBUG globalConfig {
  "BOTNAME": "aivadev",
  "PORTS": {
    "NGROK": "4040-4041",
    "NEO4J": 7476,
    "SOCKETIO": 6466,
    "SLACK": 8345,
    "TELEGRAM": 8443,
    "FB": 8545
  },
...

If so it should still show the database connection failing.

Also quite useful reference is the Ubuntu build on CircleCI itself, step by step:
https://circleci.com/gh/kengz/aiva/94

@tamler
Copy link
Author

tamler commented Nov 3, 2016

I have postgres installed and a password configured and added to the db.json

Here is the output from npm setup:

prisoner@ubuntu:~/aiva$ npm run setup

[email protected] setup /home/prisoner/aiva
bin/setup

Nodejs is already installed
Python3 is already installed
[sudo] password for prisoner:
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql is already the newest version (9.5+173).
postgresql-contrib is already the newest version (9.5+173).
The following packages were automatically installed and are no longer required:
libio-string-perl libtimedate-perl
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Postgresql is already started
Pip modules already installed
Npm modules already installed
[Wed Nov 02 2016 20:20:21 GMT-0700 (PDT)] INFO Authenticated database successfully

Sequelize [Node: 6.9.1, CLI: 2.4.0, ORM: 3.24.6]

Loaded configuration file "config/db.json".
Using environment "development".
No migrations were executed, database schema was already up to date.

Sequelize [Node: 6.9.1, CLI: 2.4.0, ORM: 3.24.6]

Loaded configuration file "config/db.json".
Using environment "test".
No migrations were executed, database schema was already up to date.

Sequelize [Node: 6.9.1, CLI: 2.4.0, ORM: 3.24.6]

Loaded configuration file "config/db.json".
Using environment "production".
No migrations were executed, database schema was already up to date.

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

Yep, that output from bin/setup looks good. It's the output from npm start --debug that seems strange - it should log more instead of just failing straight and retrying. Is that what you get?

@tamler
Copy link
Author

tamler commented Nov 3, 2016

Yeah, I am just copying from the terminal window.
I'll run it again.

prisoner@ubuntu:~/aiva$ npm start --debug

[email protected] start /home/prisoner/aiva
bin/start

[ ------- Starting on local machine, not Docker ------- ]

[email protected] development /home/prisoner/aiva
mkdir -p ./logs; NODE_ENV=development ./node_modules/forever/bin/forever --minUptime=1000 --spinSleepTime=1000 --killSignal=SIGTERM --uid aiva-development -m 10 -a index.js | tee ./logs/aiva-development.log

[Wed Nov 02 2016 20:28:45 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #1
[Wed Nov 02 2016 20:28:47 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #2
[Wed Nov 02 2016 20:28:48 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #3
^C

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

Got your config/default.json configured? As in the Slack tokens etc?

@tamler
Copy link
Author

tamler commented Nov 3, 2016

With the Slack token yes. ngrok is not a requirement correct?

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

Can u try running node index.js and see the log?

@tamler
Copy link
Author

tamler commented Nov 3, 2016

prisoner@ubuntu:~/aiva$ node index.js
[Wed Nov 02 2016 20:42:31 GMT-0700 (PDT)] ERROR

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

Lol that got even weirder. Do a node -v to see the version?

@tamler
Copy link
Author

tamler commented Nov 3, 2016

prisoner@ubuntu:~/aiva$ node -v
v6.9.1

(I've been banging my head against this for a while...)

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

Yep I'm starting to too.
Can u replace src/aiva.js line 47's function with this:


// primary start method
function start() {
  // return authDb()
  return Promise.resolve()
    .then(migrateDb)
    .then(startProcess)
}

Basically trying to see if it's the db. If it logs something then yep

@tamler
Copy link
Author

tamler commented Nov 3, 2016

Change:
}
46
47 // primary start method
48 function start() {
49 //return authDb()
50 return Promise.resolve()
51 .then(migrateDb)
52 .then(startProcess)
53 }
54
55 const cleanExit = () => {

prisoner@ubuntu:~/aiva$ npm start --debug

[email protected] start /home/prisoner/aiva
bin/start

[ ------- Starting on local machine, not Docker ------- ]

[email protected] development /home/prisoner/aiva
mkdir -p ./logs; NODE_ENV=development ./node_modules/forever/bin/forever --minUptime=1000 --spinSleepTime=1000 --killSignal=SIGTERM --uid aiva-development -m 10 -a index.js | tee ./logs/aiva-development.log

[Wed Nov 02 2016 20:55:10 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #1
[Wed Nov 02 2016 20:55:12 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #2
[Wed Nov 02 2016 20:55:13 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #3
[Wed Nov 02 2016 20:55:14 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #4
^C
prisoner@ubuntu:~/aiva$ node index.js
[Wed Nov 02 2016 20:55:32 GMT-0700 (PDT)] ERROR

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

OMG that's just ridiculous. What bout this:

function start() {
  return startProcess()
}

@tamler
Copy link
Author

tamler commented Nov 3, 2016

After the change -

prisoner@ubuntu:~/aiva$ npm start --debug

[email protected] start /home/prisoner/aiva
bin/start

[ ------- Starting on local machine, not Docker ------- ]

[email protected] development /home/prisoner/aiva
mkdir -p ./logs; NODE_ENV=development ./node_modules/forever/bin/forever --minUptime=1000 --spinSleepTime=1000 --killSignal=SIGTERM --uid aiva-development -m 10 -a index.js | tee ./logs/aiva-development.log

[Wed Nov 02 2016 21:15:28 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #1
[Wed Nov 02 2016 21:15:29 GMT-0700 (PDT)] ERROR
error: Forever detected script exited with code: 0
error: Script restart attempt #2
^C
prisoner@ubuntu:/aiva$ node index.js
[Wed Nov 02 2016 21:15:51 GMT-0700 (PDT)] ERROR
prisoner@ubuntu:
/aiva$

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

goddammit found the issue. When doing npm install this error shows up:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

So that causes a module import of CGKB to fail. I'll push a fix to the cgkb branch and it will be ok.
Also since some VMs might be slower, we need to increase the timeout wait on the socketIO server. So look out for that. Refer this: #21 (comment)

Just pushed the fix to the cgkb branch. If you update it shd work now. Also, you may wish to start your neo4j etc. so it can use that extra graph db. Tutorial is here if you don't already know it :)

@kengz
Copy link
Owner

kengz commented Nov 3, 2016

Going to bed, if it still blows up lemme know, will look tmr :)

@tamler
Copy link
Author

tamler commented Nov 3, 2016

Very cool. I will do that. Thanks for the help. I have it up and running with the timeout from #21

@tamler tamler closed this as completed Nov 3, 2016
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