Search code examples
node.jsherokutensorflow.js

Node.js bot not running on Heroku


I have this bot using Tensorflow. I'm adding this detail because the heroku logs look like this:

2021-04-28T11:41:48.967993+00:00 app[web.1]: npm ERR! 
2021-04-28T11:41:48.968114+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2021-04-28T11:41:48.968223+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-04-28T11:41:49.962137+00:00 app[web.1]: 
2021-04-28T11:41:49.962450+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-04-28T11:41:49.962450+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-04-28T11_41_48_968Z-debug.log
2021-04-28T11:41:50.027864+00:00 heroku[web.1]: Process exited with status 1
2021-04-28T11:41:50.088437+00:00 heroku[web.1]: State changed from starting to crashed
2021-04-28T16:56:52.406751+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=debord-meme.herokuapp.com request_id=df79b840-ed0c-48cf-95aa-f6ee80a8f00e fwd="192.222.234.216" dyno= connect= service= status=503 bytes= protocol=https
2021-04-28T16:56:52.872742+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=debord-meme.herokuapp.com request_id=9a88d67f-ad39-4169-825c-c73ea4ca1776 fwd="192.222.234.216" dyno= connect= service= status=503 bytes= protocol=https

However, I'm not sure this is due to Tensorflow but I have no idea what is problematic here.

My package.json file looks like the following:

{
  "name": "debord-slow-sender-meme",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node bot.js"
  },

I run the project with the node bot.js command - file that is on my root folder.


Solution

  • create a file named "Procfile" (without .js or anything) and just write "Worker: node index.js" on it, also change your Dynos, I mean, turn off the Web dyno and turn on the Worker dyno and then reload all the Dynos