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

Exceeded language worker restart retry count for runtime:node. Shutting down Functions Host #42379

Closed
geoffbrucepayne opened this issue Nov 7, 2019 — with docs.microsoft.com · 36 comments

Comments

Copy link

For some reason I keep getting this error and cannot run the function locally as a result. I am running Linux Mint 19.1 Cinnamon
Terminal output:
[2019-11-07 9:40:47 p.m.] Starting JobHost
[2019-11-07 9:40:47 p.m.] Starting Host (HostId=gbpid79c-1222241483, InstanceId=a71693a8-f0ed-4f39-9ed0-7e394b04957b, Version=2.0.12858.0, ProcessId=6055, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2019-11-07 9:40:47 p.m.] Loading functions metadata
[2019-11-07 9:40:47 p.m.] 1 functions loaded
[2019-11-07 9:40:47 p.m.] Loading proxies metadata
[2019-11-07 9:40:47 p.m.] Initializing Azure Function proxies
[2019-11-07 9:40:48 p.m.] 0 proxies loaded
[2019-11-07 9:40:48 p.m.] Starting worker process:node --inspect=9229 "/usr/lib/azure-functions-core-tools/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 40881 --workerId 11529386-f795-4041-ad52-06d10ca5d65a --requestId 313565dc-8d3f-4d05-92ee-b797cd2f8b35 --grpcMaxMessageLength 134217728
[2019-11-07 9:40:48 p.m.] node process with Id=6086 started
[2019-11-07 9:40:48 p.m.] Starting worker process:node --inspect=9229 "/usr/lib/azure-functions-core-tools/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 40881 --workerId fca4a346-2822-4472-b48c-4a4ac8bd5c6b --requestId 9a73268e-32a0-4fd9-8927-c0e1963b16b2 --grpcMaxMessageLength 134217728
[2019-11-07 9:40:48 p.m.] node process with Id=6095 started
[2019-11-07 9:40:48 p.m.] Starting worker process:node --inspect=9229 "/usr/lib/azure-functions-core-tools/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 40881 --workerId 344469b4-e6a5-4e73-9697-30cb2b99aede --requestId 9e2a8138-e8d8-4f31-9949-a1e08b972103 --grpcMaxMessageLength 134217728
[2019-11-07 9:40:48 p.m.] node process with Id=6104 started
[2019-11-07 9:40:48 p.m.] Exceeded language worker restart retry count for runtime:node. Shutting down Functions Host
[2019-11-07 9:40:48 p.m.] Generating 1 job function(s)
[2019-11-07 9:40:49 p.m.] Found the following functions:
[2019-11-07 9:40:49 p.m.] Host.Functions.HttpTrigger
[2019-11-07 9:40:49 p.m.]
[2019-11-07 9:40:49 p.m.] Initializing function HTTP routes
[2019-11-07 9:40:49 p.m.] Mapped function route 'api/HttpTrigger' [get,post] to 'HttpTrigger'
[2019-11-07 9:40:49 p.m.]
[2019-11-07 9:40:49 p.m.] Host initialized (1533ms)
[2019-11-07 9:40:49 p.m.] Host started (1550ms)
[2019-11-07 9:40:49 p.m.] Job host started
[2019-11-07 9:40:49 p.m.] Starting inspector on 127.0.0.1:9229 failed: address already in use
[2019-11-07 9:40:49 p.m.] Starting inspector on 127.0.0.1:9229 failed: address already in use
[2019-11-07 9:40:49 p.m.] Starting inspector on 127.0.0.1:9229 failed: address already in use
Hosting environment: Production
Content root path: /home/gbp/projects/test
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.

Http Functions:

    HttpTrigger: [GET,POST] http://localhost:7071/api/HttpTrigger

[2019-11-07 9:40:49 p.m.] Stopping host...
[2019-11-07 9:40:49 p.m.] Stopping JobHost
[2019-11-07 9:40:49 p.m.] Job host stopped
[2019-11-07 9:40:49 p.m.] Host shutdown completed.
Application is shutting down...


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@mikeurnun
Copy link
Contributor

@geoffbrucepayne Thank you for your feedback! We will review and update as appropriate.

@gertjanschokkaert
Copy link

For some reason I keep getting this error and cannot run the function locally as a result. I am running Linux Mint 19.1 Cinnamon
Terminal output:
[2019-11-07 9:40:47 p.m.] Starting JobHost
[2019-11-07 9:40:47 p.m.] Starting Host (HostId=gbpid79c-1222241483, InstanceId=a71693a8-f0ed-4f39-9ed0-7e394b04957b, Version=2.0.12858.0, ProcessId=6055, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2019-11-07 9:40:47 p.m.] Loading functions metadata
[2019-11-07 9:40:47 p.m.] 1 functions loaded
[2019-11-07 9:40:47 p.m.] Loading proxies metadata
[2019-11-07 9:40:47 p.m.] Initializing Azure Function proxies
[2019-11-07 9:40:48 p.m.] 0 proxies loaded
[2019-11-07 9:40:48 p.m.] Starting worker process:node --inspect=9229 "/usr/lib/azure-functions-core-tools/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 40881 --workerId 11529386-f795-4041-ad52-06d10ca5d65a --requestId 313565dc-8d3f-4d05-92ee-b797cd2f8b35 --grpcMaxMessageLength 134217728
[2019-11-07 9:40:48 p.m.] node process with Id=6086 started
[2019-11-07 9:40:48 p.m.] Starting worker process:node --inspect=9229 "/usr/lib/azure-functions-core-tools/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 40881 --workerId fca4a346-2822-4472-b48c-4a4ac8bd5c6b --requestId 9a73268e-32a0-4fd9-8927-c0e1963b16b2 --grpcMaxMessageLength 134217728
[2019-11-07 9:40:48 p.m.] node process with Id=6095 started
[2019-11-07 9:40:48 p.m.] Starting worker process:node --inspect=9229 "/usr/lib/azure-functions-core-tools/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 40881 --workerId 344469b4-e6a5-4e73-9697-30cb2b99aede --requestId 9e2a8138-e8d8-4f31-9949-a1e08b972103 --grpcMaxMessageLength 134217728
[2019-11-07 9:40:48 p.m.] node process with Id=6104 started
[2019-11-07 9:40:48 p.m.] Exceeded language worker restart retry count for runtime:node. Shutting down Functions Host
[2019-11-07 9:40:48 p.m.] Generating 1 job function(s)
[2019-11-07 9:40:49 p.m.] Found the following functions:
[2019-11-07 9:40:49 p.m.] Host.Functions.HttpTrigger
[2019-11-07 9:40:49 p.m.]
[2019-11-07 9:40:49 p.m.] Initializing function HTTP routes
[2019-11-07 9:40:49 p.m.] Mapped function route 'api/HttpTrigger' [get,post] to 'HttpTrigger'
[2019-11-07 9:40:49 p.m.]
[2019-11-07 9:40:49 p.m.] Host initialized (1533ms)
[2019-11-07 9:40:49 p.m.] Host started (1550ms)
[2019-11-07 9:40:49 p.m.] Job host started
[2019-11-07 9:40:49 p.m.] Starting inspector on 127.0.0.1:9229 failed: address already in use
[2019-11-07 9:40:49 p.m.] Starting inspector on 127.0.0.1:9229 failed: address already in use
[2019-11-07 9:40:49 p.m.] Starting inspector on 127.0.0.1:9229 failed: address already in use
Hosting environment: Production
Content root path: /home/gbp/projects/test
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.

Http Functions:

    HttpTrigger: [GET,POST] http://localhost:7071/api/HttpTrigger

[2019-11-07 9:40:49 p.m.] Stopping host...
[2019-11-07 9:40:49 p.m.] Stopping JobHost
[2019-11-07 9:40:49 p.m.] Job host stopped
[2019-11-07 9:40:49 p.m.] Host shutdown completed.
Application is shutting down...

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

same problem here

@ggailey777
Copy link
Contributor

What version of Node.js are you running?

@torumakabe
Copy link
Contributor

