[BUG] Local Debugging Fails With "KeyError: '__main__'"
See original GitHub issueInvestigative information
Please provide the following:
- Timestamp: 2021-08-30T14:04:57.007Z
- Function App name: n/a local debug
- Function name(s) (as appropriate): n/a local debug
- Core Tools version: 3.0.5368
- Function Runtime Version: 3.0.15828.0
Repro steps
Provide the steps required to reproduce the problem:
- Download repo
- Initialize .venv with python 3.9.6
- Initialize debugging session in vscode with F5
- Get error
[2021-08-30T14:16:09.495Z] Worker failed to function id 5cfd6c05-6b2d-46e8-b09f-6c5c8a0ac887. [2021-08-30T14:16:09.496Z] Result: Failure Exception: KeyError: ‘main’ Stack: File “C:\Users\tyler\AppData\Roaming\nvm\v16.8.0\node_modules\azure-functions-core-tools\bin\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py”, line 301, in _handle__function_load_request
Expected behavior
Provide a description of the expected behavior.
Expect debugging to continue successfully.
Actual behavior
Provide a description of the actual behavior observed.
Does not work.
Known workarounds
Provide a description of any known workarounds.
Works on my other machine. Have not tried a fresh install yet.
Contents of the requirements.txt file:
Provide the requirements.txt file to help us find out module related issues.
azure-functions
azure-functions-durable
usaddress-scourgify
Related information
Provide any related information
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How do I fix my KeyError while accessing an object's value?
I found a good api for this, but when getting data from the api, it returns a KeyError. Please help debug this. My...
Read more >How to fix Python KeyError Exceptions in simple steps?
First, we access an existing key in the try-except block. If the Keyerror is not raised, there are no errors. Then the else...
Read more >Troubleshooting and tips — Numba 0.50.1 documentation
There can be various reasons why Numba cannot compile your code, and raises an error instead. One common reason is that your code...
Read more >KeyError Pandas – How To Fix - Data Independent
Pandas KeyError - This annoying error means that Pandas can not find your column ... It's best to head back upstream with your...
Read more >When Things Go Wrong — PyInstaller 5.7.0 documentation
When the Analysis step runs, it produces error and warning messages. ... PyInstaller needs to bundle the Python library, which is the main...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Updating to Azure Functions Core Tools 4.0 fixed the exact same issue for me.
Tried with core-tool 4.0 and issue no longer occurs.