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.

[BUG] Local Debugging Fails With "KeyError: '__main__'"

See original GitHub issue

Investigative 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:
  1. Download repo
  2. Initialize .venv with python 3.9.6
  3. Initialize debugging session in vscode with F5
  4. 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

https://github.com/tyler555g/AzureDurableFunctionsExample

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
niekvleeuwencommented, Dec 24, 2021

Updating to Azure Functions Core Tools 4.0 fixed the exact same issue for me.

0reactions
YunchuWangcommented, Feb 5, 2022

Tried with core-tool 4.0 and issue no longer occurs.

Read more comments on GitHub >

github_iconTop 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 >

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