@ggailey777 Same here, the versions

node: v10.14.1
func: 2.7.1846
OS: ubuntu 18.04 (on WSL1)

@paulwrussell
Copy link

paulwrussell commented Nov 12, 2019

Im getting the same for a function that was working earlier today.

From Visual Studio Code:
Version: 1.40.0
Commit: 86405ea23e3937316009fc27c9361deee66ffbf5
Date: 2019-11-06T17:09:34.601Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0

I don't even know what update has caused this so that i can roll it back. was it the azure functions tools? visual studio? node?

@strantr
Copy link

strantr commented Nov 12, 2019

We had 3 people all get this error starting at roughly the same time, all on Windows using Visual Studio Code.

The problem for us was identified in the log as:
Starting inspector on 127.0.0.1:9229 failed: address already in use

which is the output of the call to
Starting worker process:node --inspect=9229...

Running:
netstat -aon | find "9229"
Showed LISTENING on that port by a Code.exe process
Killing this caused an error Extension Host has terminated or something similar, if you click restart on this the problem persisted

After shutting down Code and running netstat until all sockets had been fully closed then restarting Code, it resolved the issue for us.

Looks like the Azure Functions extension was updated within the last week adding some support for Functions v3 which may have caused this issue:
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions

@gertjanschokkaert
Copy link

Still same problem here, last week all functions were running fine:
versions:
Windows 10 Enterprise
Node v10.14.1
npm 6.4.1
[email protected]

Can somebody help me please? Really stuck here and cannot find working solution on the internet.

@leonbrag
Copy link

I have started to have the same issue. That was no issues prior to today

Version: 1.40.0 (user setup)
Commit: 86405ea23e3937316009fc27c9361deee66ffbf5
Date: 2019-11-06T17:02:13.381Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.17134

@paulwrussell
Copy link

Any updates on this @mike-urnun-msft?

@barratt
Copy link

barratt commented Nov 13, 2019

Also getting this since yesterday

Node: v8.11.1
NPM: 5.6.0
OS: Mac Mojave 10.14.6

@billbliss
Copy link
Contributor

Same problem here.

  • Node: 10.14.1 (Although VS Code is running 12.4.0, could that matter? I am only using Node 10.4.1 because that was the latest LTS version of Azure functions when I first created it a few months ago. I can see if I can upgrade it.)
  • NPM: 6.4.1
  • OS: Windows 10 Enterprise, version 1909, 64-bit OS build 18363.418
  • azure-functions-core-tools: tried 2.7.1846, 2.7.1724, 2.7.1704 (uninstall between)
  • VS Code: 2019-11-06T17:02:13.381Z

Still get the "Exceeded language worker restart retry count for runtime:node" error. I've seen this before when there was a dangling node.js process inside VS Code, and I manually killed it and it was fine, but that was intermittent and this happens all the time.

@ggailey777
Copy link
Contributor

Everyone, sorry for the delay on this. We're having this investigated now.

@dsm0880
Copy link

dsm0880 commented Nov 13, 2019

For anyone experiencing the issue, I closed VSCode and reopened it. I see the same thing as @gertjanschokkaert:

Starting inspector on 127.0.0.1:9229 failed: address already in use

I think closing VSCode releases something that allows it to work again. Not a permanent fix, but something to you going potentially.

@sajeetharan
Copy link
Member

Same issue while doing a demo

@paulwrussell
Copy link

Ive tried restarting VSCode and laptop, but neither help.

@mikeurnun
Copy link
Contributor

mikeurnun commented Nov 14, 2019

Hi folks - Sorry for the delay. I was able to reproduce this only once in my first attempt (core tools 2.7.1724 build) but running func host start in my command line seems to have fixed it as I'm no longer seeing this issue in my subsequent attempts. Has anyone of you tried running directly from your cli? Please try that out while I dig deeper and look further into this.

@ibenjemia
Copy link

Downgrading VSCode to version 1.39.2 will fix this.

@mshafiqmk
Copy link

Thanks @ibenjemia i was facing same issue , but your suggestion help me to fix it.

@Owemeone
Copy link

