Closed giolaq closed 9 years ago
What error do you get when you try to set this up in Heroku, it is been more then a year ago that I played with heroku, because of the custom buildpack and the updates of the dart sdk ...
2015-03-06T21:55:14.330418+00:00 app[web.1]: Unhandled exception:
2015-03-06T21:55:14.330426+00:00 app[web.1]: Uncaught Error: The null object does not have a method 'serve'.
2015-03-06T21:55:14.330428+00:00 app[web.1]:
2015-03-06T21:55:14.330432+00:00 app[web.1]: Receiver: null
2015-03-06T21:55:14.330430+00:00 app[web.1]: NoSuchMethodError: method not found: 'serve'
2015-03-06T21:55:14.330435+00:00 app[web.1]: Stack Trace:
2015-03-06T21:55:14.330434+00:00 app[web.1]: Arguments: [Instance of '_HttpRequest', "../build/web/", "game.html"]
2015-03-06T21:55:14.330437+00:00 app[web.1]: #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
2015-03-06T21:55:14.330439+00:00 app[web.1]: #1 WebApplication._resolveStatic (package:forcemvc/server/web_application.dart:102:27)
2015-03-06T21:55:14.330462+00:00 app[web.1]: #3 _RootZone.runUnaryGuarded (dart:async/zone.dart:1093)
2015-03-06T21:55:14.330441+00:00 app[web.1]: #2 WebApplication.static../dart-sdk/bin/dart bin/server.dart
2015-03-06T21:59:09.663109+00:00 app[web.1]: INFO: 2015-03-06 21:59:09.658: Web server is running on 'http://56ed0e85-8142-41b8-bebf-1851f85ec9af:6332/'
2015-03-06T21:59:09.874787+00:00 heroku[web.1]: State changed from starting to up
2015-03-06T21:59:46.278727+00:00 app[web.1]: Unhandled exception:
2015-03-06T21:59:46.278733+00:00 app[web.1]: Uncaught Error: The null object does not have a method 'serve'.
2015-03-06T21:59:46.278737+00:00 app[web.1]: NoSuchMethodError: method not found: 'serve'
2015-03-06T21:59:46.278741+00:00 app[web.1]: Arguments: [Instance of '_HttpRequest', "../build/web/", "game.html"]
2015-03-06T21:59:46.278739+00:00 app[web.1]: Receiver: null
2015-03-06T21:59:46.278735+00:00 app[web.1]:
2015-03-06T21:59:46.278744+00:00 app[web.1]: #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
2015-03-06T21:59:46.278746+00:00 app[web.1]: #1 WebApplication._resolveStatic (package:forcemvc/server/web_application.dart:102:27)
2015-03-06T21:59:46.278742+00:00 app[web.1]: Stack Trace:
2015-03-06T21:59:46.278748+00:00 app[web.1]: #2 WebApplication.static../dart-sdk/bin/dart bin/server.dart
2015-03-06T22:04:41.941618+00:00 app[web.1]: INFO: 2015-03-06 22:04:41.937: Web server is running on 'http://db489e66-54c7-408f-b2ff-8d0c0c8837f5:16843/'
2015-03-06T22:04:42.370504+00:00 heroku[web.1]: State changed from starting to up
2015-03-06T22:04:44.644622+00:00 app[web.1]: Unhandled exception:
2015-03-06T22:04:44.644634+00:00 app[web.1]: Receiver: null
2015-03-06T22:04:44.644627+00:00 app[web.1]: Uncaught Error: The null object does not have a method 'serve'.
2015-03-06T22:04:44.644635+00:00 app[web.1]: Arguments: [Instance of '_HttpRequest', "../build/web/", "game.html"]
2015-03-06T22:04:44.666552+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=bombemotion.herokuapp.com request_id=022251e6-6e7d-48c9-89ad-1511d80d2847 fwd="83.225.43.143" dyno=web.1 connect=0ms service=48ms status=503 bytes=0
2015-03-06T22:04:44.644637+00:00 app[web.1]: Stack Trace:
2015-03-06T22:04:44.644642+00:00 app[web.1]: #2 WebApplication.static../dart-sdk/bin/dart bin/server.dart
2015-03-06T22:18:56.360010+00:00 heroku[web.1]: State changed from starting to up
2015-03-06T22:18:56.294744+00:00 app[web.1]: INFO: 2015-03-06 22:18:56.278: Web server is running on 'http://745d1fb0-92b6-4307-b556-77aca27e2434:31302/'
Oké I am going to try running this application in 2 modes! One with DART_SERVE_URL and one time without see if it makes a difference.
It is starting and working correct locally in these 2 modes :)
Did you run pub build? so a build folder is been created on heroku ...
It is also strange that he says noMethodFound exception ...
Locally it works, on heroku running pub build automatically, it shows me this errors. I'll try on Google Cloud soon.
Yes indeed, but I remember that I needed to activate websockets on heroku ... don't know if that is still necessary
I will do a try too tomorrow. What is the version of the dart sdk on heroku ... I guess that is the same as on our computers ... I need to get some sleep ;) ... keep me posted ;)
It seems like he could not initiate servingAssistent ... strange, typically something environmental ... some small difference between local and heroku ...
Yes me too, let's have some sleep! :) Dart version is 1.8.5 same in heroku.
-----> Installing Dart VM via URL https://storage.googleapis.com/dart-archive/channels/stable/release/42828/sdk/dartsdk-linux-ia32-release.zip SDK: zip detected % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 10.1M 100 10.1M 0 0 20.1M 0 --:--:-- --:--:-- --:--:-- 20.1M -----> Copy Dart binaries to app root -----> Dart cmd found at -rwx------ 1 u8253 8253 11537592 Mar 7 16:33 /app/dart-sdk/bin/dart /tmp/buildpack_9ea87c25d96a3cce834c990cfc25e963/bin/compile: line 86: /app/dart-sdk/bin/dart: No such file or directory
! Push rejected, failed to compile Dart app
I am failing on installing Dart VM what is your DART_URL_SDK? Using this buildpack https://github.com/igrigorik/heroku-buildpack-dart
It builds it correctly, now I need some access to the logs, will try to deploy another simple app tomorrow! And compare it, the tooling in heroku are improved, I like it :)
I cannot make it work with GClud/Docker too, It seems docker build can't find pubspec.yaml ERROR 2015-03-08 13:56:34,611 containers.py:283] pubspec.*: no such file or directory I'm following https://www.dartlang.org/server/google-cloud-platform/app-engine/
pubspec.yaml is something essential ... still try to get it working on heroku ;-) ... I know that dart hosting is an issue ... not a lot of options and most of them are all very custom.
Yes pubspec.yaml is in the directory but it's seem that pubspec.* expression is not working identifying the right file
You can maybe ask this in the dart cloud mailing group ...
Any news? I'm trying in DigitalOcean + Dokku and have some others problems. I want to have a server side platform to run a game starting by this in a conference. Thank you for the help
I have it almost working, some tweaks and some more time and then you will have a good solutions ...
Great news :) I got it working on Heroku.
ClientServe was put to false so it crashed, because port environment variable was not set ...
http://forcegame.herokuapp.com/
Can you test this too, I am very sorry that it took me so long ;) It give me also some great insides into heroku so that is great too. So lets finish this game now :)
Thank you! I tested your link, but playing the client don't show the list with other players, and sometimes the server goes off showing "Disconnected - start 'bin/server.dart' to continue"
Sometimes the server goes off showing "Disconnected - start 'bin/server.dart' to continue"
After a period of inactivity the heroku server puts himself into sleep mode. So you need to refresh the page. With pooling you want have that ;)
I filled in my name and then in another window I am filling in another name and then I see a list of opponents!
Well it is indeed not good ... but we can make it better.
I see what is going on, I fixed it, it is an old demo version of 'Force' so it is not that up to date anymore ...
I cleaned up some code in tictactoe. Added broadcast streams in forceclient and added some functionality to keep track of not sended packages when the client don't reaches the server ... test it out and if you find it a good version I can publish it to pub :)
Thanks, but using http://forcegame.herokuapp.com/ gives me empty opponent list in all the tests I've done. Also deploying to my server. I'm trying with Chrome, Firefox and Safari. When I press Enter after filling a name, in the console there's WebSocket not connected, message Instance of 'aa' not sent WebSocket not connected, message Instance of 'aa' not sent
And in dartium? What does it give you as error? Instance of 'aa' doesn't tell me a lot. I really want to solve this ...
I probably forgot something ...
Yes I see, you are not connected to the server yet ... so it will not send the websocket message, but when you are it will do that, it saves it now in notSendedPackages. It would be nice if you could help me give me some more insides in your encounters still, it is hard to solve something when you don't have that problem.
Was it working better locally before my changes yesterday?
Locally is working, deploying on a remote server and playing doesn't show the right opponents list. Can you see the right list in http://forcegame.herokuapp.com/ ? I need to push it on my heroku and debug it.
Ok I see, well I see a list on http://forcegame.herokuapp.com/ and I can play against another tab. Yesterday I had also the problem of Websocket not connected, so I added offline behaviour in dart force, maybe there is still something not correct in that code.
It seems on my laptop ( OSX ) that after "chosing a socket implementation!" the client don't connect to the ws. Running it locally wrote instead "connected!" after the previous step.
I see, I am working on a windows 7. I don't have a mac :s
It has maybe something todo with websockets, os x, heroku, ...
In linux + Chrome is ok, on Android + Chrome is not working,
I have an android phone, so I will debug it and see what I can do on that platform.
:O Now is working, http://forcegame.herokuapp.com/ :smile:
The html template had a hidden-xs on the opponent list, I removed it so you should see it now on an android phone.
Heroku also disconnects a websocket after 50 seconds of inactivity.
"The last important piece of logic is a keep-alive for the WebSocket connection. The request timeout window on Heroku still applies to WebSocket connections. An application must send some data across the connection once every 55 seconds or it will be closed by the router. The original chat sample included a robot that would send a message to the room once every 30 seconds. This fulfills the keep-alive requirement." - From an article on Heroku.
So I will implement the 'ping pong' protocol for websockets. We are getting closer ;-)
Thank you! :+1: All is up and running now
Ping pong protocol is working now, you can check it on http://forcegame.herokuapp.com/
I don't know if the outside api, is good with.
fs.activateKeepAlive();
What do you think?
When there are still some issues I am glad to hear that ;)
What is the right configuration to run this example on Heroku? I have manually create a "views" directory because the server part look for it. But from the other errors I think I've to set the right ForceServer fs = new ForceServer(host: ".... configuration. Any Hints?