azure-functions-host: If downloading the extension bundle takes too long, the runtime doesn't start properly
If you’re on a slow Internet connection such that the extension bundle can’t download within about 2 minutes, then the runtime fails.
Manually downloading the extension bundle (nearly 5 minutes on my connection) and expanding it where the ExtensionBundleManager looks for it works around the issue.
Console logs:
[hostname]:[project] [username]$ func start
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Azure Functions Core Tools (2.7.1585 Commit hash: 9a2b7239b937148e3b76e6f7999798629a82134a)
Function Runtime Version: 2.0.12641.0
[9/19/19 8:14:17 PM] Building host: startup suppressed:False, configuration suppressed: False
[9/19/19 8:14:17 PM] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /var/folders/pl/qgvhtxwx7153kf2c8y9bc8kw0000gn/T/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[9/19/19 8:14:17 PM] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json
[9/19/19 8:14:18 PM] Downloading extension bundle from https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/1.0.0/Microsoft.Azure.Functions.ExtensionBundle.1.0.0.zip to /var/folders/pl/qgvhtxwx7153kf2c8y9bc8kw0000gn/T/5d2fd1c0-d8f7-4ced-82c9-93cf0de7f0bc/Microsoft.Azure.Functions.ExtensionBundle.1.0.0.zip
Hosting environment: Production
Content root path: /Users/[username]/[project]
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
Value cannot be null.
Parameter name: provider
Application is shutting down...
[9/19/19 8:16:31 PM] Stopping host...
[9/19/19 8:16:31 PM] Host shutdown completed.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 15 (4 by maintainers)
Here were my workaround steps. This was on a Mac but the concepts should carry over to other platforms.
If
func host start
fails to get rolling and you see in the console messages about downloading the extension bundle and then two minutes later that theprovider
cannot be null, you probably need to manually download the extension bundle.Downloading extension bundle
)Looking for extension bundle
)1.0.0
in the example)func host start
againHaving same issue. Located in Japan. Attempts to hit https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/1.1.1/Microsoft.Azure.Functions.ExtensionBundle.1.1.1.zip time out after like 10 seconds and app just crashes:
Same issue here. I tried the workaround by @Programmerman1 however it didn’t quite work (System.Private.CoreLib: The file …dll already exists), but I noticed something. It seems the download from azureedge.net CDN goes very, very slow, for some reason. I think it just times out and that’s why I end up getting the error when running
func host start
.Just out of curiosity I tried downloading it using a VPN connected to a different country and download was blazing fast (less than a second) and the function worked fine. So it’s probably some network issues for the azureedge CDN in my region (East Asia).
However, what I don’t really understand is why everyday I run
func host start
and it needs to re-download the same bundle version… I would think the same one from a few hours ago should still be valid?Well I deleted the following from
host.json
and it started working locally.@mrpassiontea Can you remove the
extension bundle
section from host.json and try again? By Removing bundle configuration the extension bundle download will not happen. That should help you isolate the issue.