Facing this problem myself, I started debugging. Process Explorer showed me that the ExtensionHost was opening port 9229. For me disabling the Azure Pipelines extension fixed the issue.

I'm going to check the Azure Pipelines extensions on why it seems to start with "debugging enabled".

@deepanjannag
Copy link

I'm on VS Code 1.40.1 and facing the same problem.

@Miosso
Copy link

Miosso commented Nov 19, 2019

I downgraded my VS code to 1.39.2 and the Azure Functions Plugin to 0.19.0 and it worked for me.

@ejizba
Copy link
Contributor

ejizba commented Nov 21, 2019

Created this issue in VS Code: microsoft/vscode#85328

@mikeurnun
Copy link
Contributor

Hello everyone - We're proceeding to close this issue as (a) this repo is more for driving improvements towards MS Docs and (b) we're now tracking the issue in the repo referenced above in @EricJizbaMSFT's comment.

@mikeurnun
Copy link
Contributor

mikeurnun commented Nov 22, 2019

Hello @geoffbrucepayne & everyone else who hit this issue - If you're still experiencing this issue, please refer to the various workarounds shared here while the team rolls out the fix (already available in VSCode insiders version) in a matter of a week or two at the latest (exact date is TBD & subject to change).

@tinyweasel
Copy link

tinyweasel commented Nov 26, 2019

Having the same issue here, not using VS Code. Any workaround?
Edit: never mind, I just killed the process using port 9229.

@bsab
Copy link

bsab commented Apr 21, 2020

Hello, i'm having the same issue here, not using VS Code.
Any updates on this @mike-urnun-msft?

@tohagan
Copy link

tohagan commented May 13, 2020

Same issue still using VS Code

@M1GM15
Copy link

M1GM15 commented May 22, 2020

@tohagan. This may not work for you due to the nature of every configuration being different, but I had tried most everything recommended here and on other sites. I switched from miniconda to an alternative app for virtual environments and somehow not everything associated with miniconda was properly removed. I am not sure why but after I uninstalled miniconda, it left remnants inside my powershell profile script. I removed the remnants of miniconda code inside my powershell profile script and VS Code debugger began working with Azure Functions again.

@ktrsanjiv
Copy link

This issue is related to local proxy.

We should add below line to your local.settings.json

"NO_PROXY": "localhost,127.0.0.1"

Once you add this line to you json file, you can see you grpc automatically started running

Your file should look like this:-

{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "python",
"NO_PROXY": "localhost,127.0.0.1"
}
}

@idjohnson
Copy link

FWIW i dance between WSL and Windows. Since i was testing in WSL, i negelected to pick the linux node version. So it wsa just vomitting over and over.. I used 'nvm list' then changed from 'system' to one of the local linux node versions that works (e.g. nvm use 10.22.1). then it started.

@AndreasPirker
Copy link

Still suffering from this. Is the only way downgrading to a two-year-old version of Visual Studio Code???!

@Jason446620
Copy link

@AndreasPirker I have followed your question in the SO forum, and it is currently impossible to reproduce your situation. If possible, it is recommended to upload your sample code and pay attention to hiding confidential information so that I can reply to you after the test.

@Jason446620
Copy link

@AndreasPirker In addition, please note your vscode version and function tools version, and tell me the local pc is linux, macos or windows?

@contrapost
Copy link

contrapost commented Mar 25, 2021

nvm use 10.22.1 helped when starting functions on mac. thanks @idjohnson

@LeoInCode
Copy link

I have the same problem a two weeks ago, and today, I understand why. One reason, possibly, it's because the connection the database. I'm using postgreSQL and redis, and if redis don't running, the application show this error. Maybe it's happening to you too.

@AArkwellTB
Copy link

Just in-case anyone is still trying to fix this, I just encountered the error with an API call triggering SharePoint Graph API uploads. My intake trigger would run twice then run a third time and shut down with this error.

I fixed it entirely by just removing all errors in my console. I just had 'can't read from undefined' error, which wasn't enough to stop the entire thing running but it was making it fail with this exact error after three API submissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests