Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS X - Cannot access a disposed object. Object name: 'IServiceProvider'. #907

Closed
monty-dev opened this issue Dec 1, 2018 · 9 comments
Milestone

Comments

@monty-dev
Copy link

monty-dev commented Dec 1, 2018

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.

@priyaananthasankar
Copy link

Same issue

@raahmed
Copy link

raahmed commented Dec 7, 2018

Fixed it by re-activating the virtual environment, re-installing the requirements.

@azarboon
Copy link

Experienced same issue. Fix it by removing dependencies, reinstalling them and restarting my mac. I'm using High Sierra.

@azarboon
Copy link

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

@fabiocav fabiocav added this to the Triaged milestone Dec 11, 2018
@hannesne
Copy link

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...`

@raahmed
Copy link

raahmed commented Dec 19, 2018 via email

@ericdrobinson
Copy link

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!

@hannesne
Copy link

hannesne commented Jan 11, 2019

Awesome, thanks! In PowerShell this would be
Get-Process -Id (Get-NetTCPConnection -LocalPort 7071).OwningProcess | Stop-Process

@babusurendra
Copy link

after adding port number in package.json it got resolved for me.
something like this "azure-host": "cd src && func host start --port 7179"

@Azure Azure locked as resolved and limited conversation to collaborators Dec 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants