Skip to content
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

"The method 'refresh' was called on null" in analysis server (current nightly) #36212

Closed
DanTup opened this Issue Mar 14, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@DanTup
Copy link
Member

DanTup commented Mar 14, 2019

While testing SuggestionSets work, I sometimes see this crash immediately upon starting the analysis server. I'm using the current nightly build from https://gsdview.appspot.com/dart-archive/channels/be/raw/latest/sdk/.

As far as I can tell, it's before any requests have been sent at all.

[16:00:07 GMT+0000 (GMT)] Log file started
[16:00:07 GMT+0000 (GMT)] [General] [Info] Searching for SDKs...
[16:00:07 GMT+0000 (GMT)] [General] [Info]     Found at /Users/dantup/Dev/dart-sdk/nightly-2019-03-14
[16:00:07 GMT+0000 (GMT)] [General] [Info]     Returning SDK path /Users/dantup/Dev/dart-sdk/nightly-2019-03-14 for dart
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] Captured exception
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] NoSuchMethodError: The method 'refresh' was called on null.
Receiver: null
Tried calling: refresh(Instance of 'DeclarationsContext')
#0      Object.noSuchMethod (dart:core/runtime/lib/object_patch.dart:50:5)
#1      DeclarationsTracker._performChangeFile (package:analyzer/src/services/available_declarations.dart:632:15)
#2      DeclarationsTracker.doWork (package:analyzer/src/services/available_declarations.dart:494:7)
#3      CompletionLibrariesWorker.performWork (package:analysis_server/src/domains/completion/available_suggestions.dart:200:13)
<asynchronous suspension>
#4      AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2125:35)
<asynchronous suspension>
#5      AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:2075:5)
#6      new AnalysisServer (package:analysis_server/src/analysis_server.dart:210:29)
#7      SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:86:26)
#8      StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37:18)
#9      Driver.startAnalysisServer.<anonymous closure> (package:analysis_server/src/server/driver.dart:511:21)
#10     _rootRun (dart:async/zone.dart:1124:13)
#11     _CustomZone.run (dart:async/zone.dart:1021:19)
#12     _runZoned (dart:async/zone.dart:1516:10)
#13     runZoned (dart:async/zone.dart:1463:12)
#14     Driver._captureExceptions (package:analysis_server/src/server/driver.dart:594:12)
#15     Driver.startAnalysisServer (package:analysis_server/src/server/driver.dart:509:7)
#16     Driver.start (package:analysis_server/src/server/driver.dart:412:7)
#17     main (file:///b/s/w/ir/cache/builder/sdk/pkg/analysis_server/bin/server.dart:12:11)
#18     _AsyncAwaitCompleter.start (dart:async/runtime/lib/async_patch.dart:49:6)
#19     main (file:///b/s/w/ir/cache/builder/sdk/pkg/analysis_server/bin/server.dart:10:10)
#20     _startIsolate.<anonymous closure> (dart:isolate/runtime/lib/isolate_patch.dart:298:32)
#21     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:171:12)
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] Captured exception
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] NoSuchMethodError: The method 'refresh' was called on null.
Receiver: null
Tried calling: refresh(Instance of 'DeclarationsContext')
#0      Object.noSuchMethod (dart:core/runtime/lib/object_patch.dart:50:5)
#1      DeclarationsTracker._performChangeFile (package:analyzer/src/services/available_declarations.dart:632:15)
#2      DeclarationsTracker.doWork (package:analyzer/src/services/available_declarations.dart:494:7)
#3      CompletionLibrariesWorker.performWork (package:analysis_server/src/domains/completion/available_suggestions.dart:200:13)
<asynchronous suspension>
#4      AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2125:35)
<asynchronous suspension>
#5      AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:2075:5)
#6      new AnalysisServer (package:analysis_server/src/analysis_server.dart:210:29)
#7      SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:86:26)
#8      StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37:18)
#9      Driver.startAnalysisServer.<anonymous closure> (package:analysis_server/src/server/driver.dart:511:21)
#10     _rootRun (dart:async/zone.dart:1124:13)
#11     _CustomZone.run (dart:async/zone.dart:1021:19)
#12     _runZoned (dart:async/zone.dart:1516:10)
#13     runZoned (dart:async/zone.dart:1463:12)
#14     Driver._captureExceptions (package:analysis_server/src/server/driver.dart:594:12)
#15     Driver.startAnalysisServer (package:analysis_server/src/server/driver.dart:509:7)
#16     Driver.start (package:analysis_server/src/server/driver.dart:412:7)
#17     main (file:///b/s/w/ir/cache/builder/sdk/pkg/analysis_server/bin/server.dart:12:11)
#18     _AsyncAwaitCompleter.start (dart:async/runtime/lib/async_patch.dart:49:6)
#19     main (file:///b/s/w/ir/cache/builder/sdk/pkg/analysis_server/bin/server.dart:10:10)
#20     _startIsolate.<anonymous closure> (dart:isolate/runtime/lib/isolate_patch.dart:298:32)
#21     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:171:12)
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] Captured exception
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] NoSuchMethodError: The method 'refresh' was called on null.
Receiver: null
Tried calling: refresh(Instance of 'DeclarationsContext')
#0      Driver._captureExceptions.errorFunction (package:analysis_server/src/server/driver.dart:582:7)
#1      _CustomZone.handleUncaughtError (dart:async/zone.dart:1003:19)
#2      Future._propagateToListeners (dart:async/future_impl.dart:555:16)
#3      Future._completeError (dart:async/future_impl.dart:491:5)
#4      _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#5      _Completer.completeError (dart:async/future_impl.dart:27:5)
#6      _AsyncAwaitCompleter.completeError.<anonymous closure> (dart:async/runtime/lib/async_patch.dart:43:20)
#7      _rootRun (dart:async/zone.dart:1120:38)
#8      _CustomZone.run (dart:async/zone.dart:1021:19)
#9      _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#10     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#11     _rootRun (dart:async/zone.dart:1124:13)
#12     _CustomZone.run (dart:async/zone.dart:1021:19)
#13     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#14     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#15     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#16     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#17     _Timer._runTimers (dart:isolate/runtime/lib/timer_impl.dart:391:30)
#18     _Timer._handleMessage (dart:isolate/runtime/lib/timer_impl.dart:416:5)
#19     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:171:12)
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] Captured exception
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] NoSuchMethodError: The method 'refresh' was called on null.
Receiver: null
Tried calling: refresh(Instance of 'DeclarationsContext')
#0      Driver._captureExceptions.errorFunction (package:analysis_server/src/server/driver.dart:582:7)
#1      _CustomZone.handleUncaughtError (dart:async/zone.dart:1003:19)
#2      _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#3      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#4      _rootRun (dart:async/zone.dart:1124:13)
#5      _CustomZone.run (dart:async/zone.dart:1021:19)
#6      _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#7      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#8      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#9      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#10     _Timer._runTimers (dart:isolate/runtime/lib/timer_impl.dart:391:30)
#11     _Timer._handleMessage (dart:isolate/runtime/lib/timer_impl.dart:416:5)
#12     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:171:12)
[16:00:08 GMT+0000 (GMT)] [General] [Error] [Analyzer] Unhandled exception:
NoSuchMethodError: The method 'refresh' was called on null.
Receiver: null
Tried calling: refresh(Instance of 'DeclarationsContext')
#0      Driver._captureExceptions.errorFunction (package:analysis_server/src/server/driver.dart:582:7)
#1      _CustomZone.handleUncaughtError (dart:async/zone.dart:1003:19)
#2      _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#3      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#4      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#5      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#6      _Timer._runTimers (dart:isolate/runtime/lib/timer_impl.dart:391:30)
#7      _Timer._handleMessage (dart:isolate/runtime/lib/timer_impl.dart:416:5)
#8      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:171:12)
[16:00:09 GMT+0000 (GMT)] [General] [Error] Cannot call write after a stream was destroyed

@bwilkerson @scheglov

@DanTup

This comment has been minimized.

Copy link
Member Author

DanTup commented Mar 14, 2019

I moved my .dartServer folder away and now I'm not seeing it (I don't know if those are related). The folder is about 1.3GB but if there may be anything useful in it, let me know.

@scheglov scheglov self-assigned this Mar 15, 2019

@scheglov

This comment has been minimized.

Copy link
Contributor

scheglov commented Mar 15, 2019

https://dart-review.googlesource.com/c/sdk/+/97007

I don't need .dartServer for this.
Sometimes we store exceptions there, but in this case, we don't.

dart-bot pushed a commit that referenced this issue Mar 16, 2019

Issue 36212. Fix for updated part without library.
R=brianwilkerson@google.com

Bug: #36212
Change-Id: Ib0c43685c0b9f167591232d384a7fc5e426c07d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97007
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

@scheglov scheglov closed this Mar 16, 2019

@DanTup

This comment has been minimized.

Copy link
Member Author

DanTup commented Mar 18, 2019

Thanks!

I thought it might've been related to some cached state in .dartServer since I couldn't repro after moving it. However, I also can't repro after putting it back (before pulling your fix), so maybe not!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.