React Application on Heroku - heroku

Have a working React App that can run locally using the command:
npm start
However, after deploying on Heroku, i receive an application error message.
The application URL is:
https://earth-weather.herokuapp.com/
The Application Log is as follows:
2021-05-12T08:05:27.430345+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2021-05-12T08:05:27.430467+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2021-05-12T08:05:27.430577+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2021-05-12T08:05:27.430864+00:00 app[web.1]: Starting the development server...
2021-05-12T08:05:27.430866+00:00 app[web.1]:
2021-05-12T08:05:27.554932+00:00 heroku[web.1]: Process exited with status 0
2021-05-12T08:05:27.631647+00:00 heroku[web.1]: State changed from starting to crashed
2021-05-12T08:05:28.728857+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=earth-weather.herokuapp.com request_id=f067160f-79fc-4336-8488-ded7e7eb5ddb fwd="183.90.36.67" dyno= connect= service= status=503 bytes= protocol=https
2021-05-12T08:05:30.511115+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=earth-weather.herokuapp.com request_id=059ee61d-fe00-4a69-9966-61506da73911 fwd="183.90.36.67" dyno= connect= service= status=503 bytes= protocol=https
2021-05-12T08:05:31.219414+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=earth-weather.herokuapp.com request_id=0f53eee2-39a0-4311-b8a3-62cb9ffcde3c fwd="35.185.241.102" dyno= connect= service= status=503 bytes= protocol=http
The forked (public) repository is on GitHub.
Grateful for any assistance that can be rendered. - Benjamin

According to your application logs the line Starting the development server, indicates that the application is running on development mode which shouldn't happen as it is a production environment.
The reason,
According to https://devcenter.heroku.com/changelog-items/370
A Procfile is no longer required to run a Node.js app on Heroku. If no Procfile is present in the root directory of your app during the build process, we will check for a scripts.start entry in your package.json file. If such an entry is present, a default Procfile is generated automatically
$ cat Procfile
web: npm start
In your repository, since you have not specified a Procfile. Heroku automatically generates a Procfile that runs your app on development.
Currently, your react-app is treated as a regular node.js application as the node.js buildpack is used which is automatically inferred due to the presence of package.json in the root.
To fix this, you need to use the create-react-app-buildpack on Heroku.
Refer: https://elements.heroku.com/buildpacks/nhutphuongit/create-react-app-buildpack

Related

Heroku deployment with nest js project

I have github account which is connnected with my heroku account. I am trying to deploy code through heroku and my project is also connected with heroku pipeline. Build is getting succeeded. But getting error while accessing app
Heroku logs
2022-09-07T10:08:37.346556+00:00 heroku[web.1]: Starting process with command `npm start`
2022-09-07T10:08:41.005367+00:00 app[web.1]:
2022-09-07T10:08:41.005458+00:00 app[web.1]: > food-court#0.0.1 start
2022-09-07T10:08:41.005458+00:00 app[web.1]: > nest start
2022-09-07T10:08:41.005459+00:00 app[web.1]:
2022-09-07T10:08:41.020373+00:00 app[web.1]: /tmp/start-7b018378.sh: 1: nest: not found
2022-09-07T10:08:41.187916+00:00 heroku[web.1]: Process exited with status 127
2022-09-07T10:08:41.284101+00:00 heroku[web.1]: State changed from starting to crashed
2022-09-07T10:13:07.218759+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=food-court-be-dev.herokuapp.com request_id=52c79661-a554-4c2b-b412-c24429d538c5 fwd="103.181.100.29" dyno= connect= service= status=503 bytes= protocol=https
2022-09-07T10:13:07.784604+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=food-court-be-dev.herokuapp.com request_id=f1a47ec4-6160-47d2-80ef-a0db2569d7bf fwd="103.181.100.29" dyno= connect= service= status=503 bytes= protocol=https
Thanks in advance
resolved issue by changing "start": "nest start", to "start": "node dist/main.js" in package.json

Trouble deploying MERN Application to Heroku

Tried a bunch of reformats on my server.js file. config is put into heroku settings.
Error: Cannot read properties of null (reading 'split')
is what seems to be standing out to me in the logs. Along with the two H10's. I've typed these errors in and tried to change things using the answers I saw on here but still cant get the app to work without the app crash on heroku.
Here are my logs:
2022-06-22T17:25:25.597973+00:00 app[web.1]:
2022-06-22T17:25:25.597982+00:00 app[web.1]: > it-logger-final#1.0.0 start
2022-06-22T17:25:25.597983+00:00 app[web.1]: > node server
2022-06-22T17:25:25.597983+00:00 app[web.1]:
2022-06-22T17:25:25.933187+00:00 app[web.1]: Server running in production mode on port 43811
2022-06-22T17:25:25.933707+00:00 app[web.1]: Error: Cannot read properties of null (reading 'split')
2022-06-22T17:25:26.215915+00:00 heroku[web.1]: Process exited with status 1
2022-06-22T17:25:26.439416+00:00 heroku[web.1]: State changed from starting to crashed
2022-06-22T17:25:28.264639+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=it-logger-motta.herokuapp.com request_id=c5e7c89c-047c-4f11-b52e-337946492e02 fwd="68.134.27.230" dyno= connect= service= status=503 bytes= protocol=https
2022-06-22T17:25:28.553271+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=it-logger-motta.herokuapp.com request_id=cb691fd1-6022-4375-886e-c98520d5ec87 fwd="68.134.27.230" dyno= connect= service= status=503 bytes= protocol=https
Here is my repo: https://github.com/SyntaxMotta/IT-Logger-Final

Why Heroku + voila ipynb app fail to deploy with `failed to bind to $PORT within 60 seconds of launch`

I followed the different pages to deploy a voila ipynb app on heroku:
https://pythonforundergradengineers.com/deploy-jupyter-notebook-voila-heroku.html
https://medium.com/analytics-vidhya/deploying-jupyter-notebook-as-a-web-app-with-heroku-d157b68bcccc
https://github.com/voila-dashboards/voila-heroku
Unfoprtunately, it seems that there is a persisting bug this last month (saw here for instance https://forums.fast.ai/t/heroku-app-wont-deploy/92875/4)
You can find the github repo I am trying to deploy here:
https://github.com/vpicouet/fireball2-etc
The app is base on this Procfile
web: voila --port=$PORT --no-browser --enable_nbextensions=True notebooks/ETC.ipynb
Unfortunately I get this error
2022-03-27T15:17:49.880973+00:00 app[web.1]: [Voila] Using /tmp to store connection files
2022-03-27T15:17:49.881302+00:00 app[web.1]: [Voila] Storing connection files in /tmp/voila_yih2j7ic.
2022-03-27T15:17:49.881356+00:00 app[web.1]: [Voila] Serving static files from /app/.heroku/python/lib/python3.8/site-packages/voila/static.
2022-03-27T15:17:49.890735+00:00 app[web.1]: [Voila] Voilà is running at:
2022-03-27T15:17:49.890737+00:00 app[web.1]: http://localhost:7758/
2022-03-27T15:17:58.000000+00:00 app[api]: Build succeeded
2022-03-27T15:18:48.015586+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2022-03-27T15:18:48.055996+00:00 heroku[web.1]: Stopping process with SIGKILL
2022-03-27T15:18:48.227953+00:00 heroku[web.1]: Process exited with status 137
2022-03-27T15:18:48.274554+00:00 heroku[web.1]: State changed from starting to crashed
2022-03-27T15:24:44.773897+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fireball2-etc-2022.herokuapp.com request_id=0b0c1707-d6ae-449a-9059-f2d1d3f8c652 fwd="74.105.154.225" dyno= connect= service= status=503 bytes= protocol=https
2022-03-27T15:39:30.626492+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fireball2-etc-2022.herokuapp.com request_id=af5c3e4a-019f-47c3-a047-e5115ebd5fc7 fwd="74.105.154.225" dyno= connect= service= status=503 bytes= protocol=https
Do you know fow to solve this?
Thanks a lot!
I already tried some ideas on the web:
change
web: voila --port=$PORT --no-browser --enable_nbextensions=True notebooks/ETC.ipynb
by
worker: voila --port=$PORT --no-browser --enable_nbextensions=True notebooks/ETC.ipynb
The answer can be found here: issue 1047
From 0.3.0, Voila will not listen on all interfaces by default (#926) for security reasons. In the case of Heroku, you need to add --Voila.ip=0.0.0.0 to your command in the Procfile to make it work.
See also: https://github.com/voila-dashboards/voila-heroku

"at=error code=H10 desc="App crashed" error on heroku, how to fix?

Deployed on heroku with Intellij Spring boot using gradle. However, when I try to connect with the distributed url, the following error message appears.
at=error code=H10 desc="App crashed" method=GET path="/" host=[my_url] request_id=[...id] fwd="xxx.xx.xxx.xxx" dyno= correct= service= status=503 bytes= protocol=https
As a result of running heroku logs --dyno router in the directory where the source file is located, only an error was output. How can I solve this?
[EDIT]
The error message is:

Deploy ember and express in heroku

I'm using ember-cli and an express as server(is not a mock), what steps
should I do ? I tried the ember-cli but it does not include express...also I connected with github, my logs are:
2015-03-08T02:38:29.848078+00:00 heroku[api]: Deploy b868570 by xxx#gmail.com
2015-03-08T02:38:29.848078+00:00 heroku[api]: Release v6 created by xxx#gmail.com
2015-03-08T02:38:30.082787+00:00 heroku[web.1]: State changed from crashed to starting
2015-03-08T02:38:37.353932+00:00 heroku[web.1]: Starting process with command `sh boot.sh`
2015-03-08T02:38:39.134915+00:00 app[web.1]: nginx: [emerg] "server" directive is not allowed here in /app/config/nginx.conf:4
2015-03-08T02:38:39.961113+00:00 heroku[web.1]: Process exited with status 1
2015-03-08T02:38:39.981607+00:00 heroku[web.1]: State changed from starting to crashed
2015-03-08T02:38:52.513415+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=conne.herokuapp.com request_id=ce29d7bf-2d26-4ead-ad4f-f8037d924410 fwd="177.129.71.147" dyno= connect= service= status=503 bytes=
2015-03-08T02:38:53.349045+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=conne.herokuapp.com request_id=2d98de70-f07e-473d-bb8e-e936b166b33e fwd="177.129.71.147" dyno= connect= service= status=503 bytes=

Resources