Skip to content

The Dart Analysis Server server crashed 5 times in the last 3 minutes. #47617 #51455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
devnoaman opened this issue Feb 18, 2023 · 16 comments
Closed
Labels
legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request

Comments

@devnoaman
Copy link

i have used riverpod_lint with custom_lint and after activating custom lint , the server get crashed many times , i've tried to remove the packages and deactivate the custom linter then force update flutter sdk but nothing changes , here is the log of the analysis server :

[Error - 10:08:53 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:08:53 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:08:53 AM] Request textDocument/documentColor failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:08:53 AM] Request textDocument/inlayHint failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:05 AM] Request textDocument/hover failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:06 AM] Request textDocument/documentHighlight failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Info  - 10:09:07 AM] Connection to server got closed. Server will restart.
[Error - 10:09:07 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:07 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:07 AM] Request textDocument/documentColor failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:07 AM] Request textDocument/inlayHint failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:20 AM] Request textDocument/documentColor failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:20 AM] Request textDocument/documentSymbol failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:20 AM] Request textDocument/inlayHint failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Info  - 10:09:20 AM] Connection to server got closed. Server will restart.
[Error - 10:09:20 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:20 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:20 AM] Request textDocument/documentColor failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:20 AM] Request textDocument/inlayHint failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:22 AM] Request textDocument/inlayHint failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Info  - 10:09:22 AM] Connection to server got closed. Server will restart.
[Error - 10:09:23 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:23 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:23 AM] Request textDocument/documentColor failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:23 AM] Request textDocument/inlayHint failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:23 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:24 AM] Request textDocument/documentSymbol failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Info  - 10:09:24 AM] Connection to server got closed. Server will restart.
[Error - 10:09:24 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:24 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:24 AM] Request textDocument/documentColor failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:24 AM] Request textDocument/inlayHint failed.
  Message: File is not being analyzed
  Code: -32007 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:25 AM] Request textDocument/documentSymbol failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:26 AM] Request textDocument/documentSymbol failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:26 AM] Request textDocument/hover failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:26 AM] Request textDocument/documentColor failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:27 AM] Request textDocument/inlayHint failed.
  Message: Analysis failed for file
  Code: -32013 
/Users/noamanmonther/FreeLance/Noon/Fresh-Eco/fresh_admin_dashbord/lib/views/home/home.dart
[Error - 10:09:28 AM] The Dart Analysis Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
@devnoaman devnoaman changed the title #47617 The Dart Analysis Server server crashed 5 times in the last 3 minutes. The Dart Analysis Server server crashed 5 times in the last 3 minutes. #47617 Feb 18, 2023
@devnoaman
Copy link
Author

#47617

@mraleph mraleph added the legacy-area-analyzer Use area-devexp instead. label Feb 18, 2023
@bwilkerson
Copy link
Member

