Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

heroku deployment working locally but failing in production

I have been able to deploy my app on heroku, but when I try to run the app from the browser, I get an error. However, when I run it locally with 'heroku local', everything works just fine. Here are my heroku logs.

2021-02-05T05:13:47.489900+00:00 app[web.1]: > node -r esm app.js
2021-02-05T05:13:47.489901+00:00 app[web.1]:
2021-02-05T05:13:49.413465+00:00 app[web.1]: Fri, 05 Feb 2021 05:13:49 GMT morgan deprecated default format: use combined format at node_modules/esm/esm.js:1:278827
2021-02-05T05:13:56.667223+00:00 app[web.1]: { logging: [Function (anonymous)], pool: undefined }
2021-02-05T05:13:56.759304+00:00 app[web.1]: /app/node_modules/sequelize/lib/sequelize.js:1
2021-02-05T05:13:56.759307+00:00 app[web.1]: TypeError: Cannot read property 'replace' of null
2021-02-05T05:13:56.759311+00:00 app[web.1]: at new Sequelize (/app/node_modules/sequelize/lib/sequelize.js:187:43)
2021-02-05T05:13:56.759312+00:00 app[web.1]: at new SequelizeAdapter (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:59:33)
2021-02-05T05:13:56.759313+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:186:10)       
2021-02-05T05:13:56.759313+00:00 app[web.1]: at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:20:10)    
2021-02-05T05:13:56.759314+00:00 app[web.1]: at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17)
2021-02-05T05:13:56.759315+00:00 app[web.1]: at new Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38)
2021-02-05T05:13:56.759315+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:231:10)
2021-02-05T05:13:56.759315+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:35:15)
2021-02-05T05:13:56.759316+00:00 app[web.1]: at Generator.next (<anonymous>)
2021-02-05T05:13:56.836169+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-02-05T05:13:56.836927+00:00 app[web.1]: npm ERR! errno 1
2021-02-05T05:13:56.851571+00:00 app[web.1]: npm ERR! [email protected] start: `node -r esm app.js`
2021-02-05T05:13:56.852016+00:00 app[web.1]: npm ERR! Exit status 1
2021-02-05T05:13:56.852545+00:00 app[web.1]: npm ERR!
2021-02-05T05:13:56.852778+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2021-02-05T05:13:56.853159+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-02-05T05:13:56.866919+00:00 app[web.1]:
2021-02-05T05:13:56.868452+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-05T05:13:56.868646+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-05T05_13_56_854Z-debug.log
2021-02-05T05:13:56.983609+00:00 heroku[web.1]: Process exited with status 1
2021-02-05T05:13:57.066437+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-05T05:13:57.081387+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-05T05:14:02.321974+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-05T05:14:05.277648+00:00 app[web.1]:
2021-02-05T05:14:05.277671+00:00 app[web.1]: > [email protected] start /app
2021-02-05T05:14:05.277672+00:00 app[web.1]: > node -r esm app.js
2021-02-05T05:14:05.277672+00:00 app[web.1]:
2021-02-05T05:14:06.100574+00:00 app[web.1]: Fri, 05 Feb 2021 05:14:06 GMT morgan deprecated default format: use combined format at node_modules/esm/esm.js:1:278827
2021-02-05T05:14:09.120724+00:00 app[web.1]: { logging: [Function (anonymous)], pool: undefined }
2021-02-05T05:14:09.144696+00:00 app[web.1]: /app/node_modules/sequelize/lib/sequelize.js:1
2021-02-05T05:14:09.144698+00:00 app[web.1]: TypeError: Cannot read property 'replace' of null
2021-02-05T05:14:09.144702+00:00 app[web.1]: at new Sequelize (/app/node_modules/sequelize/lib/sequelize.js:187:43)
2021-02-05T05:14:09.144703+00:00 app[web.1]: at new SequelizeAdapter (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:59:33)
2021-02-05T05:14:09.144705+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:186:10)       
2021-02-05T05:14:09.144706+00:00 app[web.1]: at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:20:10)    
2021-02-05T05:14:09.144707+00:00 app[web.1]: at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17)
2021-02-05T05:14:09.144707+00:00 app[web.1]: at new Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38)
2021-02-05T05:14:09.144707+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:231:10)
2021-02-05T05:14:09.144708+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:35:15)
2021-02-05T05:14:09.144708+00:00 app[web.1]: at Generator.next (<anonymous>)
2021-02-05T05:14:09.161568+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-02-05T05:14:09.161939+00:00 app[web.1]: npm ERR! errno 1
2021-02-05T05:14:09.167351+00:00 app[web.1]: npm ERR! [email protected] start: `node -r esm app.js`
2021-02-05T05:14:09.167501+00:00 app[web.1]: npm ERR! Exit status 1
2021-02-05T05:14:09.167653+00:00 app[web.1]: npm ERR!
2021-02-05T05:14:09.167784+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2021-02-05T05:14:09.167926+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.  
2021-02-05T05:14:09.174845+00:00 app[web.1]:
2021-02-05T05:14:09.174972+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-05T05:14:09.175046+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-05T05_14_09_168Z-debug.log
2021-02-05T05:14:09.221429+00:00 heroku[web.1]: Process exited with status 1
2021-02-05T05:14:09.283635+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-05T05:14:10.652156+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dynamic-check.herokuapp.com request_id=e314ef12-ba98-4f42-a0f5-9705d79066bf fwd="197.210.52.46" dyno= connect= service= status=503 bytes= protocol=https
2021-02-05T05:14:12.627551+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dynamic-check.herokuapp.com request_id=3932bb9f-0351-454a-afb1-6739214447c4 fwd="197.210.52.46" dyno= connect= service= status=503 bytes= protocol=https

I tried to uninstall sequelize just to get the code to pass, but still getting the same error. I also installed pg locally but nothing is working.

question from:https://stackoverflow.com/questions/66058019/heroku-deployment-working-locally-but-failing-in-production

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to reply this article.

OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...