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

Error deploying to Heroku #7

Closed
evhan55 opened this issue Mar 18, 2017 · 6 comments
Closed

Error deploying to Heroku #7

evhan55 opened this issue Mar 18, 2017 · 6 comments

Comments

@evhan55
Copy link

evhan55 commented Mar 18, 2017

Hello!

I am very excited to try some networked-aframe projects with my team at elevr.com. We all have Google Pixel/Daydream devices.

I tested networked-aframe locally and it ran fine.

I then tried deploying to Heroku and ran into this error:

npm ERR! Tell the author that this fails on your system:
npm ERR!     watchify src/index.js -o server/static/build.js -v

The logs also say this at some point:

sh: 1: watchify: not found

I changed the package.json to match my node and npm local versions.
I am not sure if it has to do with the npm run easyrtc-install step that perhaps Heroku is never running. I tried to figure out how to have Heroku run that line automatically after npm install but wasn't able to make it work.

Please let me know if you have any tips, thank you!

@haydenjameslee
Copy link
Collaborator

haydenjameslee commented Mar 20, 2017

Hi there! Great to hear you're excited :D

I haven't tried to setup NAF on Heroku yet but I'd like to include it as a default configuration soon. That being said, try changing the package.json's "start" script to node ./server/server.js. The reference to watchify isn't necessary on a deployed instance so hopefully this works! I'll let you know when I've given it a shot myself too. Would love to hear if you get it working.

@evhan55
Copy link
Author

evhan55 commented Mar 20, 2017

Thank you for the help!

Ah, makes sense that watchify isn't needed since that is only for watching local dev changes and refreshing the browser on the fly?

I tried changing the start script to what you said, and removing the Procfile I had created, but I still get an error, here is the complete log:

2017-03-20T15:05:37.630656+00:00 heroku[web.1]: Starting process with command `npm start`
2017-03-20T15:05:41.298355+00:00 app[web.1]: 
2017-03-20T15:05:41.298372+00:00 app[web.1]: > networked-aframe@0.1.0 start /app
2017-03-20T15:05:41.298373+00:00 app[web.1]: > node ./server/server.js
2017-03-20T15:05:41.298374+00:00 app[web.1]: 
2017-03-20T15:05:41.824443+00:00 app[web.1]: info    - EasyRTC: Starting EasyRTC Server (v1.1.0) on Node (v7.1.0)
2017-03-20T15:05:41.825889+00:00 app[web.1]: debug   - EasyRTC: Emitting event 'startup'
2017-03-20T15:05:41.826832+00:00 app[web.1]: debug   - EasyRTC: Running func 'onStartup'
2017-03-20T15:05:41.829707+00:00 app[web.1]: listening on http://localhost:8080
2017-03-20T15:05:41.831583+00:00 app[web.1]: debug   - EasyRTC: Configuring Http server
2017-03-20T15:05:41.831816+00:00 app[web.1]: debug   - EasyRTC: Setting up API files to be accessed from '/easyrtc/'
2017-03-20T15:05:41.834114+00:00 app[web.1]: debug   - EasyRTC: Configuring Socket server
2017-03-20T15:05:41.858735+00:00 app[web.1]: info    - EasyRTC: EasyRTC Server Ready For Connections (v1.1.0)
2017-03-20T15:05:41.835032+00:00 app[web.1]: debug   - EasyRTC: Creating application: 'default'
2017-03-20T15:05:41.859369+00:00 app[web.1]: Initiated
2017-03-20T15:05:41.840717+00:00 app[web.1]: debug   - EasyRTC: [default] Room [default] Running func 'onRoomCreate'
2017-03-20T15:05:41.843211+00:00 app[web.1]: debug   - EasyRTC: Creating room: 'default' with options: {}
2017-03-20T15:06:37.929784+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2017-03-20T15:06:37.930025+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-03-20T15:06:38.073288+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-20T15:06:38.078097+00:00 heroku[web.1]: Process exited with status 137
2017-03-20T15:06:39.347796+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shrouded-headland-88245.herokuapp.com request_id=d2675aa5-87e7-4840-adf8-6486cd59c8c6 fwd="24.218.185.235" dyno= connect= service= status=503 bytes= protocol=https

Seems like it waits a minute for the port to bind and then it gives up?

@evhan55
Copy link
Author

evhan55 commented Mar 20, 2017

In case this is easier to see, here is the relevant error line I think?

2017-03-20T15:06:37.929784+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

@evhan55
Copy link
Author

evhan55 commented Mar 20, 2017

Hi! I got it working!

https://shrouded-headland-88245.herokuapp.com/basic.html

I just had to change 8080 to process.env.PORT in server.js

Let me know if you'd like to know anything more about how I did the deploy on Heroku, would be happy to tell you whatever I did. I think the only changes were the port line and the start script you mentioned.

@evhan55
Copy link
Author

evhan55 commented Mar 20, 2017

Ah! I have a new issue now, I can open the Heroku URL on two tabs on my Macbook and the networking works. Then, when I try the same URL on my Google Pixel (which should be a third user), the URL loads and the app loads, but it's not networked, just a lonely instance.

I am leaving this comment here just fyi on my progress, but if the problem persists I can open a new issue for that, and close this issue anytime.

@haydenjameslee
Copy link
Collaborator

haydenjameslee commented Mar 21, 2017

Awesome! I've added the port fix to the main branch: #5

Changed the npm start script: 828034f

And I just published a tutorial on getting started that should help a lot!

Tutorial: Getting started with Networked-Aframe.

The mobile issue has been reported here: #2 I haven't reproduced yet but will be taking a look shortly.

Thanks for your investigation!

mohrtw pushed a commit to LifeScopeLabs/networked-aframe that referenced this issue Jun 6, 2018
…emove-entity-issues

Catch errors related to race conditions on ownership change and entity removal. Also fix memory leak.
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

2 participants