hiddentao / ansijet

Ansible playbook automation server
http://hiddentao.github.io/ansijet
MIT License
110 stars 20 forks source link

Failing to insert playbooks into DB #11

Open dbousamra opened 9 years ago

dbousamra commented 9 years ago

Hi,

I spent about 30 mins trying to install Ansijet with my infrastructure and couldn't get it working. Server starts up, but when I try to GET playbooks/:playbook_name I receive a 404.

Examining the code, it never seems to execute the setupAnsible.js startup code. The only logs I receive are:

2014-11-06T00:06:41.263Z - debug: Notifying admins that we have started up

My config is pretty standard - just specifying a playbooks directory. I have mongodb running on localhost.

hiddentao commented 9 years ago

That's strange. Can you try running like this:

$ NODE_ENV=production DEBUG=waigo* ./start-app.js

This should hopefully output a tonne of debugging info as to what startup steps are getting run when.

dbousamra commented 9 years ago

Here's the result of running with DEBUG flag.

  waigo-loader Getting plugin names... +0ms
  waigo-loader Plugins to load: waigo-mongo, waigo-method-override +17ms
  waigo-loader Module "application" will be loaded from source "waigo" +19ms
  waigo-loader Module "loader" will be loaded from source "waigo" +0ms
  waigo-loader Module "routes" will be loaded from source "app" +0ms
  waigo-loader Module "cli/init" will be loaded from source "waigo" +0ms
  waigo-loader Module "config/base" will be loaded from source "app" +0ms
  waigo-loader Module "config/development" will be loaded from source "waigo" +1ms
  waigo-loader Module "config/index" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/cliCommand" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/errors" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/mixins" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/routeMapper" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/underscore" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/forms/field" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/forms/form" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/logging/winston" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/middleware/bodyParser" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/middleware/errorHandler" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/middleware/outputFormats" will be loaded from source "waigo" +1ms
  waigo-loader Module "support/middleware/sessions" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/middleware/staticResources" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/outputFormats/html" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/outputFormats/json" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/shutdown/listener" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/startup/database" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/startup/listener" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/startup/logging" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/startup/middleware" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/startup/models" will be loaded from source "app" +0ms
  waigo-loader Module "support/startup/routes" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/forms/fields/select" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/forms/fields/text" will be loaded from source "waigo" +0ms                                                                                                                                                                                                                           
  waigo-loader Module "support/forms/sanitizers/trim" will be loaded from source "waigo" +1ms
  waigo-loader Module "support/forms/validators/isEmailAddress" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/forms/validators/notEmpty" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/session/store/cookie" will be loaded from source "waigo" +0ms
  waigo-loader Module "support/db/mongo" will be loaded from source "waigo-mongo" +0ms
  waigo-loader Module "support/session/store/mongo" will be loaded from source "waigo-mongo" +0ms
  waigo-loader Module "support/middleware/methodOverride" will be loaded from source "waigo-method-override" +0ms
  waigo-loader Module "config/production" will be loaded from source "app" +0ms
  waigo-loader Module "controllers/jobs" will be loaded from source "app" +0ms
  waigo-loader Module "controllers/logs" will be loaded from source "app" +0ms
  waigo-loader Module "controllers/main" will be loaded from source "app" +0ms
  waigo-loader Module "controllers/playbooks" will be loaded from source "app" +0ms
  waigo-loader Module "controllers/triggers" will be loaded from source "app" +1ms
  waigo-loader Module "forms/addTrigger" will be loaded from source "app" +0ms
  waigo-loader Module "models/job" will be loaded from source "app" +0ms
  waigo-loader Module "models/log" will be loaded from source "app" +0ms
  waigo-loader Module "models/playbook" will be loaded from source "app" +0ms
  waigo-loader Module "models/trigger" will be loaded from source "app" +0ms
  waigo-loader Module "support/exec-then" will be loaded from source "app" +0ms
  waigo-loader Module "support/timers" will be loaded from source "app" +0ms
  waigo-loader Module "support/triggerType" will be loaded from source "app" +0ms
  waigo-loader Module "support/urlUtils" will be loaded from source "app" +0ms
  waigo-loader Module "triggerTypes/drone" will be loaded from source "app" +0ms
  waigo-loader Module "triggerTypes/simple" will be loaded from source "app" +0ms
  waigo-loader Module "support/notifications/hipChat" will be loaded from source "app" +0ms
  waigo-loader Module "support/shutdown/cleanupResources" will be loaded from source "app" +0ms
  waigo-loader Module "support/startup/notifyAdminsOfStartup" will be loaded from source "app" +1ms
  waigo-loader Module "support/startup/setupAnsible" will be loaded from source "app" +0ms
  waigo-loader Module "support/startup/setupNotifications" will be loaded from source "app" +0ms
  waigo-loader Module "support/startup/setupTemplateHelpers" will be loaded from source "app" +0ms
  waigo-loader Module "support/startup/setupTriggerTypes" will be loaded from source "app" +0ms
  waigo-loader Module "support/startup/startJobProcessor" will be loaded from source "app" +0ms
  waigo-loader Module "support/db/mongoose/schema" will be loaded from source "app" +0ms
  waigo-loader Loading module "application" from source "waigo" +1ms
  waigo-loader Loading module "support/underscore" from source "waigo" +80ms
  waigo-app Loading configuration +0ms
  waigo-loader Loading module "config/index" from source "waigo" +2ms
  waigo-loader Loading module "config/base" from source "app" +2ms
  waigo-loader Loading module "config/base" from source "waigo" +1ms
  waigo-loader Loading module "config/production" from source "app" +1ms
  waigo-app Running startup step: logging +5ms
  waigo-loader Loading module "support/startup/logging" from source "waigo" +0ms
  waigo-startup-logging Setting up logger: winston +0ms
  waigo-loader Loading module "support/logging/winston" from source "waigo" +2ms
  waigo-app Running startup step: middleware +29ms
  waigo-loader Loading module "support/startup/middleware" from source "waigo" +27ms
  waigo-startup-middleware Setting up middleware: errorHandler +0ms
  waigo-loader Loading module "support/middleware/errorHandler" from source "waigo" +1ms
  waigo-loader Loading module "support/errors" from source "waigo" +2ms
  waigo-loader Loading module "support/mixins" from source "waigo" +2ms
  waigo-loader Loading module "support/mixins" from source "waigo" +1ms
  waigo-startup-middleware Setting up middleware: staticResources +6ms
  waigo-loader Loading module "support/middleware/staticResources" from source "waigo" +1ms
  waigo-startup-middleware Setting up middleware: methodOverride +13ms
  waigo-loader Loading module "support/middleware/methodOverride" from source "waigo-method-override" +13ms
  waigo-startup-middleware Setting up middleware: outputFormats +3ms
  waigo-loader Loading module "support/middleware/outputFormats" from source "waigo" +3ms
  waigo-loader Loading module "support/errors" from source "waigo" +7ms
  waigo-loader Loading module "support/mixins" from source "waigo" +1ms
  waigo-loader Loading module "support/outputFormats/html" from source "waigo" +0ms
  waigo-loader Loading module "support/outputFormats/json" from source "waigo" +3ms
  waigo-loader Loading module "support/errors" from source "waigo" +1ms
  waigo-startup-middleware Setting up middleware: sessions +13ms
  waigo-loader Loading module "support/middleware/sessions" from source "waigo" +1ms
  waigo-loader Loading module "application" from source "waigo" +4ms
  waigo-loader Loading module "support/session/store/cookie" from source "waigo" +1ms
  waigo-app Running startup step: database +44ms
  waigo-loader Loading module "support/startup/database" from source "waigo" +3ms
  waigo-startup-database Setting up database connection : mongo +0ms
  waigo-loader Loading module "support/db/mongo" from source "waigo-mongo" +1ms
  waigo-mongo mongodb://127.0.0.1:27017/ansijet +0ms
  waigo-mongo Connection succeeded +24ms
  waigo-app Running startup step: models +245ms
  waigo-loader Loading module "support/startup/models" from source "app" +244ms
  waigo-loader Loading module "models/job" from source "app" +3ms
  waigo-loader Loading module "support/db/mongoose/schema" from source "app" +5ms
  waigo-loader Loading module "support/mixins" from source "waigo" +3ms
  waigo-loader Loading module "support/exec-then" from source "app" +0ms
  waigo-loader Loading module "support/timers" from source "app" +38ms
  waigo-loader Loading module "models/log" from source "app" +8ms
  waigo-loader Loading module "support/db/mongoose/schema" from source "app" +0ms
  waigo-loader Loading module "models/playbook" from source "app" +2ms
  waigo-loader Loading module "support/db/mongoose/schema" from source "app" +4ms
  waigo-loader Loading module "models/trigger" from source "app" +5ms
  waigo-loader Loading module "support/db/mongoose/schema" from source "app" +0ms
  waigo-loader Loading module "support/exec-then" from source "app" +1ms
  waigo-app Running startup step: routes +70ms
  waigo-loader Loading module "support/startup/routes" from source "waigo" +1ms
  waigo-startup-routes Setting up routes +0ms
  waigo-loader Loading module "routes" from source "app" +17ms
  waigo-loader Loading module "support/routeMapper" from source "waigo" +1ms
  waigo-loader Loading module "support/errors" from source "waigo" +2ms
  waigo-loader Loading module "controllers/playbooks" from source "app" +1ms
  waigo-loader Loading module "support/errors" from source "waigo" +3ms
  waigo-loader Loading module "support/forms/form" from source "waigo" +0ms
  waigo-loader Loading module "support/errors" from source "waigo" +2ms
  waigo-loader Loading module "support/forms/field" from source "waigo" +1ms
  waigo-loader Loading module "support/errors" from source "waigo" +3ms
  waigo-loader Loading module "support/mixins" from source "waigo" +0ms
  waigo-loader Loading module "support/mixins" from source "waigo" +2ms
  waigo-loader Loading module "support/middleware/bodyParser" from source "waigo" +0ms
  waigo-loader Loading module "support/middleware/bodyParser" from source "waigo" +18ms
  waigo-loader Loading module "controllers/triggers" from source "app" +0ms
  waigo-loader Loading module "support/errors" from source "waigo" +1ms
  waigo-loader Loading module "controllers/jobs" from source "app" +0ms
  waigo-loader Loading module "support/errors" from source "waigo" +1ms
  waigo-loader Loading module "controllers/logs" from source "app" +0ms
  waigo-loader Loading module "controllers/main" from source "app" +1ms
  waigo-app Running startup step: setupNotifications +60ms
  waigo-loader Loading module "support/startup/setupNotifications" from source "app" +8ms
  waigo-loader Loading module "support/notifications/hipChat" from source "app" +1ms
  waigo-app Running startup step: setupTriggerTypes +25ms
  waigo-loader Loading module "support/startup/setupTriggerTypes" from source "app" +23ms
  waigo-loader Loading module "triggerTypes/drone" from source "app" +1ms
  waigo-loader Loading module "support/triggerType" from source "app" +3ms
  waigo-loader Loading module "support/forms/form" from source "waigo" +0ms
  waigo-loader Loading module "support/urlUtils" from source "app" +1ms
  waigo-loader Loading module "triggerTypes/simple" from source "app" +8ms
  waigo-loader Loading module "support/triggerType" from source "app" +1ms
  waigo-app Running startup step: setupAnsible +14ms
  waigo-loader Loading module "support/startup/setupAnsible" from source "app" +0ms
  waigo-loader Loading module "support/exec-then" from source "app" +6ms
