Skip to content

[flutter_tools] "OS Error: The handle is invalid" while trying to set echo mode on STDIN #129198

Closed

Description

@christopherfujino

On beta/3.12.0 on Windows

StdinException: Error setting terminal echo mode, OS Error: The handle is invalid., errno = 6
at Stdin.echoMode=(stdio_patch.dart:85)
at AnsiTerminal.singleCharMode=(terminal.dart:309)
at TerminalHandler.setupTerminal(resident_runner.dart:1678)
at RunCommand.runCommand.<anonymous closure>(run.dart:748)
at _rootRunUnary(zone.dart:1407)
at _CustomZone.runUnary(zone.dart:1308)
at <asynchronous gap>(async)

Even though we check if stdinHasTerminal right before this

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    c: crashStack traces logged to the console
    P2Important issues not at the top of the work list
    on Jun 20, 2023
  2. christopherfujino commented on Jun 20, 2023

    @christopherfujino
    ContributorAuthor
  3. andrewkolos commented on Jun 23, 2023

    @andrewkolos
    Contributor

    It appears The handle is invalid., errno = 6 is all the information we are getting from Windows here. From a cursory Google search, it appears one way this can happen is if a process tries to interact with a handle when it is invalid (e.g. already closed).

    This issue has appeared before. See this issue query: https://github.com/flutter/flutter/issues?q=%22OS+Error%3A+The+handle+is+invalid%22

    Due to the lack of repro of repro steps and relatively low number of users affected at this time, I won't be prioritizing this issue.

  4. christopherfujino commented on Jun 23, 2023

    @christopherfujino
    ContributorAuthor

    From a cursory Google search, it appears one way this can happen is if a process tries to interact with a handle when it is invalid (e.g. already closed).

    Not sure if the reports we're getting from real users if STDIN could possibly be closed, since their terminal session was still active (and they saw the github issue link coming from STDOUT from the tool). That being said, I have no idea what's going on :)

  5. github-actions commented on Oct 25, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoleplatform-windowsBuilding on or for Windows specificallyteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.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