Getting error while running command heroku ps:scale worker=1 error
Asked Answered
B

1

0

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 

It is giving me following error.

!    No such type as worker.

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 [email protected]
2013-04-20T21:19:03.254953+00:00 heroku[api]: Deploy 425df46 by [email protected]
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 [email protected]
2013-04-20T21:27:35.455828+00:00 heroku[api]: Release v14 created by [email protected]
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 [email protected]
2013-04-20T21:31:36.130855+00:00 heroku[api]: Deploy 5c9dcf7 by [email protected]
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    
Bromal answered 21/4, 2013 at 9:15 Comment(0)
D
3

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.

Doig answered 21/4, 2013 at 16:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.