{"action":"created","issue":{"url":"https://api.github.com/repos/meanjs/mean/issues/300","labels_url":"https://api.github.com/repos/meanjs/mean/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/meanjs/mean/issues/300/comments","events_url":"https://api.github.com/repos/meanjs/mean/issues/300/events","html_url":"https://github.com/meanjs/mean/issues/300","id":51675058,"number":300,"title":"Amazon EC2 Deploy Problem","user":{"login":"boris-petrov1214","id":5972413,"avatar_url":"https://avatars.githubusercontent.com/u/5972413?v=3","gravatar_id":"","url":"https://api.github.com/users/boris-petrov1214","html_url":"https://github.com/boris-petrov1214","followers_url":"https://api.github.com/users/boris-petrov1214/followers","following_url":"https://api.github.com/users/boris-petrov1214/following{/other_user}","gists_url":"https://api.github.com/users/boris-petrov1214/gists{/gist_id}","starred_url":"https://api.github.com/users/boris-petrov1214/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boris-petrov1214/subscriptions","organizations_url":"https://api.github.com/users/boris-petrov1214/orgs","repos_url":"https://api.github.com/users/boris-petrov1214/repos","events_url":"https://api.github.com/users/boris-petrov1214/events{/privacy}","received_events_url":"https://api.github.com/users/boris-petrov1214/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-12-11T11:22:06Z","updated_at":"2015-01-08T00:37:53Z","closed_at":null,"body":"Hi,\r\n\r\nI recently build an app using MEAN.JS and deployed as a production mode on to Amazon EC2 Ubuntu instance. \r\n\r\nI used forever and upstart to keep the server running on reboot and here's forever command :\r\n>>>\r\nforever start /home/ubuntu/ESP-connector/server.js\r\n>>>\r\n\r\nBut the problem is that this command doesn't work and I got error like below:\r\n>>>\r\nPotentially unhandled rejection [1] MissingSchemaError: Schema hasn't been registered for model \"User\".\r\nUse mongoose.model(name, schema)\r\n    at Mongoose.model (/home/ubuntu/ESP-connector/node_modules/mongoose/lib/index.js:323:13)\r\n    at Object.<anonymous> (/home/ubuntu/ESP-connector/config/passport.js:7:29)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Module.require (module.js:364:17)\r\n    at require (module.js:380:17)\r\n    at /home/ubuntu/ESP-connector/server.js:37:5\r\n    at tryCatchReject (/home/ubuntu/ESP-connector/node_modules/amqplib/node_modules/when/lib/makePromise.js:806:14)\r\n>>>\r\n\r\nI realized that the error comes from this part in config/express.js file:\r\n>>>\r\n        // Globbing model files\r\n\tconfig.getGlobbedFiles('./app/models/**/*.js').forEach(function(modelPath) {\r\n\t\trequire(path.resolve(modelPath));\r\n\t});\r\n>>>\r\n\r\nIs there anyone who can help me to solve this problem?"},"comment":{"url":"https://api.github.com/repos/meanjs/mean/issues/comments/69118425","html_url":"https://github.com/meanjs/mean/issues/300#issuecomment-69118425","issue_url":"https://api.github.com/repos/meanjs/mean/issues/300","id":69118425,"user":{"login":"ilanbiala","id":3695164,"avatar_url":"https://avatars.githubusercontent.com/u/3695164?v=3","gravatar_id":"","url":"https://api.github.com/users/ilanbiala","html_url":"https://github.com/ilanbiala","followers_url":"https://api.github.com/users/ilanbiala/followers","following_url":"https://api.github.com/users/ilanbiala/following{/other_user}","gists_url":"https://api.github.com/users/ilanbiala/gists{/gist_id}","starred_url":"https://api.github.com/users/ilanbiala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilanbiala/subscriptions","organizations_url":"https://api.github.com/users/ilanbiala/orgs","repos_url":"https://api.github.com/users/ilanbiala/repos","events_url":"https://api.github.com/users/ilanbiala/events{/privacy}","received_events_url":"https://api.github.com/users/ilanbiala/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T00:37:53Z","updated_at":"2015-01-08T00:37:53Z","body":"@boris-petrov1214 does your app connect to the database before the error?"}}