I have deployed my Node.js bot to heroku using the cli. WHen I try to open the app, it crashes with this error in log:
2018-02-20T12:34:24.132994+00:00 app[web.1]: npm ERR! drvinebot#1.0.0 start: `node app.js`
2018-02-20T12:34:24.133186+00:00 app[web.1]: npm ERR! Exit status 1
2018-02-20T12:34:24.133463+00:00 app[web.1]: npm ERR!
2018-02-20T12:34:24.133682+00:00 app[web.1]: npm ERR! Failed at the
drvinebot#1.0.0 start script.
2018-02-20T12:34:24.133887+00:00 app[web.1]: npm ERR! This is probably not a
problem with npm. There is likely additional logging output above.
2018-02-20T12:34:56.072459+00:00 heroku[router]: at=error code=H10 desc="App
crashed" method=GET path="/" host=drvinebot.herokuapp.com
request_id=8bf3595c-2ff8-4950-828c-0668e86e92bb fwd="106.203.157.18" dyno=
connect= service= status=503 bytes= protocol=https
2018-02-20T12:34:57.812751+00:00 heroku[router]: at=error code=H10 desc="App
crashed" method=GET path="/favicon.ico" host=drvinebot.herokuapp.com
request_id=f716154a-35e7-446d-b05d-bca3bc26c06c fwd="106.203.157.18" dyno=
connect= service= status=503 bytes= protocol=https
2018-02-20T12:35:43.707329+00:00 heroku[router]: at=error code=H10 desc="App
crashed" method=GET path="/" host=drvinebot.herokuapp.com
request_id=b0b38a2c-8164-44ca-bdf7-1f426bb327b3 fwd="106.203.157.18" dyno=
connect= service= status=503 bytes= protocol=https
2018-02-20T12:35:45.472294+00:00 heroku[router]: at=error code=H10 desc="App
crashed" method=GET path="/favicon.ico" host=drvinebot.herokuapp.com
request_id=44814f37-d547-49c3-9cb4-d2454cedcb29 fwd="106.203.157.18" dyno=
connect= service= status=503 bytes= protocol=https
2018-02-20T12:41:11.946966+00:00 heroku[router]: at=error code=H10 desc="App
crashed" method=GET path="/" host=drvinebot.herokuapp.com
request_id=af3e6bff-32d0-4a7a-8a72-b847d8b5b642 fwd="106.203.191.138" dyno=
connect= service= status=503 bytes= protocol=https
2018-02-20T12:41:13.583622+00:00 heroku[router]: at=error code=H10 desc="App
crashed" method=GET path="/favicon.ico" host=drvinebot.herokuapp.com
request_id=63f94976-a986-48cb-81c3-a46706f782dc fwd="106.203.191.138" dyno=
connect= service= status=503 bytes= protocol=https
Here's my package.json file:
"name": "drvinebot",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"author": "Joseph Joey",
"license": "UNLICENSED",
"dependencies": {
"express": "^4.16.2",
"helmet": "^3.11.0",
"twit": "^2.2.9"
}
}
Previously, I was using nodemon and app still crashed, so I changed my procfile to this:
web: npm start
to start the server using npm scripts. I don't seem to understand what's wrong here. Can someone help me out?
Thanks.
Related
I am trying to deploy the react.js project on Heroku first time but I faced an Application error after my deployment
here are the complete Heroku logs which I got in CLI
but I can't figure it out kindly have a look at it and help me to fix it
2022-03-27T21:38:28.785305+00:00 app[web.1]: errno: -2,
2022-03-27T21:38:28.785305+00:00 app[web.1]: code: 'ENOENT',
2022-03-27T21:38:28.785305+00:00 app[web.1]: syscall: 'spawn xdg-open',
2022-03-27T21:38:28.785306+00:00 app[web.1]: path: 'xdg-open',
2022-03-27T21:38:28.785306+00:00 app[web.1]: spawnargs: [ 'http://localhost:5473' ]
2022-03-27T21:38:28.785306+00:00 app[web.1]: }
2022-03-27T21:38:28.952616+00:00 heroku[web.1]: Process exited with status 1
2022-03-27T21:38:29.035319+00:00 heroku[web.1]: State changed from up to crashed
2022-03-27T21:38:30.362490+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=prashantkr006-portfolio.herokuapp.com request_id=32017955-d828-4cb3-83bb-5549ef9b708d fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:38:30.929163+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=prashantkr006-portfolio.herokuapp.com request_id=536688a3-05d6-4ae5-8e71-9a7416288a7c fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:38:34.193164+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=prashantkr006-portfolio.herokuapp.com request_id=63109b08-cfb0-46c3-b456-49cfffcb4b2c fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:38:34.734662+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=prashantkr006-portfolio.herokuapp.com request_id=f1db7ca5-c99c-4048-a461-ac45a649d965 fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:38:36.322456+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=prashantkr006-portfolio.herokuapp.com request_id=1fe2ea64-25aa-4424-aa92-b314327af931 fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:38:36.933721+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=prashantkr006-portfolio.herokuapp.com request_id=d5e392cd-1ccd-42b7-aa11-074c69da34b4 fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:38:37.425993+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=prashantkr006-portfolio.herokuapp.com request_id=dbdd86bd-4a02-485e-9032-6df69426502a fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:50:02.264561+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=prashantkr006-portfolio.herokuapp.com request_id=53022457-3a00-423f-ae40-37e33e685d23 fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:50:02.898755+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=prashantkr006-portfolio.herokuapp.com request_id=536c5ee9-ec09-4360-8821-c8248db464a5 fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:52:42.850643+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=prashantkr006-portfolio.herokuapp.com request_id=99a80e06-a2e5-4ae7-800a-a945e3c58ff2 fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T21:52:43.403302+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=prashantkr006-portfolio.herokuapp.com request_id=c830cdd8-66ca-446b-a6cb-ad8308759ffe fwd="124.253.43.194" dyno= connect= service= status=503 bytes= protocol=https```
how to fix it?
From what I understand, your issue is similar to this one :
have an error when deploy react app in heroku
By the way, if this concerns a react.js app you should edit your post tags, you put node.js instead of react.js
I have been trying to deploy an app to Heroku
it has been deployed but says application error
LOGS:-
2020-10-06T04:14:51.490040+00:00 heroku[web.1]: Starting process with command `gunicorn great-usernames:wsgi`
2020-10-06T04:14:53.853073+00:00 app[web.1]: bash: gunicorn: command not found
2020-10-06T04:14:53.889337+00:00 heroku[web.1]: Process exited with status 127
2020-10-06T04:14:53.928653+00:00 heroku[web.1]: State changed from starting to crashed
2020-10-06T04:15:00.441714+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=gg-usernames.herokuapp.com request_id=508d3db8-7a0b-4469-b22c-124117a6ffa9 fwd="49.37.6.95" dyno= connect= service= status=502 bytes= protocol=https
2020-10-06T04:15:00.982496+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=gg-usernames.herokuapp.com request_id=d644c379-098b-4b37-927b-2578ca65537b fwd="49.37.6.95" dyno= connect= service= status=502 bytes= protocol=https
2020-10-06T04:15:14.860562+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=gg-usernames.herokuapp.com request_id=d2de73e7-9a89-453b-9e5f-0942f22e3ee6 fwd="49.37.6.95" dyno= connect= service= status=502 bytes= protocol=https
2020-10-06T04:15:15.333167+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=gg-usernames.herokuapp.com request_id=43020ef1-b277-40a7-8555-2b71418f1917 fwd="49.37.6.95" dyno= connect= service= status=502 bytes= protocol=https
2020-10-06T04:16:38.957562+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gg-usernames.herokuapp.com request_id=97723735-ca99-4b00-818d-c36ac77867d6 fwd="49.37.6.95" dyno= connect= service= status=503 bytes= protocol=https
2020-10-06T04:16:39.649714+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gg-usernames.herokuapp.com request_id=ca46ab12-0bf2-4e71-b3d5-f6760fd040d1 fwd="49.37.6.95" dyno= connect= service= status=503 bytes= protocol=https
2020-10-06T04:21:08.498502+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gg-usernames.herokuapp.com request_id=0a99c7bf-2a90-4bba-bbf1-46fc85bd3cc7 fwd="49.37.6.95" dyno= connect= service= status=503 bytes= protocol=https
2020-10-06T04:21:09.153869+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gg-usernames.herokuapp.com request_id=ed12acab-3296-4a09-b7fe-7b1f8fbcb25f fwd="49.37.6.95" dyno= connect= service= status=503 bytes= protocol=https
thanks in advance
Specify gunicorn and version in the requirements.txt
gunicorn==20.0.4
My listen Method
app.listen(process.env.PORT || 3000, function () {
console.log("server is runing ...");
});
Procfile file
web: node app.js
Package.json file
{
"name": "todolistv1",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"engines": {
"node": "12.16.2"
},
"dependencies": {
"body-parse": "^0.1.0",
"ejs": "^3.1.2",
"express": "^4.17.1",
"lodash": "^4.17.15",
"mongoose": "^5.9.14"
}
}
get this Error after deploy on heroku
$ heroku logs --tail
2020-05-16T15:20:04.427942+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-16T15:20:04.430891+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-16T15:20:04.351554+00:00 app[web.1]: npm ERR! missing script: start
2020-05-16T15:20:04.360666+00:00 app[web.1]:
2020-05-16T15:20:04.361153+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-05-16T15:20:04.361349+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-05-16T15_20_04_352Z-debug.log
2020-05-16T15:20:08.985111+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-16T15:20:08.909101+00:00 app[web.1]: npm ERR! missing script: start
2020-05-16T15:20:08.915880+00:00 app[web.1]:
2020-05-16T15:20:08.916239+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-05-16T15:20:08.916362+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-05-16T15_20_08_909Z-debug.log
2020-05-16T15:20:13.896448+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=lit-sea-79877.herokuapp.com request_id=90490bf7-cfed-4ed8-b019-17006ccc96b3 fwd="89.64.82.94" dyno= connect= service= status=503 bytes= protocol=https
2020-05-16T15:20:14.837519+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=lit-sea-79877.herokuapp.com request_id=f5c67a31-0e94-4e9d-bba2-b8b3f1707025 fwd="89.64.82.94" dyno= connect= service= status=503 bytes= protocol=https
2020-05-16T15:20:28.386972+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=lit-sea-79877.herokuapp.com request_id=af8eeb40-0385-4161-a7e5-b7d8ed7c131c fwd="89.64.82.94" dyno= connect= service= status=503 bytes= protocol=https
2020-05-16T15:20:30.347758+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=lit-sea-79877.herokuapp.com request_id=716339e2-c296-4815-968b-ee11e6393278 fwd="89.64.82.94" dyno= connect= service= status=503 bytes= protocol=https
2020-05-16T15:22:38.000000+00:00 app[api]: Build started by user terart22#gmail.com
2020-05-16T15:22:52.988045+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-16T15:22:52.728992+00:00 app[api]: Deploy 323c9431 by user terart22#gmail.com
2020-05-16T15:22:52.728992+00:00 app[api]: Release v10 created by user terart22#gmail.com
2020-05-16T15:22:53.000000+00:00 app[api]: Build succeeded
Your script object should have 'start' key for the heroku server to start. Try this
"scripts": {"start": "node app.js",
"test": "echo \"Error: no test specified\" && exit 1" }
So I deployed my third app to heroku but to my surprise the app is not working, it's the first time when I get this kind of error:
code=H10 desc="App crashed"
At first I forgot to set my port variable like this: const port = process.env.PORT || 5000;
And then listen to it like this:
server.listen(port, () => {
console.log('Server is runing on port 5000');
});
But even when I set up port variable I still get the same error and I don't know what can cause this error.
2018-10-04T15:12:29.405064+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=m-o-d.herokuapp.com request_id=430f142b-4820-410b-865b-cc6bffae2fa5 fwd="195.12.167.97" dyno= connect= service= status=503 bytes= protocol=https
2018-10-04T15:12:29.654458+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=m-o-d.herokuapp.com request_id=30ff6c29-f7c3-4350-aaff-4bc22f823dd8 fwd="195.12.167.97" dyno= connect= service= status=503 bytes= protocol=https
App works when I run it in my localhost like this: npm start
2018-10-04T17:09:24.933184+00:00 app[web.1]: npm ERR! Failed at the mystery_of_dungeons#1.0.0 start script.
2018-10-04T17:09:24.921760+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:542:15)
2018-10-04T17:09:24.921763+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-10-04T17:09:24.921766+00:00 app[web.1]: at Module._compile (module.js:641:30)
//import modules
var builder = require("botbuilder");
var restify = require("restify");
var menu = require("./menuConfig.json");
var express = require("express");
var request = require("request");
var bodyParser = require("body-parser");
I got this part for ms-Azure connector, and builder.UniversalBot() method for the XXX.dialog() waterflow pattern.
var server = restify.createServer();
server.listen(process.env.port||process.env.PORT||3978, function () {
console.log('%s listening to %s', server.name, server.url);
})
var connector = new builder.ChatConnector({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword,
})
server.post('/api/messages', connector.listen());
var bot = new builder.UniversalBot(connector)
Then I added second part for Heroku connect and facebook webhook
var app = express();
app.use(bodyParser.urlencoded({extended:false}));
app.use(bodyParser.json());
app.listen((process.env.PORT||5000));
app.get("/",function(req,
res){
res.send("deployed!");
})
app.get("/webhook",function(req,res){
if(req.query["hub.verify_token"]==="process.env.VERIFICATION_TOKEN"){
console.log("Verified webhook");
res.status(200).send(req.query["hub.challenge"]);
}else{
console.error("Verification failed. The tokens do not match");
res.sendStatus(403)
}
})
var mainMenu = menu.main;
var drinkMenu = menu.drink;
var foodMenu = menu.food;
then rest dialog water flow
bot.dialog("/",[
//default dialog
function(session) {
session.send("welcom!!");
session.replaceDialog('mainMenu');
}
]).triggerAction({matches: /^fistUse$/});
.....etc
this is my package.json
{
"name": "baobao_generator_bot",
"version": "1.0.0",
"description": "create baobao generator bot",
"main": "app.js",
"author": {
"name": "orangelion"
},
"license": "ISC",
"scripts": {
"start": "node app.js"
},
"dependencies": {
"body-parser": "^1.18.2",
"botbuilder": "3.14.0",
"express": "^4.16.2",
"mongoose": "^5.0.9",
"request": "^2.83.0",
"restify": "6.3.4"
}
}
I successfully git pushed my program to heroku.
but when I enter heroku open, I got Application error.
Here's the log.
Application Logs
2018-03-07T11:18:55.690635+00:00 app[web.1]: - npm ERR! A complete log of this run can be found in:
2018-03-07T11:18:55.690851+00:00 app[web.1]: - npm ERR! /app/.npm/_logs/2018-03-07T11_18_55_626Z-debug.log
2018-03-07T11:18:55.895218+00:00 heroku[web.1]: - State changed from starting to crashed
2018-03-07T11:18:55.882087+00:00 heroku[web.1]: - Process exited with status 1
2018-03-07T11:46:32.782848+00:00 heroku[router]: - at=error code=H10 desc="App crashed" method=GET path="/" host=immense-falls-15019.herokuapp.com request_id=05e87397-b586-4319-abf6-a51deab37e7b fwd="125.227.255.81" dyno= connect= service= status=503 bytes= protocol=https
2018-03-07T11:46:33.061549+00:00 heroku[router]: - at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=immense-falls-15019.herokuapp.com request_id=5fd3502b-0884-430d-a3a8-9088ab62e2e5 fwd="125.227.255.81" dyno= connect= service= status=503 bytes= protocol=https
2018-03-07T11:47:41.678941+00:00 heroku[router]: - at=error code=H10 desc="App crashed" method=GET path="/" host=immense-falls-15019.herokuapp.com request_id=a203c6a9-b934-4306-823f-00baf6eb6f9d fwd="125.227.255.81" dyno= connect= service= status=503 bytes= protocol=https
2018-03-07T11:47:41.975202+00:00 heroku[router]: - at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=immense-falls-15019.herokuapp.com request_id=22b6bb3e-c5c0-47e6-a4c7-c5b3d1f17b0f fwd="125.227.255.81" dyno= connect= service= status=503 bytes= protocol=https
2018-03-07T11:51:02.393492+00:00 heroku[router]: - at=error code=H10 desc="App crashed" method=GET path="/" host=immense-falls-15019.herokuapp.com request_id=66493288-1511-46dc-9c58-9978ad6ed3d5 fwd="125.227.255.81" dyno= connect= service= status=503 bytes= protocol=https
2018-03-07T11:51:02.708936+00:00 heroku[router]: - at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=immense-falls-15019.herokuapp.com request_id=0f4af933-6501-4966-856a-91e77e504868 fwd="125.227.255.81" dyno= connect= service= status=503 bytes= prot
ocol=https
I've found similar quetion here but didn't get the solution of my problem.
Is there a way not too complicated to run a msbot-frame-work chatbot
on heroku? Or I have to choose : give up to use ms-bot-framework or use Azure?
And any other cloud service is recommended?