2014-11-07T00:22:17.890Z - info: Ansible playbook binary: /usr/bin/ansible-playbook
  waigo-app Running startup step: setupTemplateHelpers +46ms
  waigo-loader Loading module "support/startup/setupTemplateHelpers" from source "app" +40ms
  waigo-app Running startup step: listener +9ms
  waigo-loader Loading module "support/startup/listener" from source "waigo" +9ms
  waigo-startup-listener Starting HTTP server +0ms
2014-11-07T00:22:17.922Z - info: Server listening in production mode on port 3000 (baseURL: http://localhost:3000)
  waigo-app Running startup step: startJobProcessor +4ms
  waigo-loader Loading module "support/startup/startJobProcessor" from source "app" +5ms
  waigo-loader Loading module "support/timers" from source "app" +2ms
2014-11-07T00:22:17.929Z - info: Mark previously active jobs as stale
2014-11-07T00:22:17.933Z - info: Start job processing timer
  waigo-app Running startup step: notifyAdminsOfStartup +9ms
  waigo-loader Loading module "support/startup/notifyAdminsOfStartup" from source "app" +6ms
2014-11-07T00:22:17.935Z - debug: Notifying admins that we have started up
hiddentao commented 9 years ago

So it looks like setupAnsible is getting loaded and executed. What's in the Mongo DB? Are your playbooks loaded and present there?