Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application error while serving it throug heroku #63

Closed
star-step opened this issue Nov 9, 2020 · 9 comments
Closed

Application error while serving it throug heroku #63

star-step opened this issue Nov 9, 2020 · 9 comments

Comments

@star-step
Copy link

No description provided.

@jaruba
Copy link
Owner

jaruba commented Nov 9, 2020

@star-step Any logs? I would need to see the error to be able to help..

@vedo18
Copy link

vedo18 commented Nov 9, 2020

I'm getting this error. Please take a look and try to resolve it

2020-11-09T12:23:40.000000+00:00 app[api]: Build succeeded
2020-11-09T12:23:55.929240+00:00 heroku[web.1]: Starting process with command npm start
2020-11-09T12:23:58.867594+00:00 app[web.1]:
2020-11-09T12:23:58.867608+00:00 app[web.1]: > [email protected] start /app
2020-11-09T12:23:58.867609+00:00 app[web.1]: > node start.js
2020-11-09T12:23:58.867609+00:00 app[web.1]:
2020-11-09T12:23:59.620435+00:00 app[web.1]: > [email protected] start-front /app> nwb serve-react-app
2020-11-09T12:23:59.628435+00:00 app[web.1]: sh: 1:
2020-11-09T12:23:59.630425+00:00 app[web.1]: nwb: not found
2020-11-09T12:23:59.630699+00:00 app[web.1]:
2020-11-09T12:23:59.630700+00:00 app[web.1]:
2020-11-09T12:23:59.638098+00:00 app[web.1]: > [email protected] start-back /app> cross-env NODE_ENV=development electron .
2020-11-09T12:23:59.640116+00:00 app[web.1]: npm
2020-11-09T12:23:59.640282+00:00 app[web.1]: ERR!
2020-11-09T12:23:59.640445+00:00 app[web.1]: code ELIFECYCLE
2020-11-09T12:23:59.640446+00:00 app[web.1]:
2020-11-09T12:23:59.640848+00:00 app[web.1]: npm ERR! syscall spawn
2020-11-09T12:23:59.640849+00:00 app[web.1]: npm
2020-11-09T12:23:59.641039+00:00 app[web.1]: ERR! file sh
2020-11-09T12:23:59.641040+00:00 app[web.1]: npm
2020-11-09T12:23:59.641182+00:00 app[web.1]: ERR!
2020-11-09T12:23:59.641336+00:00 app[web.1]: errno ENOENT
2020-11-09T12:23:59.641337+00:00 app[web.1]:
2020-11-09T12:23:59.646027+00:00 app[web.1]: sh: 1: cross-env: not found
2020-11-09T12:23:59.646028+00:00 app[web.1]:
2020-11-09T12:23:59.646626+00:00 app[web.1]: npm
2020-11-09T12:23:59.646925+00:00 app[web.1]: ERR! [email protected] start-front: nwb serve-react-app
2020-11-09T12:23:59.646926+00:00 app[web.1]: npm ERR! spawn ENOENT
2020-11-09T12:23:59.646927+00:00 app[web.1]:
2020-11-09T12:23:59.647120+00:00 app[web.1]: npm ERR!
2020-11-09T12:23:59.647121+00:00 app[web.1]: npm ERR!
2020-11-09T12:23:59.647461+00:00 app[web.1]: Failed at the [email protected] start-front script.
2020-11-09T12:23:59.647464+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-11-09T12:23:59.647465+00:00 app[web.1]:
2020-11-09T12:23:59.656543+00:00 app[web.1]: npm ERR!
2020-11-09T12:23:59.656740+00:00 app[web.1]: code ELIFECYCLE
2020-11-09T12:23:59.656741+00:00 app[web.1]: npm ERR! syscall spawn
2020-11-09T12:23:59.656742+00:00 app[web.1]: npm ERR!
2020-11-09T12:23:59.656959+00:00 app[web.1]: file sh
2020-11-09T12:23:59.656960+00:00 app[web.1]: npm ERR! errno ENOENT
2020-11-09T12:23:59.656960+00:00 app[web.1]:
2020-11-09T12:23:59.663300+00:00 app[web.1]: npm
2020-11-09T12:23:59.663527+00:00 app[web.1]:
2020-11-09T12:23:59.663528+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-11-09T12:23:59.663528+00:00 app[web.1]: npm ERR!
2020-11-09T12:23:59.663737+00:00 app[web.1]: /app/.npm/_logs/2020-11-09T12_23_59_653Z-debug.log
2020-11-09T12:23:59.663738+00:00 app[web.1]:
2020-11-09T12:23:59.664064+00:00 app[web.1]:
2020-11-09T12:23:59.664197+00:00 app[web.1]: ERR! [email protected] start-back: cross-env NODE_ENV=development electron .
2020-11-09T12:23:59.664198+00:00 app[web.1]: npm
2020-11-09T12:23:59.664349+00:00 app[web.1]: ERR! spawn ENOENT
2020-11-09T12:23:59.664350+00:00 app[web.1]: npm
2020-11-09T12:23:59.664516+00:00 app[web.1]: ERR!
2020-11-09T12:23:59.664517+00:00 app[web.1]: npm ERR!
2020-11-09T12:23:59.664686+00:00 app[web.1]: Failed at the [email protected] start-back script.
2020-11-09T12:23:59.664687+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-11-09T12:23:59.664687+00:00 app[web.1]:
2020-11-09T12:23:59.670570+00:00 app[web.1]: web server exit
2020-11-09T12:23:59.674213+00:00 app[web.1]:
2020-11-09T12:23:59.674214+00:00 app[web.1]:
2020-11-09T12:23:59.674448+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-11-09T12:23:59.674449+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-11-09T12_23_59_665Z-debug.log
2020-11-09T12:23:59.674449+00:00 app[web.1]:
2020-11-09T12:23:59.681860+00:00 app[web.1]: back end exit
2020-11-09T12:23:59.771767+00:00 heroku[web.1]: Process exited with status 0
2020-11-09T12:23:59.826108+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-09T12:24:00.309440+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powderweb007.herokuapp.com request_id=708be7b7-9486-49f6-a734-636b79077c70 fwd="171.51.159.72" dyno= connect= service= status=503 bytes= protocol=https
2020-11-09T12:24:00.929687+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powderweb007.herokuapp.com request_id=f97de4e2-76dd-4008-85a0-3e9eaebe4871 fwd="171.51.159.72" dyno= connect= service= status=503 bytes= protocol=https
2020-11-09T12:24:11.808432+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powderweb007.herokuapp.com request_id=7ff5806f-5bc2-4e85-8315-192edec52c34 fwd="171.51.159.72" dyno= connect= service= status=503 bytes= protocol=https
2020-11-09T12:24:12.420069+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powderweb007.herokuapp.com request_id=a2a6a08e-0dbf-48ec-ac5b-db6d07312ade fwd="171.51.159.72" dyno= connect= service= status=503 bytes= protocol=https
2020-11-09T12:25:59.827310+00:00 heroku[web.1]: State changed from crashed to down

@Umang2002
Copy link

I have same error!!!

@jaruba
Copy link
Owner

jaruba commented Nov 9, 2020

There are a few errors here, but for one, I see that it tries to run Electron.

In order to host it on a server you will need to use the headless version, which is on the headless branch:
https://github.com/jaruba/PowderWeb/tree/headless

Can you try installing that branch?

There is also a community Dockerfile for the headless version if you can use that on your servers, I think this is the last known version for it: #39 (comment)

@vedo18
Copy link

vedo18 commented Nov 10, 2020

now I'm getting this

2020-11-10T06:57:17.000000+00:00 app[api]: Build succeeded
2020-11-10T06:57:23.556200+00:00 heroku[web.1]: Starting process with command npm start
2020-11-10T06:57:25.920068+00:00 app[web.1]:
2020-11-10T06:57:25.920091+00:00 app[web.1]: > [email protected] start /app
2020-11-10T06:57:25.920092+00:00 app[web.1]: > node start.js
2020-11-10T06:57:25.920092+00:00 app[web.1]:
2020-11-10T06:57:26.387248+00:00 app[web.1]: > [email protected] start-front /app> nwb serve-react-app
2020-11-10T06:57:26.391763+00:00 app[web.1]: sh: 1: nwb: not found
2020-11-10T06:57:26.391765+00:00 app[web.1]:
2020-11-10T06:57:26.400779+00:00 app[web.1]: npm
2020-11-10T06:57:26.401068+00:00 app[web.1]: ERR! code ELIFECYCLE
2020-11-10T06:57:26.401069+00:00 app[web.1]: npm ERR! syscall spawn
2020-11-10T06:57:26.401069+00:00 app[web.1]: npm ERR! file sh
2020-11-10T06:57:26.401070+00:00 app[web.1]:
2020-11-10T06:57:26.401356+00:00 app[web.1]: npm ERR!
2020-11-10T06:57:26.402456+00:00 app[web.1]: errno
2020-11-10T06:57:26.402687+00:00 app[web.1]: ENOENT
2020-11-10T06:57:26.402688+00:00 app[web.1]:
2020-11-10T06:57:26.407662+00:00 app[web.1]: npm
2020-11-10T06:57:26.408377+00:00 app[web.1]: ERR! [email protected] start-front: nwb serve-react-app
2020-11-10T06:57:26.408379+00:00 app[web.1]: npm ERR! spawn ENOENT
2020-11-10T06:57:26.408379+00:00 app[web.1]: npm ERR!
2020-11-10T06:57:26.408380+00:00 app[web.1]: npm ERR! Failed at the [email protected] start-front script.
2020-11-10T06:57:26.408383+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-11-10T06:57:26.408384+00:00 app[web.1]:
2020-11-10T06:57:26.427633+00:00 app[web.1]:
2020-11-10T06:57:26.427634+00:00 app[web.1]:
2020-11-10T06:57:26.428832+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-11-10T06:57:26.428833+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-11-10T06_57_26_418Z-debug.log
2020-11-10T06:57:26.428834+00:00 app[web.1]:
2020-11-10T06:57:26.429288+00:00 app[web.1]: npm ERR! missing script: start-back-headless
2020-11-10T06:57:26.429289+00:00 app[web.1]: npm ERR!
2020-11-10T06:57:26.429290+00:00 app[web.1]: npm ERR! Did you mean one of these?
2020-11-10T06:57:26.429291+00:00 app[web.1]: npm ERR! start-headless
2020-11-10T06:57:26.429291+00:00 app[web.1]: npm ERR! start-back
2020-11-10T06:57:26.429291+00:00 app[web.1]:
2020-11-10T06:57:26.436564+00:00 app[web.1]:
2020-11-10T06:57:26.436565+00:00 app[web.1]:
2020-11-10T06:57:26.437240+00:00 app[web.1]: npm
2020-11-10T06:57:26.437586+00:00 app[web.1]:
2020-11-10T06:57:26.437901+00:00 app[web.1]: ERR!
2020-11-10T06:57:26.438259+00:00 app[web.1]: A complete log of this run can be found in:
2020-11-10T06:57:26.438259+00:00 app[web.1]:
2020-11-10T06:57:26.438594+00:00 app[web.1]: npm
2020-11-10T06:57:26.438934+00:00 app[web.1]:
2020-11-10T06:57:26.439301+00:00 app[web.1]: ERR!
2020-11-10T06:57:26.439646+00:00 app[web.1]: /app/.npm/_logs/2020-11-10T06_57_26_429Z-debug.log
2020-11-10T06:57:26.439647+00:00 app[web.1]:
2020-11-10T06:57:26.446960+00:00 app[web.1]: web server exit
2020-11-10T06:57:26.457854+00:00 app[web.1]: back end exit
2020-11-10T06:57:26.560178+00:00 heroku[web.1]: Process exited with status 0
2020-11-10T06:57:26.614470+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-10T06:57:27.868656+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powderweb007.herokuapp.com request_id=f1bf2201-c8c8-4c8f-94cc-fef3dbb83971 fwd="106.211.187.154" dyno= connect= service= status=503 bytes= protocol=https
2020-11-10T06:57:29.180716+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powderweb007.herokuapp.com request_id=802c9843-58f7-497a-a21b-0816bced0bf8 fwd="106.211.187.154" dyno= connect= service= status=503 bytes= protocol=https

@jaruba
Copy link
Owner

jaruba commented Nov 10, 2020

Ok, the Electron related error is gone now. It seems that the primary issue now is that it's missing nwb, this is one of the devDependencies in package.json, so it looks like Heroku is only installing the production modules, but not the dev modules, which are needed to run the development environment. Please paste the npm install logs, or otherwise ensure that npm install is also installing the dev dependencies.

I'm sure we can get it working on Heroku, but it should be noted that using P2P (torrent) technologies in apps is against the Heroku Terms and Conditions, I know many that got their apps suspended on Heroku for using any torrent related project, they have an automatic way of knowing if torrent tech is used.

@jaruba
Copy link
Owner

jaruba commented Nov 10, 2020

Found this article: https://devcenter.heroku.com/changelog-items/1376

It says that:

We’ve updated the default behavior to install all dependencies listed in package.json during build, and to strip out the developer dependencies before the app is deployed.

So basically they're automatically removing all dev deps from the app intentionally before the app is deployed, which is causing the errors about nwb.. Hopefully there's a workaround for this choice they've made, but i'm not sure if it's worth looking into.. As I stated above they will most probably just suspend the app because of the torrent technologies it uses..

It's your choice if you want us to continue debugging heroku issues or not.

@jaruba
Copy link
Owner

jaruba commented Nov 10, 2020

If you guys still want to try it on Heroku anyway, I suggest moving all the devDependencies from the headless branch:
https://github.com/jaruba/PowderWeb/blob/headless/package.json#L98-L108

To the dependencies array here:
https://github.com/jaruba/PowderWeb/blob/headless/package.json#L30

This will guarantee that the needed dev dependencies won't be removed by Heroku prior to starting the app.

The correct way of using the headless branch (at least locally) would be:

git clone -b headless https://www.github.com/jaruba/PowderWeb.git
cd PowderWeb
npm install
cd public
bower install
cd ..
npm run build-front
npm run start-headless

And port 3000 (currently the default port) would need to be exposed on the server.

If you do this correctly, I think it should fix all the current errors I've seen in those logs.

@jaruba
Copy link
Owner

jaruba commented Nov 12, 2020

Closing this due to inactivity and the fact that Powder Web cannot be hosted on Heroku (they will just suspend the app if you try to deploy it there)

If there are further questions / issues with this and someone still wants to try deploying it there, you can reopen the issue.

@jaruba jaruba closed this as completed Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants