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

VS code: restarting during debugging often causes error ConnectionRefused #2432

Open
danielwinkler opened this issue May 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@danielwinkler
Copy link

Bug Description

During debugging code, if we restart the debugger, often i get the following error:

The program '[3763] WebAPI.dll' has exited with code 0 (0x0).
 
------------------------------------------------------------------------------You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) withVisual Studio Code, Visual Studio or Visual Studio for Mac software to help youdevelop and test your applications.------------------------------------------------------------------------------
 
Using launch settings from './launchSettings.json' [Profile 'app']...
 
thread '<unnamed>' panicked at mirrord/layer/src/lib.rs:366:10:
 
failed to initialize proxy connection: IoFailed(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })
 
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 
mirrord layer setup panicked
 
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
 
The program '[4653] WebAPI.dll' has exited with code 255 (0xff).

This can be mitigated by stopping the application and waiting, and then starting the debug process.

Steps to Reproduce

  1. Debug a .NET application
  2. Do not stop the debugger, but restart it
  3. The exits with the above error

Backtrace

No response

Relevant Logs

No response

Your operating system and version

Linux devcontainer on a Windows host

Local process

.net web app

Local process version

No response

Additional Info

No response

@danielwinkler danielwinkler added the bug Something isn't working label May 7, 2024
@aviramha
Copy link
Member

aviramha commented May 7, 2024

Hi!
Apologize for the inconvenience. I am pretty sure you're experiencing this known issue metalbear-co/mirrord-vscode#43.
You could try setting

{"internal_proxy": {"idle_timeout": 60}}

to have the internal proxy stay alive, which might be a way to workaround it.

@danielwinkler
Copy link
Author

Dear @aviramha ,

Thank you for the very fast response, we're evaluating the settings and keeping you updated.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Net.Http.dll
 
Exception thrown: 'System.Net.Http.HttpIOException' in System.Private.CoreLib.dll
 
Proxy error, connectivity issue or a bug.
 
You may report it to us on https://github.com/metalbear-co/mirrord/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml
 
connection closed

This is one of the issues we ran into right after chaning the settings as suggested; but it doesn't occur every time.

Are these

the correct log settings?

    "internal_proxy": {
      "log_destination": "/tmp/internal_proxy.log",
      "log_level": "mirrord=trace"
    }

@aviramha
Copy link
Member

aviramha commented May 13, 2024

yes, if you could attach /tmp/internal_proxy.log after making sure it doesn't include any sensitive information that can be helpful.
When those issues occur? When restarting debugging? I'd advise to not use that VS Code feature with mirrord as our integration with VSCode makes it buggy
If you'd like we can schedule a debug session using this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants