运行命令heroku ps时出错:scale worker = 1错误

时间:2013-04-21 09:15:40

标签: node.js mongodb heroku mlab procfile

我尝试了很多但却无法找到原因。需要帮忙。以下是我在Heroku中部署我的第一个节点应用程序后编写的内容,而我的数据库是在MongoLab

heroku ps:scale worker=1 

它给了我以下错误。

!    No such type as worker.

我的Procfile看起来像这样,

web: node server/server.js

这是我的日志文件,如

2013-04-20T21:12:31.474207+00:00 app[worker.1]:     at startup (node.js:119:16)
2013-04-20T21:12:31.474207+00:00 app[worker.1]:     at node.js:901:3
2013-04-20T21:12:32.710713+00:00 heroku[worker.1]: Process exited with status 8
2013-04-20T21:12:32.722040+00:00 heroku[worker.1]: State changed from starting to crashed
2013-04-20T21:18:02.281651+00:00 heroku[web.1]: State changed from crashed to starting
2013-04-20T21:18:03.317730+00:00 heroku[web.1]: Starting process with command `node server/server.js`
2013-04-20T21:18:04.034486+00:00 app[web.1]:                               ^
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2013-04-20T21:18:04.034486+00:00 app[web.1]:     server = module.exports = express();
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at Module.load (module.js:356:32)
2013-04-20T21:18:04.038104+00:00 app[web.1]: TypeError: object is not a function
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
2013-04-20T21:18:04.034486+00:00 app[web.1]: 
2013-04-20T21:18:04.034486+00:00 app[web.1]: /app/server/server.js:7
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at Object.<anonymous> (/app/server/server.js:7:31)
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at startup (node.js:119:16)
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at Function.Module.runMain (module.js:497:10)
2013-04-20T21:18:04.038104+00:00 app[web.1]:     at node.js:901:3
2013-04-20T21:18:05.153193+00:00 heroku[web.1]: Process exited with status 8
2013-04-20T21:18:05.191971+00:00 heroku[web.1]: State changed from starting to crashed
2013-04-20T21:18:31.948831+00:00 heroku[slugc]: Slug compilation started
2013-04-20T21:19:03.195879+00:00 heroku[worker.1]: State changed from crashed to down
2013-04-20T21:19:03.215823+00:00 heroku[api]: Release v13 created by suchak.maulik179@gmail.com
2013-04-20T21:19:03.254953+00:00 heroku[api]: Deploy 425df46 by suchak.maulik179@gmail.com
2013-04-20T21:19:03.326499+00:00 heroku[web.1]: State changed from crashed to starting
2013-04-20T21:19:04.350726+00:00 heroku[web.1]: Starting process with command `node server/server.js`
2013-04-20T21:19:04.372088+00:00 heroku[slugc]: Slug compilation finished
2013-04-20T21:19:05.332176+00:00 app[web.1]: /app/server/server.js:7
2013-04-20T21:19:05.332477+00:00 app[web.1]:     server = module.exports = express();
2013-04-20T21:19:05.332529+00:00 app[web.1]:                               ^
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at Module.load (module.js:356:32)
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at Function.Module.runMain (module.js:497:10)
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at startup (node.js:119:16)
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at node.js:901:3
2013-04-20T21:19:05.339486+00:00 app[web.1]: TypeError: object is not a function
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at Object.<anonymous> (/app/server/server.js:7:31)
2013-04-20T21:19:05.332176+00:00 app[web.1]: 
2013-04-20T21:19:05.339486+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2013-04-20T21:19:07.836462+00:00 heroku[web.1]: Process exited with status 8
2013-04-20T21:19:07.850902+00:00 heroku[web.1]: State changed from starting to crashed
2013-04-20T21:27:35.413670+00:00 heroku[api]: Add NODE_ENV config by suchak.maulik179@gmail.com
2013-04-20T21:27:35.455828+00:00 heroku[api]: Release v14 created by suchak.maulik179@gmail.com
2013-04-20T21:27:35.590387+00:00 heroku[web.1]: State changed from crashed to starting
2013-04-20T21:27:36.402134+00:00 heroku[web.1]: Starting process with command `node server/server.js`
2013-04-20T21:27:37.096860+00:00 app[web.1]:     server = module.exports = express();
2013-04-20T21:27:37.095996+00:00 app[web.1]: 
2013-04-20T21:27:37.096542+00:00 app[web.1]: /app/server/server.js:7
2013-04-20T21:27:37.101585+00:00 app[web.1]: TypeError: object is not a function
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2013-04-20T21:27:37.097188+00:00 app[web.1]:                               ^
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at Object.<anonymous> (/app/server/server.js:7:31)
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at Module.load (module.js:356:32)
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at Function.Module.runMain (module.js:497:10)
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at startup (node.js:119:16)
2013-04-20T21:27:37.101585+00:00 app[web.1]:     at node.js:901:3
2013-04-20T21:27:38.325688+00:00 heroku[web.1]: Process exited with status 8
2013-04-20T21:27:38.337228+00:00 heroku[web.1]: State changed from starting to crashed
2013-04-20T21:28:09.438921+00:00 heroku[web.1]: State changed from crashed to starting
2013-04-20T21:28:10.370904+00:00 heroku[web.1]: Starting process with command `node server/server.js`
2013-04-20T21:28:10.983155+00:00 app[web.1]: /app/server/server.js:7
2013-04-20T21:28:10.983538+00:00 app[web.1]:     server = module.exports = express();
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at startup (node.js:119:16)
2013-04-20T21:28:10.987593+00:00 app[web.1]: TypeError: object is not a function
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at Function.Module.runMain (module.js:497:10)
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at Object.<anonymous> (/app/server/server.js:7:31)
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at node.js:901:3
2013-04-20T21:28:10.982954+00:00 app[web.1]: 
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2013-04-20T21:28:10.983538+00:00 app[web.1]:                               ^
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at Module.load (module.js:356:32)
2013-04-20T21:28:10.987593+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2013-04-20T21:28:12.065391+00:00 heroku[web.1]: Process exited with status 8
2013-04-20T21:28:12.076681+00:00 heroku[web.1]: State changed from starting to crashed
2013-04-20T21:29:48.836778+00:00 heroku[slugc]: Slug compilation started
2013-04-20T21:29:50.389288+00:00 heroku[slugc]: Slug compilation failed: failed to compile Node.js app
2013-04-20T21:31:17.189885+00:00 heroku[slugc]: Slug compilation started
2013-04-20T21:31:36.095712+00:00 heroku[api]: Release v15 created by suchak.maulik179@gmail.com
2013-04-20T21:31:36.130855+00:00 heroku[api]: Deploy 5c9dcf7 by suchak.maulik179@gmail.com
2013-04-20T21:31:36.321819+00:00 heroku[web.1]: State changed from crashed to starting
2013-04-20T21:31:36.560503+00:00 heroku[slugc]: Slug compilation finished
2013-04-20T21:31:39.217666+00:00 heroku[web.1]: Starting process with command `node server/server.js`
2013-04-20T21:31:39.952499+00:00 app[web.1]: /app/server/server.js:7
2013-04-20T21:31:39.953143+00:00 app[web.1]:                               ^
2013-04-20T21:31:39.955817+00:00 app[web.1]:     at Module._compile (module.js:449:26)
2013-04-20T21:31:39.955817+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-04-20T21:31:39.952499+00:00 app[web.1]: 
2013-04-20T21:31:39.952832+00:00 app[web.1]:     server = module.exports = express();
2013-04-20T21:31:39.955817+00:00 app[web.1]: TypeError: object is not a function
2013-04-20T21:31:39.955817+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:467:10)
2013-04-20T21:31:39.955817+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-04-20T21:31:39.955817+00:00 app[web.1]:     at Object.<anonymous> (/app/server/server.js:7:31)
2013-04-20T21:31:39.955817+00:00 app[web.1]:     at Module.load (module.js:356:32)
2013-04-20T21:31:39.955817+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2013-04-20T21:31:41.158365+00:00 heroku[web.1]: Process exited with status 1
2013-04-20T21:31:41.168511+00:00 heroku[web.1]: State changed from starting to crashed    

1 个答案:

答案 0 :(得分:3)

您正在运行的命令正在尝试将worker进程数量扩展为1,但您只声明了web进程类型。如果您尝试扩展您将使用heroku ps:scale web=1的Web进程数。如果您正在尝试创建新的工作进程,则需要在proc文件中定义一个worker并在尝试扩展它之前推送到Heroku(worker: node server/worker.js)。 Heroku documentation on process types也应该有所帮助。