Dev appserver fails to properly reload server app

Skip to first unread message

P.Y. Laligand

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:

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

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

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

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

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

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

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


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

Unhandled exception:

Uncaught Error: SocketException: Failed to create server socket (OS Error: Address already in use, errno = 48), address =, 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 (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] 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?


P.Y. Laligand

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

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 passes the value on to the custom runtime, so

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


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
Visit this group at

P.Y. Laligand

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
0 new messages