@DanTup I can't tell from the output above what the problem might be. Unless it's enough information for you, can you provide instructions about how to get more information? (If we don't already, we should really have this written up somewhere on dart.dev so that we can point to the instructions.)

@DanTup
Copy link
Collaborator

DanTup commented Feb 21, 2023

I suspect this comment from @srawlins is probably accurate/relevant here:

I suspect a stack trace would be shown in the Instrumentation log when the Analysis Server crashes. I could be wrong. See here: https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/doc/tutorial/instrumentation.md

Setting the dart.analyzerInstrumentationLogFile setting and capturing a log may reveal an exception/stack trace.

@devnoaman if not, are you able to reproduce this in a simple project that can be shared that I could debug with?

@bwilkerson bwilkerson added the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label Feb 23, 2023
@Neikan
Copy link

Neikan commented Feb 27, 2023

Good afternoon

A similar problem arose

Arises in all projects: existing and only created

We tried changing channels, downgrade version, installation FVM - nothing helps. ((

@DanTup
Copy link
Collaborator

DanTup commented Feb 27, 2023

@Neikan are you able to capture a log file (see my comment above)? Can you also confirm exactly what version(s) of the SDK you're using?

A recent issue at Dart-Code/Dart-Code#4407 has the same symptoms with a parsing failure when the patterns experiment is enabled. It might be unrelated, but it had the same symptom in VS Code.

@Neikan
Copy link

Neikan commented Feb 27, 2023

@DanTup
I have this problem reproduced in:

  • VS Code
  • Android Studio

I tried versions:

  • Dart 2.19.2 (DevTools 2.20.1, Flutter 3.7.5) (first occurrence)
  • Dart 2.19.2 (DevTools 2.20.1, Flutter 3.7.4)
  • Dart 2.19.2 (DevTools 2.20.1, Flutter 3.7.3)
  • Dart 2.18.4 (DevTools 2.15.0, Flutter 3.3.8)
  • Dart 3.0.0 (build 3.0.0-218.1.beta) (DevTools 2.21.1, Flutter 3.8.0-10.1.pre)

I tried to capture a log, but the problem did not become clearer
log.txt

A little later I want to try to create a new user on the computer and try to set up the entire environment from scratch

I don't have any other ideas.(

@DanTup
Copy link
Collaborator

DanTup commented Feb 27, 2023

@Neikan thanks, in your log I see this:

1677495952882:Ex:Bad state:: Suspected cycle. [(uri:: package::flutter_test/flutter_test.dart, path:: /Users/neikan/fvm/versions/3.7.4/packages/flutter_test/lib/flutter_test.dart), (uri:: package::flutter_test/src/test_text_input.dart, path:: /Users/neikan/fvm/versions/3.7.4/packages/flutter_test/lib/src/test_text_input.dart), (uri:: package::flutter/services.dart, path:: /Users/neikan/fvm/versions/3.7.4/packages/flutter/lib/services.dart), (uri:: package::flutter/src/services/asset_bundle.dart, path:: /Users/neikan/fvm/versions/3.7.4/packages/flutter/lib/src/services/asset_bundle.dart), (uri:: dart::typed_data, path:: /Users/neikan/fvm/versions/3.7.4/bin/cache/pkg/sky_engine/lib/typed_data/typed_data.dart), (uri:: dart::_internal, path:: /Users/neikan/fvm/versions/3.7.4/bin/cache/pkg/sky_engine/lib/internal/internal.dart), (uri:: dart::_internal/patch.dart, path:: /Users/neikan/fvm/versions/3.7.4/bin/cache/pkg/sky_engine/lib/internal/patch.dart), (uri:: dart::_internal/components/ui_settings_security.dart, path:: /Users/neikan/fvm/versions/3.7.4/bin/cache/pkg/sky_engine/lib/internal/components/ui_settings_security.dart), (uri:: dart::_internal/components/components/ui_settings_security.dart, path:: /Users/neikan/fvm/versions/3.7.4/bin/cache/pkg/sky_engine/lib/internal/components/components/ui_settings_security.dart), (uri:: dart::_internal/components/components/components/ui_settings_security.dart, path:: /Users/neikan/fvm/versions/3.7.4/bin/cache/pkg/sky_engine/lib/internal/components/components/components/ui_settings_security.dart), (uri:: dart::_internal/components/components/components/components/ui_settings_security.dart, path:: /Users/neikan/fvm/versions/3.7.4/bin/cache/pkg/sky_engine/lib/internal/components/components/components/components/ui_settings_security.dart)

The path keeps growing with the "components" section being repeated:

uri:: dart::_internal/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/components/ui_settings_security.dart

This issue has come up at #50613 and Dart-Code/Dart-Code#4037. Deleting the ~/.dartServer folder (which contains some cached information about analyzed files) seems to resolve the issue, but it's not clear what's causing it or how to reproduce to debug. (FYI @scheglov)

@Neikan
Copy link

Neikan commented Feb 27, 2023

@DanTup
"deleting the ~/.dartServer folder" - saved me.

Thanks a lot!

@keertip keertip added P3 A lower priority bug or feature request and removed needs-info We need additional information from the issue author (auto-closed after 14 days if no response) labels Mar 7, 2023
@DanTup
Copy link
Collaborator

DanTup commented Mar 8, 2023

@devnoaman are you still seeing this issue? Are you able to capture a log as noted above (#51455 (comment))?

@wiztensai
Copy link

after upgrade flutter version, the issue is solved.

@jmguazzo
Copy link

On Windows, I deleted both the ".dart" & ".dart-tool" folders in %appdata%\Roaming and it fixed the issue.

@times-github
Copy link

堆栈溢出 ,你把vscode的内存调大一点 就可以了

@mrtnetwork
Copy link

mrtnetwork commented Nov 13, 2023

After 2 hours, I tested everything that came to my mind and it didn't work. I checked another project and saw that there was no problem. After checking, I realized that the problem is in the following lines.

class NumberTextField extends StatefulWidget {
  const NumberTextField({
    super.key,
    required this.min,
  }) : assert(() {
    return false;
  }(), "...");
  final int min;
}

after removing this line problem solved

: assert(() {
    return false;
  }(), "...");

LSP

[Error - 11:35:18 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
[Error - 11:35:18 AM] Request textDocument/documentSymbol failed.
  Message: File is not being analyzed
  Code: -32007 
[Error - 11:35:18 AM] Request textDocument/documentColor failed.
  Message: File is not being analyzed
  Code: -32007 
[Error - 11:35:18 AM] Request textDocument/documentColor failed.
  Message: File is not being analyzed
  Code: -32007 
[Error - 11:35:18 AM] Request textDocument/inlayHint failed.
  Message: File is not being analyzed
  Code: -32007 

@DanTup
Copy link
Collaborator

DanTup commented Nov 14, 2023

@mrtnetwork thanks for the sample - I can reproduce that on the current stable and it's the same issue as described in #53075 which has been fixed in ba1988e for a future SDK release.

(FWIW the code is invalid - you can't call functions inside asserts of const constructors)

@MaharramovZiya
Copy link

### Connection to server got closed. Server will not be restarted. (Source: Dart)

While using VSCode with the Dart SDK, I encountered the error message "Connection to server got closed. Server will not be restarted. Source: Dart." This issue indicates that the Dart analysis server has unexpectedly stopped and will not restart.

Steps to Reproduce:

Open Visual Studio Code.
Load my Dart and Flutter project.
While working on the project or running certain commands, the above error message appears.

Actual Results:

After this issue occurs, the Dart analysis server stops running and does not restart. This results in the loss of code analysis and error highlighting features.

@DanTup
Copy link
Collaborator

DanTup commented Aug 6, 2024

@MaharramovZiya please open a new issue, comments on old closed issues are easily missed.

If you can enable the analyzer instrumentation log (see https://dartcode.org/docs/logging/#analyzer-instrumentation), it may record an exception that will help understand why the server is terminating - please include that exception in your new issue (note: the log will contain parts of your source code, so just look for the exception). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests