question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging Azure Python functions using VS Code IDE "connect ECONNREFUSED 127.0.0.1:9091"

See original GitHub issue
  • VS Code Version: image

  • Azurite Version 3.19.0

  • Core Tools Version: 4.0.4736

  • Function Runtime Version: 4.8.1.18957

Steps to Reproduce:

  1. Start Azurite local storage emulator (for testing durable functions). F1 > Azurite: Start. Azurite service starts successfully.

  2. Hit F5 to debug. Requirements checked/installed, functions are listed, then error box appears. image

  3. Workarounds: Can usually hit Cancel and F5 again, and then debugging starts successfully -OR- can just hit Cancel and run functions successfully without debugging

A colleague and I have both experienced this issue on 2 different machines. Even though we have a workaround we’ve been attempting for months to eliminate original error, with no success. Issue has persisted through multiple VS Code versions (version noted above is currently installed).

Troubleshooting steps taken:

  • Uninstall / Reinstall VS Code
  • Uninstall / Reinstall Azure Core Tools v3 and v4
  • Downgraded and upgraded Azure Core Tools v3 <-> v4 - Adjusted Function Runtime Version to target Function Version 3 and 4 accordingly.
  • Deleted Azure Functions extension from %USER%.vscode\extension
  • Reinstalled Azure Functions extension
  • Explicitly install Azure Functions extension bindings/bundles
  • My colleague posted to on StackOverflow (Unable to debug Python Azure function in VS Code IDE. Getting connect ECONNREFUSED 127.0.0.1:9091 error - Stack Overflow) We both tried the suggestions.
  • Disable all extensions. This causes a different error. image
  • Disable only Azurite extension and switch from local storage to storage account connection. Same (original error). Workarounds still work.

Note: We are on a corp VPN. However, the issue happens regardless of whether we are connected to the VPN

Possibly Related: Sometimes, after closing VS Code completely and reopening, when I try debugging, I get VS Code error: could not find the task ‘func: host start’ (image above).

However, if I open a new terminal and run ‘func host start’, it runs successfully without any issue.

Can usually eliminate it by uninstalling Azure Functions extension and reinstalling via extensions blade. Not exactly sure why this works, but have had to do it numerous times.

This happens every so often, but can’t reproduce it reliably or identify a specific pattern.

image

image

image

image

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eli-1716commented, Oct 5, 2022

Sounds good - thank you @nturinski. The possibility of a race condition is something that came up during our debugging attempts and discussions with MS support staff.

0reactions
eli-1716commented, Nov 14, 2022

I’ve re-installed core tools numerous times, as well as VS Code itself and many of the extensions. None of that fixes the issue for me on Windows 10.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Azure Python functions using VS Code IDE ...
My colleague posted to on StackOverflow (Unable to debug Python Azure function in VS Code IDE. Getting connect ECONNREFUSED 127.0.0.1:9091 error ...
Read more >
Unable to debug Python Azure function in VS Code IDE ...
VS Code > Your Python Azure Functions Project > View Menu > Open the Command Palette or Ctrl + Shift + P.
Read more >
Error in Azure function - Microsoft Q&A
Hi Team. Im Trying create a Azure function with http trigger using anonymous authentication from Microsoft visual studio code ,
Read more >
ECONNREFUSED 127.0.0.1:9222 - Visual Studio Feedback
I'm trying to debug javascript running in Chrome from the latest VS2019. It used to work, but not any more. I've started Chrome...
Read more >
error: connect econnrefused 127.0.0.1:7071 - You.com
Cannot launch debugger for azure function app in VScode- ECONNREFUSED 127.0.0.1:9091 ... as PowerShell runtime host is functional with Python functions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found