Cannot compile flutter engine: The compiler crashed: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:51211/jQ6Nwep21kY=/ws

This issue has been created since 2022-09-23.

Steps to Reproduce

Follow the steps to compile the engine. https://github.com/flutter/flutter/wiki/Compiling-the-engine#compiling-for-android-from-macos-or-linux

When in the step of ninja -C out/android_debug_unopt_x64, I see the following crash.

Expected results:

Compile normally.

Actual results:

Crash.

ninja -C out/android_debug_unopt_x64
ninja: Entering directory `out/android_debug_unopt_x64'
[1/128] ACTION //third_party/dart/runtime/observatory:build_observatory(//build/toolchain/android:clang_x64)
FAILED: gen/third_party/dart/runtime/observatory/observatory/web/main.dart.js gen/third_party/dart/runtime/observatory/observatory/web/main.dart.js.map 
vpython3 ../../third_party/dart/build/gn_run_binary.py compiled_action /Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/tools/sdks/dart-sdk/bin/dart --dfe=/Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/tools/sdks/dart-sdk/bin/snapshots/kernel-service.dart.snapshot compile js -o /Volumes/MyExternal/ExternalRefCode/engine/src/out/android_debug_unopt_x64/gen/third_party/dart/runtime/observatory/observatory/web/main.dart.js --packages=/Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/.dart_tool/package_config.json --no-sound-null-safety /Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/runtime/observatory/web/main.dart --enable-asserts
Command failed: /Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/tools/sdks/dart-sdk/bin/dart --dfe=/Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/tools/sdks/dart-sdk/bin/snapshots/kernel-service.dart.snapshot compile js -o /Volumes/MyExternal/ExternalRefCode/engine/src/out/android_debug_unopt_x64/gen/third_party/dart/runtime/observatory/observatory/web/main.dart.js --packages=/Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/.dart_tool/package_config.json --no-sound-null-safety /Volumes/MyExternal/ExternalRefCode/engine/src/third_party/dart/runtime/observatory/web/main.dart --enable-asserts
output: Info: Compiling without sound null safety
../../third_party/dart/runtime/observatory/lib/src/service/object.dart:2138:3:
Hint: This 'noSuchMethod' implementation is guaranteed to throw an exception. The generated code will be smaller if it is rewritten.
Rewrite to 'noSuchMethod(Invocation i) => super.noSuchMethod(i);'.
  noSuchMethod(_) => throw "Unimplemented ServiceMap method";
  ^
The compiler crashed: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:51211/jQ6Nwep21kY=/ws


ninja: build stopped: subcommand failed.

I workaround by patching thirdparty/dart with this:

diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index f704353ab67..a998f159322 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -2135,7 +2135,9 @@ class ServiceMap extends ServiceObject
   int get length => _map.length;
 
   // Suppress compile-time error about missing Map methods.
-  noSuchMethod(_) => throw "Unimplemented ServiceMap method";
+// NOTE HACK!!!
+noSuchMethod(Invocation i) => super.noSuchMethod(i);
+  // noSuchMethod(_) => throw "Unimplemented ServiceMap method";
 
   String toString() => "ServiceMap($_map)";
 }

But this is just a hack - flutter source code should be compileable IMHO.

Update: I see what is going wrong. It is indeed not that problem, but because I set export http_proxy=..., so flutter somehow cannot connect to its components.
The issue remains here (closed) just in case someone has the same problem as me.

Code sample
Logs
using master branch
More Details About Repo
Owner Name flutter
Repo Name flutter
Full Name flutter/flutter
Language Dart
Created Date 2015-03-06
Updated Date 2022-10-05
Star Count 145512
Watcher Count 3569
Fork Count 23398
Issue Count 11205

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Saved Chunk verification 0 2022-06-30 2022-09-12
Failed to upgrade to 2.13.0 from 2.13.0-rc.2. 2 2022-09-20 2022-09-27
Kinetic switchs (unsupported) 0 2022-05-30 2022-09-15
Localization support 2 2020-11-01 2022-05-11
IPP INFRA Proxy Support 1 2020-10-22 2022-05-11
初始的管理员账号在加入其他人的项目和项目组时无法被移除 4 2022-03-28 2022-09-15
Make `--disable-ipv6` the default? 2 2021-11-30 2022-09-19
RTSP audio backchannel support 0 2022-04-20 2022-08-20
logs print credentials if error in catalog with Rich Logging show_locals=True 3 2022-07-19 2022-08-23
在alpine容器内部分系统依赖缺失,导致脚本某些命令无法运行 5 2022-07-15 2022-10-04
Replace 'skip' button with 'previous' button 5 2020-11-10 2022-08-14
callback on memory store key expiration 4 2021-03-15 2022-10-05
PHPStan does not work with UNC paths on Windows 8 2020-07-01 2022-07-18
Config file 'level' almost never used 2 2020-05-02 2022-07-18
NPC_EMOTION and NPC_EMOTION_ON incorrect effect 3 2022-04-10 2022-10-04
dockerized version 8 2021-12-27 2022-01-16
Feature request: Allow enabling auto-merge 1 2021-12-09 2022-09-02
[BUG] Unable to extract a scalar value from nested struct column 0 2022-08-25 2022-09-13
[FEA] Generate unique keys table in java JNI contiguousSplitGroups 0 2022-08-29 2022-09-13
ExecAlias doesn't set returncode & other parameters upon execution 1 2022-04-12 2022-09-28
instances: User has no userattributes 0 2021-09-20 2022-09-21
Add the flexibility of multiple roles 1 2022-08-12 2022-10-04
Bug with emails that have "." in them breaks username requirements 0 2022-08-12 2022-10-04
Update doc to reference `--no-crud` flag (SDL generator behavior changed to create CRUD by default) 4 2022-05-19 2022-09-02
VSCode, Web version. 1 2021-09-16 2022-08-28
⚠️ Nightly upstream-dev CI failed ⚠️ 1 2021-11-23 2022-08-26
missing locales for velocity 4 2022-07-21 2022-10-04
Images inside _posts folder are not recognized 1 2021-06-17 2022-09-26
category field is not properly escaped causing an `xmlParseEntityRef: no name` parse error 2 2021-06-08 2022-09-26
long_file_cut_by_srt.py", line 46, in cut_file_by_srt if end_time - start_time <= min_length or len(line[2].replace(" ", "")) < min_text: IndexError: list index out of range 0 2022-08-01 2022-09-21
浏览器跳转本地播放器时字幕会有找不到的情况 3 2022-03-05 2022-10-03
AOP do not support '*' on class field with execution pointcut designator 3 2022-04-13 2022-09-27
Query panel space decreased after sidebar width change. 0 2022-03-12 2022-09-27
Can't deactivate LanguageTool in GoogleDocs 3 2022-02-01 2022-07-10
SyntaxError: Unexpected token throws when using with flow 1 2021-01-21 2022-09-19
Failed to install karmada via helm 2 2022-03-07 2022-08-16
Nullability of optional fields in manifests and descriptors 1 2022-02-03 2022-10-04
GET parameter 'role' does not set filter 1 2021-12-08 2022-09-02
[Playground][Wasm]- Indicator for the selected snippets option is not working when move scrollbar for snippets. 1 2021-10-25 2022-08-01
Nuitka failed to detect DLLs that come from PATH elements with non-unicode characters 8 2022-06-07 2022-09-23
error running liberty:dev 1 2020-10-28 2022-09-19
Make skuname parameter case consistent across disk and file 1 2021-10-01 2022-09-30
(FreeBSD)(CLANG) Sendfile7 support is broken 8 2022-06-12 2022-09-20
Can we Automate/Schedule Heap and Thread Dump at regular interval of Time 2 2020-04-28 2022-09-01
paddlepaddle2.2 源码cmake时模块下载失败 3 2022-04-28 2022-09-13
为什么用SSR,怎么很多软件都访问被拒绝了 1 2022-05-27 2022-09-09
How to get the end point of the episode and the shortest path showing on the top down map of HM3D data? 1 2022-07-26 2022-10-04
Bug when broadcasting TaggedLogging(without a block) loggers. 0 2022-08-19 2022-09-16
Proposal: MySQL UUID Proposal [Draft] 12 2022-08-18 2022-09-18
Gradio dataframe not taking 'date' datatype 8 2022-07-19 2022-09-21