运行命令heroku ps:scale worker = 1时出错 [英] Getting error while running command heroku ps:scale worker=1 error

查看:95
本文介绍了运行命令heroku ps:scale worker = 1时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了很多,但是找不到原因.需要帮忙.以下是在Heroku中部署我的第一个节点应用程序并且我的数据库在MongoLab之后的内容.

I tried a lot but not able to find the reason for this. Need help. Following is what I am writing after deploying my first node app in Heroku and my DB is at MongoLab

heroku ps:scale worker=1 

这给了我以下错误.

!    No such type as worker.

我的Procfile看起来像这样,

My Procfile look like this,

web: node server/server.js

这是我的日志文件的样子

Here is my log file look like

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    

推荐答案

您正在运行的命令试图将worker进程的数量增加到1,但是您仅声明了web进程类型.如果您尝试扩大Web进程的数量,则可以使用heroku ps:scale web=1.如果要创建新的工作进程,则需要在procfile中定义一个工作进程,并在尝试扩展它之前将其推送到Heroku(worker: node server/worker.js). 关于流程类型的Heroku文档也应有所帮助

The command you are running is trying to scale up the number of worker processes to 1 but you have only declared a web process type. If you are trying to scale up the number of web processes you would use heroku ps:scale web=1. If you are trying to make a new worker process you need to define a worker in the procfile and push to Heroku before trying to scale it (worker: node server/worker.js). The Heroku documentation on process types should be of some help as well.

这篇关于运行命令heroku ps:scale worker = 1时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