Running func host start runs OK for the first ~5 times. Shutting down via CTRL-C, after about the 4th time I begin to see the following error.. .
Azure Functions Core Tools (2.2.70 Commit hash: 1f1f77a71c5517b00401aa0ebf00a4f16857a94c)
Function Runtime Version: 2.0.12175.0
[12/1/18 8:59:39 AM] Stopping host...
[12/1/18 8:59:39 AM] Host shutdown completed.
Cannot access a disposed object.
Object name: 'IServiceProvider'.
I hit CTRL-C when getting this error and the host just hangs with an error
Application is shutting down...
Using the latest version of the Python worker.
The only way I have found to resolve this issue is by restarting my Mac. killall func does nothing.
Same issue
Fixed it by re-activating the virtual environment, re-installing the requirements.
Experienced same issue. Fix it by removing dependencies, reinstalling them and restarting my mac. I'm using High Sierra.
When I stop the current local development process (by pressing ctrl + c) and then run func host start in a new terminal. Then in the new terminal, frequently i get this issue. however,killall func works for me.
I'm using VS Code 1.29.1 on mac High Sierra 10.13.6
I'm having the same error on Windows, trying to run the dev build of the core tools from the command line, as per the instrucitons in the contribution guide. I've tried restarting the computer, with no luck.
My output is as following:
`PS C:\dev\EchoFunction\JavaScript\V2> dotnet run --project C:\Dev\azure-functions-core-tools\src\Azure.Functions.Cli\ start
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Azure Functions Core Tools (2.3.1 Commit hash: N/A)
Function Runtime Version: 2.0.12246.0
Skipping 'AzureWebJobsStorage' from local settings as it's already defined in current environment variables.
Cannot access a disposed object.
Object name: 'IServiceProvider'.
Application is shutting down...`
I had the same issue and it turns out that it was caused by a port being freed improperly.
Figure out what process is being run on port 7071 (or, if you didn’t choose the default, the port you specified). Then kill that process and re-start ‘func host start’. Should work 😊
From: Hannes Nel notifications@github.com
Sent: Tuesday, December 18, 2018 3:16 PM
To: Azure/azure-functions-core-tools azure-functions-core-tools@noreply.github.com
Cc: Rabeea Ahmed raahmed@microsoft.com; Comment comment@noreply.github.com
Subject: Re: [Azure/azure-functions-core-tools] Mac OS X - Cannot access a disposed object. Object name: 'IServiceProvider'. (#907)
I'm having the same error on Windows, trying to run the dev build of the core tools from the command line, as per the instrucitons in the contribution guide. I've tried restarting the computer, with no luck.
My output is as following:
`PS C:\dev\EchoFunction\JavaScript\V2> dotnet run --project C:\Dev\azure-functions-core-tools\src\Azure.Functions.Cli\ start
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Azure Functions Core Tools (2.3.1 Commit hash: N/A)
Function Runtime Version: 2.0.12246.0
Skipping 'AzureWebJobsStorage' from local settings as it's already defined in current environment variables.
Cannot access a disposed object.
Object name: 'IServiceProvider'.
Application is shutting down...`
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-functions-core-tools%2Fissues%2F907%23issuecomment-448407829&data=02%7C01%7Craahmed%40microsoft.com%7Ccda94ea685d24c7a419708d6653eb940%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636807717402255867&sdata=4fJeSFAgI%2FVG5eK7F40INho5l4wy%2BQqDBx64666QezI%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAYyYv8wuGx4K-o3S9-Hdwvf2kHhbw83Oks5u6XcagaJpZM4Y8zPm&data=02%7C01%7Craahmed%40microsoft.com%7Ccda94ea685d24c7a419708d6653eb940%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636807717402265876&sdata=8g0hRmw2WTiAM82UKHrTKCQXikZkOMTMrmzxWyg760o%3D&reserved=0.
Figure out what process is being run on port 7071 (or, if you didn’t choose the default, the port you specified). Then kill that process and re-start ‘func host start’. Should work 😊
To add a bit more information on _how_ to do this (on macOS, at least), run the following in a terminal to identify the process that's listening on the port (e.g. 7071):
lsof -nP -i4TCP:7071 | grep LISTEN
In the response you'll get the process name and its process ID (PID). In my case, the process was python3.6. I then used Activity Monitor to locate the python3.6 process with the PID listed by that command to kill it (the kill command works, too).
I originally posted this information in another thread but hope that it's helpful for others here who suffer the same issue!
Awesome, thanks! In PowerShell this would be
Get-Process -Id (Get-NetTCPConnection -LocalPort 7071).OwningProcess | Stop-Process
after adding port number in package.json it got resolved for me.
something like this "azure-host": "cd src && func host start --port 7179"
Most helpful comment
I had the same issue and it turns out that it was caused by a port being freed improperly.
Figure out what process is being run on port 7071 (or, if you didn’t choose the default, the port you specified). Then kill that process and re-start ‘func host start’. Should work 😊
From: Hannes Nel notifications@github.com
Sent: Tuesday, December 18, 2018 3:16 PM
To: Azure/azure-functions-core-tools azure-functions-core-tools@noreply.github.com
Cc: Rabeea Ahmed raahmed@microsoft.com; Comment comment@noreply.github.com
Subject: Re: [Azure/azure-functions-core-tools] Mac OS X - Cannot access a disposed object. Object name: 'IServiceProvider'. (#907)
I'm having the same error on Windows, trying to run the dev build of the core tools from the command line, as per the instrucitons in the contribution guide. I've tried restarting the computer, with no luck.
My output is as following:
`PS C:\dev\EchoFunction\JavaScript\V2> dotnet run --project C:\Dev\azure-functions-core-tools\src\Azure.Functions.Cli\ start
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
Azure Functions Core Tools (2.3.1 Commit hash: N/A)
Function Runtime Version: 2.0.12246.0
Skipping 'AzureWebJobsStorage' from local settings as it's already defined in current environment variables.
Cannot access a disposed object.
Object name: 'IServiceProvider'.
Application is shutting down...`
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-functions-core-tools%2Fissues%2F907%23issuecomment-448407829&data=02%7C01%7Craahmed%40microsoft.com%7Ccda94ea685d24c7a419708d6653eb940%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636807717402255867&sdata=4fJeSFAgI%2FVG5eK7F40INho5l4wy%2BQqDBx64666QezI%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAYyYv8wuGx4K-o3S9-Hdwvf2kHhbw83Oks5u6XcagaJpZM4Y8zPm&data=02%7C01%7Craahmed%40microsoft.com%7Ccda94ea685d24c7a419708d6653eb940%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636807717402265876&sdata=8g0hRmw2WTiAM82UKHrTKCQXikZkOMTMrmzxWyg760o%3D&reserved=0.