Skip to content

Dev tools unable to connect to VM service via HTTPS #1469

Closed

Description

@bh0mbalziyad

When dev-tools are launched from within VSCode they try connecting to the Flutter app via an HTTPS connection but fails to do so. Only when I manually change the URL to one with HTTP does it work.
image

Activity

  1. changed the title [-]When [/-] [+]Dev tools unable to connect to VM service via HTTPS[/+] on Dec 9, 2019
  2. jacob314 commented on Dec 11, 2019

    @jacob314
    Contributor

    @DanTup Why is VSCode requesting an http url?

  3. DanTup commented on Dec 11, 2019

    @DanTup
    Contributor

    That's a very good question I don't have a very good answer for. I'm not sure what's happening here.

    @bh0mbalziyad can you run the Dart: Capture Logs command in VS Code (untick Analyzer but leave everything else ticked) then reproduce the issue, click Cancel on the logging dialog, and paste the log into a Gist (or similar) and the link here.

    Can you also confirm your OS (Linux?) and whether there's anything that might be uncommon about your setup (for ex. are you running in a container, using VS Code Remoting, etc.)?

    Thanks!

  4. bh0mbalziyad commented on Dec 11, 2019

    @bh0mbalziyad
    Author

    Hey! @DanTup Here's the gist.
    Also my OS is Linux Mint 19. I'm running a vanilla distribution with little to no modifications. I don't know what VS Code Remoting is so I can't be using it I guess haha.

  5. DanTup commented on Dec 11, 2019

    @DanTup
    Contributor

    Thanks for the log! I've found the issue - we have a workaround for a VS Code issue in the Dart extension, but it does the wrong thing when the VM service URI is http and not ws.

    It only occurs when you're running locally (not remote) and DevTools is unable to locate Chrome (so we have to launch the default browser from VS Code).

    I've opened Dart-Code/Dart-Code#2166 and will push a fix today.

  6. added a commit that references this issue on Dec 11, 2019
  7. DanTup commented on Dec 11, 2019

    @DanTup
    Contributor

    This has been fixed and released in the Dart extension v3.7.1. Let me know if you're still seeing issues after installing the update and reloading VS Code.

  8. bh0mbalziyad commented on Dec 11, 2019

    @bh0mbalziyad
    Author

    DevTools work as expected now. That was some really swift work, I appreciate your quick responses. Thank you! @DanTup

  9. DanTup commented on Dec 11, 2019

    @DanTup
    Contributor

    Glad to hear - sorry for the inconvenience, and thanks for alerting us! :-)

  10. houssain1 commented on Jun 26, 2020

    @houssain1

    Glad to hear - sorry for the inconvenience, and thanks for alerting us! :-)

    image

  11. hoekbrwr commented on Oct 5, 2020

    @hoekbrwr

    Now it happens again. Started DevTools from VSCode. There is no auth code entered. It says http://127.0.0.1:12345/auth_code=

  12. DanTup commented on Oct 5, 2020

    @DanTup
    Contributor

    @hoekbrwr I don't think this is the same issue as above, but there's an issue open where DevTools will spawn in Chrome incorrectly when VS Code starts it (#2405). This will result in two DevTools - one that is connected to your app (which by default will be embedded in VS Code) and another that is just loaded at the Connect screen.

    If that's what you're seeing, there's an open PR to fix it. If you're seeing something different, please file an issue at https://github.com/Dart-Code/Dart-Code and include detailed steps of how to reproduce the issue (I tried, but it works as described above for me - the embedded DevTools in VS Code does connect correctly). Thanks!

  13. hoekbrwr commented on Oct 5, 2020

    @hoekbrwr
  14. DanTup commented on Oct 5, 2020

    @DanTup
    Contributor

    @hoekbrwr if you're able to reproduce this and/or figure out what you clicked to launch DevTools in a way that doesn't work, I'd definitely like to fix the issue. I tried the status bar and the debug toolbar but both seemed to work. I did get an unexpected Chrome window open on the DevTools connect screen, though that's the other issue I described above.

    If you can reproduce this, please do file an issue at https://github.com/Dart-Code/Dart-Code with instructions and/or a screenshot so I can take a look. Thanks!

  15. hoekbrwr commented on Oct 5, 2020

    @hoekbrwr
  16. DanTup commented on Oct 5, 2020

    @DanTup
    Contributor

    When first started VSCode and directly after starting a debug session with F5 the Dev Tool can be started only with the top icon on an extra page in the editor. As a side effect you get a browser tab ,in Chrome in my case, with the following:

    That's the issue noted above (#2405). There's a fix in progress - it should not spawn the extra Chrome window.

    As another side effect I see the bottom command in the status window only after applying the command in the top command bar in VSCode.

    This is currently expected behaviour. DevTools only shows on the status bar once it is running. Using the button on the debug toolbar (or the commands from the command palette) are the normal ways to start (+ launch) DevTools initially. The status bar provides an additional way to quickly launch a section (or open it in an external browser) once it's already running.

    If I close the Tab I cannot reopen it anymore by clicking the status command, but who will do that!? It just does not appear anymore although it tries to open it because I see a window right above the status bar.

    If you can't reopen it after closing it, that definitely sounds like a bug - would you mind filing an issue at https://github.com/Dart-Code/Dart-Code about this and I'll take a look? Thanks!

  17. hoekbrwr commented on Oct 5, 2020

    @hoekbrwr
  18. DanTup commented on Oct 5, 2020

    @DanTup
    Contributor

    @hoekbrwr no worries, I was able to reproduce the issue you described. I've opened Dart-Code/Dart-Code#2852. Thanks!

  19. hoekbrwr commented on Oct 5, 2020

    @hoekbrwr
  20. islamaliev commented on Jan 30, 2021

    @islamaliev

    I've just updated to the newest version of Dart Code 3.19.0 and can't connect to VM anymore.
    Here is the message that I get https://i.imgur.com/6RDSaNh.png
    Am I doing something wrong?

  21. windman007 commented on Jan 31, 2021

    @windman007

    have the same issue on Dart SDK 2.10.5 (macOS)

  22. windman007 commented on Jan 31, 2021

    @windman007

    I've just updated to the newest version of Dart Code 3.19.0 and can't connect to VM anymore.
    Here is the message that I get https://i.imgur.com/6RDSaNh.png
    Am I doing something wrong?

    here is newest post about this issue

  23. agent515 commented on Jan 31, 2021

    @agent515

    Yes, the same issue. Can't seem to connect to VM by using ws or http.
    Also, I think chrome or edge tab did not open by itself, when I clicked Open DevTools.

    (Edit: When I tried just now, chrome tab did open but can not connect still)

    OS: WIndows 10

  24. anaberani commented on Jan 31, 2021

    @anaberani

    I've just updated to the newest version of Dart Code 3.19.0 and can't connect to VM anymore.
    Here is the message that I get https://i.imgur.com/6RDSaNh.png
    Am I doing something wrong?

    here is newest post about this issue

    I've got the same stack on Windows 10

  25. novaisc commented on Jan 31, 2021

    @novaisc

    I've just updated to the newest version of Dart Code 3.19.0 and can't connect to VM anymore.
    Here is the message that I get https://i.imgur.com/6RDSaNh.png
    Am I doing something wrong?

    Same problem here

  26. sarahMaria7 commented on Jan 31, 2021

    @sarahMaria7

    I've just updated to the newest version of Dart Code 3.19.0 and can't connect to VM anymore.
    Here is the message that I get https://i.imgur.com/6RDSaNh.png
    Am I doing something wrong?

    same problem here

  27. jeremystephan commented on Feb 1, 2022

    @jeremystephan

    I also just updated. Big mistake. I created a blank plain Flutter Application in VSCode.
    Flutter/Dart Extension v3.34.0
    Flutter is already up to date on channel master
    Flutter 2.10.0-1.0.pre.355 • channel master • https://github.com/flutter/flutter.git
    Framework • revision e5cf7d1833 (4 hours ago) • 2022-02-01 06:55:22 -0500
    Engine • revision 9cd90e399e
    Tools • Dart 2.17.0 (build 2.17.0-69.0.dev) • DevTools 2.10.0-dev.1
    Package devtools is currently active at version 2.9.3.

    I also get the same message: https://i.imgur.com/6RDSaNh.png

  28. DanTup commented on Feb 1, 2022

    @DanTup
    Contributor

    @jeremystephan this issue was about VS Code incorrectly trying to connect using HTTPS. I don't think it's the same issue you're seeing. Please file a new issue, and include:

    • your VS Code version
    • your Dart extension version
    • your Flutter SDK version
    • the output of running pub global list

    Thanks!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions