azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

Value cannot be null. (Parameter 'provider') -> Impossible debug function locally

Open omonimus1 opened this issue 3 years ago • 15 comments

Description

Is impossible to debug an HTTP azure function locally. The application response error is: Value cannot be null. (Parameter 'provider')

Runtime and development environment

  • Python 3.9
  • Mac OS
  • Core Tools Version: 4.0.4785 Commit hash: N/A (64-bit)
  • Function Runtime Version: 4.10.4.19213

How to reproduce:

  1. Create an HTTP azure function with stack python 3.9
  2. Run function locally with func host start or F5
  3. See the error
Found Python version 3.7.9 (python3).

Azure Functions Core Tools
Core Tools Version:       4.0.4785 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.10.4.19213

Value cannot be null. (Parameter 'provider')

omonimus1 avatar Sep 28 '22 10:09 omonimus1

Azure core package installed as indicated in the Azure documentation image

omonimus1 avatar Sep 28 '22 10:09 omonimus1

I was having the same error while trying to do the Python QuickStart (https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-python). Same python, core tools, and function runtime versions as you, but unfortunately I am running on Windows 10 and not MAC, so the following file paths will probably be different for you.

With the .venv activated, I ran "func start --verbose" and noticed it was getting stuck downloading the extension bundles -- [2022-09-30T01:58:30.375Z] Downloading extension bundle from https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/3.15.0/Microsoft.Azure.Functions.ExtensionBundle.3.15.0_any-any.zip to C:\Users<USER>\AppData\Local\Temp\410555e8-c1d3-493b-96cf-343fb1fe4952\Microsoft.Azure.Functions.ExtensionBundle.3.15.0.zip

The Value cannot be null. (Parameter 'provider') error would present itself after 5-10 minutes.

This happened while I was staying at a hotel and had very slow internet. When I returned home and was back on "normal" internet, the Extension Bundle would download in a few seconds and there were no issues.

If switching to a faster internet is not an option for you, I suggest trying the following --

  1. Manually download the extension bundles from https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/3.15.0/Microsoft.Azure.Functions.ExtensionBundle.3.15.0_any-any.zip

  2. Then unzip this file to the following location (you will have to create the folders): C:\Users<USER>.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\3.15.0

(Again, not sure what the corresponding file paths would be for MAC. Maybe someone else knows...)

  1. Then try running your function.

EDIT: I looked at another issue with same problem: https://github.com/Azure/azure-functions-core-tools/issues/2350

It looks like for MAC users, the path you want to unzip the file to is .azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/3.15.0

zsponaugle avatar Oct 04 '22 01:10 zsponaugle

It is a long-standing issue. I have to do this quite often.

The running theory is that it happens when there is a new version available and we either:

  • start multiple services at once and they all try to download and install same extension bundle.

  • service seems to start for a long time(verbose disabled) (downloading and installing bundle in the background) and we unawarely kill the process in attempt of restart, interrupting the process, leaving some broken artifacts and preventing further automatic update.

First case - if that is the case - could be solved by applying changes to code responsible for update... lock file with timestamp? Second case could - again, if theory is correct - also be solved by smarter code, but also by issuing some log message about running extension bundle update into non-verbose mode as well to limit the frustration when slow starting the stuff.

PS. There are also other things that could slow down the start terribly, like waiting for failing leases - those could also print something into non-verbose mode, during retries or something.

poly-mole avatar Nov 18 '22 09:11 poly-mole

Modify the host.json file with "version": "[3.*, 3.9.0)"

solomem avatar Jun 07 '23 03:06 solomem

What is throwing this error? I'm getting it after upgrading .NET 6 -> 8.

I have found numerous threads and issues on this problem, and it seems completely unprioritized. I can't run my functionapp - this is a critical bug while it fails to tell me what's missing or configured incorrectly.

jepperaskdk avatar Jan 07 '24 09:01 jepperaskdk

@jepperaskdk, same issue. have you found any solution?

mariiaBarabukha avatar Jan 16 '24 15:01 mariiaBarabukha

I'm also having this problem but with Core Tools v4.0.5530, Function Runtime v4.28.5.21962 and running a dotnet-isolated (C#) function. My colleagues with the same versions are not having this problem, and it seemed to suddenly begin occurring.

[2024-02-29T16:35:28.356Z] A host error has occurred during startup operation 'ff2f07d9-d418-4237-a164-1a598fdf73d5'.
[2024-02-29T16:35:28.356Z] Microsoft.Azure.WebJobs.Script: Did not find functions with language [dotnet-isolated].
[2024-02-29T16:35:28.371Z] Failed to stop host instance '91c6d635-4685-4c5f-aab3-8c1eca2232eb'.
[2024-02-29T16:35:28.371Z] Microsoft.Azure.WebJobs.Host: The host has not yet started.
Value cannot be null. (Parameter 'provider')

@omonimous did you get anywhere with this?

polly-utopi avatar Feb 29 '24 16:02 polly-utopi

Modify the host.json file with "version": "[3.*, 3.9.0)"

working for me. { "version": "2.0", "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[3.*, 3.9.0)" } }

anshika-invatu avatar Mar 28 '24 11:03 anshika-invatu