dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.09k stars 1.56k forks source link

Dartium dependency on Pub Serve makes it not start if NW proxies are in use #18964

Closed scheglov closed 9 years ago

scheglov commented 10 years ago

Originally in https://code.google.com/p/dart/issues/detail?id=18847

Unfortunately, with the continuous build of May 22, our application does not work anymore (Dartium reports errors and does not start). Is there a bit more stable version available with that fix?

a-siva commented 10 years ago

Can you be a little more specific about what error is being reported.


Added NeedsInfo label.

scheglov commented 10 years ago

I don't know. I hope that user from https://code.google.com/p/dart/issues/detail?id=18847 will provide more information.

DartBot commented 10 years ago

This comment was originally written by anja.gers...@gmail.com


Hi,

I use Dart from my company's network with proxy.

When I start Dartium (Dart SDK version 1.5.0-edge.36468), then I get the error:

--- 08:58:09 Starting pub serve : hanalite-admin --- Loading source assets... (1.6s) Loading smoke/src/default_transformer transformers... (1.0s) Transformer library "package:smoke/src/default_transformer.dart" not found.

In older version, pub serve was not called. Why is pub serve called with the new version?

Best regards, Anja

DartBot commented 10 years ago

This comment was originally written by @zoechi


pub serve is the new default

DartBot commented 10 years ago

This comment was originally written by anja.gerst...@gmail.com


I think the issue is that pub serve does not work with proxies. (we are using Windows as OS)

When I start Dartium from a network without proxies, this error does not appear, but other errors. I will open an extra bug for this.

anders-sandholm commented 10 years ago

cc @munificent. Added C7, Triaged labels. Changed the title to: "Dartium dependency on Pub Serve makes it not start if NW proxies are in use".

a-siva commented 10 years ago

Removed Area-Dartium label. Added Area-Pub label.

nex3 commented 10 years ago

When loading transformers, "pub serve" starts a server on localhost and starts an isolate that loads its sources from that server. All the HTTP requests go through the VM, so if there's special configuration that needs to happen to make it work with proxies that's where it should go. If your proxy forbids any localhost connections, though, there may not be a solution until issue #16368 is fixed.


Removed Area-Pub label. Added Area-VM label.

iposva-google commented 10 years ago

Removed Area-VM label. Added Library-IO, Area-Library labels.

iposva-google commented 10 years ago

Bob, are you guys using "localhost" or "127.0.0.1" to connect locally to pub? In the past I have experienced issues where the latter would work in places where the name localhost wouldn't.


cc @nex3.

nex3 commented 10 years ago

We use "localhost" for "pub serve" and "127.0.0.1" for "pub build".

Anja: if you run "pub serve --hostname 127.0.0.1", does it work?

anders-sandholm commented 10 years ago

Removed Priority-Unassigned label. Added Priority-High, NeedsInfo labels.

DartBot commented 10 years ago

This comment was originally written by anja.gerstma...@gmail.com


In my environment variables, I have set

http_proxy proxy.wdf.sap.corp:8080 https_proxy proxy.wdf.sap.corp:8080

Otherwise, pub get would not work.

With this settings, "pub serve --hostname 127.0.0.1" does not work:

c:\git\hanalite-admin>pub serve --hostname 127.0.0.1 Loading source assets... (1.2s) Loading smoke/src/default_transformer transformers... Uncaught Error: Failure getting http://127.0.0.1:54655/packages/smoke/src/default_transformer.dart: 403 Forbidden Stack Trace:

­0 _httpGet.<anonymous closure>.<anonymous closure> (dart:builtin:128)

­1 _rootRun (dart:async/zone.dart:719)

­2 _RootZone.run (dart:async/zone.dart:862)

­3 _BaseZone.runGuarded (dart:async/zone.dart:574)

­4 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:385)

­5 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:394)

­6 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283)

­7 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:93)

­8 _handleDone (dart:async/stream_pipe.dart:159)

­9 _rootRun (dart:async/zone.dart:719)

­10 _RootZone.run (dart:async/zone.dart:862)

­11 _BaseZone.runGuarded (dart:async/zone.dart:574)

­12 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:385)

­13 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:394)

­14 _DelayedDone.perform (dart:async/stream_impl.dart:604)

­15 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:701)

­16 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:661)

­17 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)

­18 _asyncRunCallback (dart:async/schedule_microtask.dart:32)

­19 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:128)

(1.1s) Transformer library "package:smoke/src/default_transformer.dart" not found

"pub serve --hostname localhost" does not work either:

c:\git\hanalite-admin>pub serve --hostname localhost Loading source assets... (1.1s) Loading smoke/src/default_transformer transformers... Uncaught Error: Failure getting http://[::1]:54658/packages/$pub/transformer_isolate.dart: 503 Service Unavailable Stack Trace:

­0 _httpGet.<anonymous closure>.<anonymous closure> (dart:builtin:128)

­1 _rootRun (dart:async/zone.dart:719)

­2 _RootZone.run (dart:async/zone.dart:862)

­3 _BaseZone.runGuarded (dart:async/zone.dart:574)

­4 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:385)

­5 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:394)

­6 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283)

­7 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:93)

­8 _handleDone (dart:async/stream_pipe.dart:159)

­9 _rootRun (dart:async/zone.dart:719)

­10 _RootZone.run (dart:async/zone.dart:862)

­11 _BaseZone.runGuarded (dart:async/zone.dart:574)

­12 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:385)

­13 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:394)

­14 _DelayedDone.perform (dart:async/stream_impl.dart:604)

­15 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:701)

­16 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:661)

­17 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)

­18 _asyncRunCallback (dart:async/schedule_microtask.dart:32)

­19 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:128)

(1:16.9s) 'Unhandled exception: Failure getting http://[::1]:54658/packages/$pub/transformer_isolate.dart: 503 Service Unavailable

­0 _rootHandleUncaughtError.<anonymous closure>.<anonymous closure> (dart:async/zone.dart:713)

­1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)

­2 _asyncRunCallback (dart:async/schedule_microtask.dart:32)

­3 _asyncRunCallback (dart:async/schedule_microtask.dart:36)

­4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:128)'

dart:isolate-patch/isolate_patch.dart 254             Isolate.spawnUri e:\b\build\slave\dart-editor-win-be\build\dart\sdk\lib_internal\pub\lib\src\dart.dart 161 _isolateBuffer dart:isolate-patch/isolate_patch.dart 221 _startIsolate.isolateStartHandler dart:isolate-patch/isolate_patch.dart 124 _RawReceivePortImpl._handleMessage

andersjohnsen commented 10 years ago

Hi Anja,

It appears that your proxy intercepts localhost connections. They may need to be explicitly allowed.

Can you try adding the following to your existing environment:

  no_proxy localhost,127.0.0.1,::1

Thanks!,

DartBot commented 10 years ago

This comment was originally written by anja.gers...@gmail.com


Hi Anders, The error is now gone by setting no_proxy localhost,127.0.0.1,::1 Thanks a lot, Anja

sgjesse commented 10 years ago

Great to hear it is now working. For a bit of background see issue #15215, where we considered automatically adding the loopback addresses to 'no_proxy', but due to the behavior of wget and curl put that on hold.

anders-sandholm commented 10 years ago

Added Fixed label.