Skip to content

When connecting to device, StateError: Bad sate: Stream has already been listened to #156692

@andrewkolos

Description

@andrewkolos

Since 3.24.0

On 3.24.3, affects 1% of all clients that have reported a crash (current overall crash rate is ~1%)

Occurs exclusively on flutter attach

StateError: Bad state: Stream has already been listened to.
at _StreamController._subscribe(stream_controller.dart:686)
at _ControllerStream._createSubscription(stream_controller.dart:837)
at _StreamImpl.listen(stream_impl.dart:497)
at new _ForwardingStreamSubscription(stream_pipe.dart:114)
at _ForwardingStream._createSubscription(stream_pipe.dart:86)
at _ForwardingStream.listen(stream_pipe.dart:81)
at FlutterDevice.connect(resident_runner.dart:267)
at ResidentRunner.connectToServiceProtocol(resident_runner.dart:1404)
at HotRunner.attach(run_hot.dart:236)
at AttachCommand._attachToDevice(attach.dart:403)
at <asynchronous gap>(async)
at AttachCommand.runCommand(attach.dart:265)
at <asynchronous gap>(async)
at FlutterCommand.run.<anonymous closure>(flutter_command.dart:1408)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:153)
at <asynchronous gap>(async)
at CommandRunner.runCommand(command_runner.dart:212)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand.<anonymous closure>(flutter_command_runner.dart:420)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:153)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand(flutter_command_runner.dart:364)
at <asynchronous gap>(async)
at run.<anonymous closure>.<anonymous closure>(runner.dart:130)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:153)
at <asynchronous gap>(async)
at main(executable.dart:93)
at <asynchronous gap>(async)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoleteam-toolOwned by Flutter Tool teamtool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions