Dev appserver fails to properly reload server app

65 views
Skip to first unread message

P.Y. Laligand

unread,
Mar 18, 2016, 2:43:31 AM3/18/16
to Dart Server-side and Cloud Development

Hi there,


I've been playing with a little Dart server based on the helloworld example. When I first start the dev_appserver everything works fine, but as soon as I edit a source file the dev server tries to reload the instance and fails miserably:


$ dev_appserver.py --custom_entrypoint "dart bin/server.dart 8088" app.yaml --log_level debug --max_module_instances 1

INFO     2016-03-18 06:33:01,381 application_configuration.py:431] No version specified. Generated version id: 20160318t063301

INFO     2016-03-18 06:33:01,381 devappserver2.py:769] Skipping SDK update check.

INFO     2016-03-18 06:33:01,420 api_server.py:205] Starting API server at: http://localhost:54208

INFO     2016-03-18 06:33:01,426 dispatcher.py:197] Starting module "default" running at: http://localhost:8080

INFO     2016-03-18 06:33:01,428 admin_server.py:116] Starting admin server at: http://localhost:8000

INFO     2016-03-18 06:34:15,682 module.py:1768] [default] Detected file changes:

  /Users/pylaligand/Work/destiny/destiny-tools/slack-bot/bin/server.dart

INFO     2016-03-18 06:34:15,684 module.py:1893] Waiting for instances to restart

Unhandled exception:

Uncaught Error: SocketException: Failed to create server socket (OS Error: Address already in use, errno = 48), address = 0.0.0.0, port = 8088

Stack Trace:

#0      _NativeSocket.bind.<anonymous closure> (dart:io-patch/socket_patch.dart:502)

#1      _rootRunUnary (dart:async/zone.dart:911)

#2      _CustomZone.runUnary (dart:async/zone.dart:811)

#3      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:494)

#4      _Future._propagateToListeners (dart:async/future_impl.dart:577)

#5      _Future._completeWithValue (dart:async/future_impl.dart:368)

#6      _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:422)

#7      _rootRun (dart:async/zone.dart:904)

#8      _CustomZone.run (dart:async/zone.dart:803)

#9      _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:736)

#10     _microtaskLoop (dart:async/schedule_microtask.dart:43)

#11     _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)

#12     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

#13     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)


#0      _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:895)

#1      _microtaskLoop (dart:async/schedule_microtask.dart:43)

#2      _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)

#3      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

WARNING  2016-03-18 06:34:45,685 module.py:1897] All instances may not have restarted


After that, it looks like the old instance is still running as it responds to queries with the old code.


Possibly related, I can never see any log from my application in the command-line logs - I tried straight print, loggingService, logging package using the AppEngine adapter.



Any idea how to fix all this?


Thanks!

P.Y. Laligand

unread,
Mar 18, 2016, 2:47:24 AM3/18/16
to Dart Server-side and Cloud Development
(of course, this is using App Engine)

Søren Gjesse

unread,
Mar 18, 2016, 4:28:20 AM3/18/16
to P.Y. Laligand, Dart Server-side and Cloud Development
The "port" you pass to server.dart should the value {port}, as dev_appserver.py passes the value on to the custom runtime, so

$ dev_appserver.py --custom_entrypoint "dart bin/server.dart {port}" app.yaml

Regards,
Søren

---
Søren Gjesse
Software Engineer, Google Denmark
CVR nr. 28 86 69 84


--
You received this message because you are subscribed to the Google Groups "Dart Server-side and Cloud Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud+un...@dartlang.org.
Visit this group at https://groups.google.com/a/dartlang.org/group/cloud/.

P.Y. Laligand

unread,
Mar 18, 2016, 11:20:14 AM3/18/16
to Søren Gjesse, Dart Server-side and Cloud Development
Oh wow I had totally understood "{port}" as "put whichever value you prefer in there". Just tried to put it verbatim and sure enough things work beautifully. Thanks much!

Now on to figuring out where my logs go...
Reply all
Reply to author
Forward
0 new messages