-
Notifications
You must be signed in to change notification settings - Fork 136
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
Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:5858) #387
Comments
I had the same issue, and it seems partially related to the Node version installed (I had v10). I believe the functions runtime only supports v8. My functions now run at least, but I still get the debugger error |
@thesilverbadger that's right. I have v10 installed. |
I'm getting the same error with Node 8.11.2 and v2 runtime on Windows. v1 runtime works fine as long as I set protocol to "legacy" in launch.json. I can't connect the vscode debugger to v2 runtime using either "legacy" or "inspector" protocol. |
This only reproduces for me on the latest version of the func cli. As a workaround, you can install the previous version with this command:
@ahmelsayed @fabiocav any idea why the .26 release would've broken javascript debugging in VS Code? |
There were some changes with the Node worker in this release. @EricJizbaMSFT , I'm assuming you see the issue if Node 8.4.0 or higher is installed, is that correct? /cc @mhoeger as she might have more information on the issue. |
Can confirm that 2.0.1-beta.25 fixes the issue for me, running Node 8.11.2 and VS Code 1.23.1 |
I'm on node v8.6. It seems like '--inspect=5858' isn't being passed in to the node process like it used to be. This is what I see in the log for .25:
This is what I see in the log for .26:
|
It looks like this PR introduced a change in the way we check for debug port: Azure/azure-functions-host@980107f. It seems like the issue may be more fundamental though, as adding the additional environment variable (see snippet below) which sets the --inspect param correctly does not attach a debugger correctly.
==CORRECTION: adding this does work== I'm filing an issue for this against the runtime, cc @pragnagopa |
Thank you @mhoeger! That makes sense. Can you link to the issue here to make it easier for others to track? @EricJizbaMSFT we'll have another release very soon (we're iterating very quickly on a few items), and hopefully we can have this patched with the next drop |
Awesome thanks! @fabiocav just to be clear - when you say "we can have this patched" do you mean it would be backwards compatible with the old behavior? I don't entirely follow the changes mentioned by @mhoeger, but it would be difficult for our extension to change existing 'launch.json' or 'tasks.json' files, especially since users might've already customized them. We can certainly update our templates if need be, but that only affects new projects. |
We'll discuss whether this would be fixed to be backwards compatible. It wouldn't be difficult to do that, but we only have a chance to make those kinds of changes while we're in preview, and keeping preview behavior for backwards compatibility is something we're trying to avoid. With that said, this wouldn't be problematic to keep, so I don't think it would be an issue. |
Correction to my comment earlier: adding the following property to a task in tasks.json will correctly attach the debugger: @EricJizbaMSFT - we're still looking into being backwards compatible, although it might not be in the next release. |
The
Note: using |
@mhoeger The 'env' option you described is also not working for me. |
The release is due to [this bug](#387), but doesn't actually fix the bug itself (the real fix needs to be in the func cli). However, this release mitigates the bug by giving us the ability to 'turn off' the prompt to install the latest func cli (since Nathan [just changed](#391) it to an aka.ms link). I did a few additional things: 1. Stop displaying errors in the output channel. I think they're more confusing than helpful (NOTE: `this.suppressErrorDisplay` is still on even though I removed the try/catch, so users will NOT see these errors) 1. Temporarily hard-code the kudu package to the version used with the last release. I want to keep changes as small as possible for this bug-fix release
NOTE: When running on a non-Windows machine, the environment name should be |
Same issue in Java. It looks like the function cli does not start the JVM in debug mode. |
I can confirm that setting Is this a general convention between windows and non-windows operating systems? I once wondered why typescript |
Closing this issue as it has been fixed in the latest version of the func cli. The workarounds mentioned above are no longer necessary - simply update your func cli:
or
|
@EricJizbaMSFT I can confirm that it's still not working for me on MacOS. :( I ran brew upgrade azure-functions-core-tools OUTPUT Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.
Error: azure/functions/azure-functions-core-tools 2.0.1-beta.28 already installed When I create an Azure function, let's say HTTP triggered JavaScript based function. And press play in the debug the following is what I get as output in my terminal. TERMINAL OUTPUT (CLICK TO EXPAND!)> Executing task: func host start <
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Hosting environment: Production
Content root path: /Users/ahmadawais/Documents/Web/Sandbox/demo-azure-func
Now listening on: http://localhost:7071
Application started. Press Ctrl+C to shut down.
[5/31/18 11:58:20 PM] Reading host configuration file '/Users/ahmadawais/Documents/Web/Sandbox/demo-azure-func/host.json'
[5/31/18 11:58:20 PM] Host configuration file read:
[5/31/18 11:58:20 PM] {}
[5/31/18 11:58:20 PM] Starting Host (HostId=ahmadsmacbookpro-1530556110, InstanceId=2485c474-9ed2-4041-b716-b11e819adb18, Version=2.0.11776.0, ProcessId=60925, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[5/31/18 11:58:20 PM] Loading all the worker providers from the default workers directory: /usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers
[5/31/18 11:58:20 PM] Found worker config: /usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/python/worker.config.json
[5/31/18 11:58:20 PM] Will load worker provider for language: python
[5/31/18 11:58:20 PM] Start Process: node --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 64239 --workerId eb429ee4-d00a-4aa9-8ea1-3b9b62facfb0 --requestId 7bd13f1f-4b9b-478f-89ca-61e32683718d --grpcMaxMessageLength 134217728
[5/31/18 11:58:20 PM] Generating 1 job function(s)
[5/31/18 11:58:20 PM] Found the following functions:
[5/31/18 11:58:20 PM] Host.Functions.HttpTriggerJS
[5/31/18 11:58:20 PM]
[5/31/18 11:58:20 PM] Host initialized (834ms)
[5/31/18 11:58:20 PM] Host started (881ms)
[5/31/18 11:58:20 PM] Job host started
[5/31/18 11:58:20 PM] Debugger listening on port 5858.
[5/31/18 11:58:20 PM] Warning: This is an experimental feature and could change at any time.
[5/31/18 11:58:20 PM] To start debugging, open the following URL in Chrome:
[5/31/18 11:58:20 PM] chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/38025454-03f3-4ff6-a096-f10c16bf46da
Listening on http://localhost:7071/
Hit CTRL-C to exit...
Http Functions:
HttpTriggerJS: http://localhost:7071/api/HttpTriggerJS
[5/31/18 11:58:21 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/31/18 11:58:21 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/31/18 11:58:21 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/31/18 11:58:21 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/31/18 11:58:21 PM] module.js:472
[5/31/18 11:58:21 PM] throw err;
[5/31/18 11:58:21 PM] ^
[5/31/18 11:58:21 PM] Error: Cannot find module './Worker.js'
[5/31/18 11:58:21 PM] at Function.Module._resolveFilename (module.js:470:15)
[5/31/18 11:58:21 PM] at Function.Module._load (module.js:418:25)
[5/31/18 11:58:21 PM] at Module.require (module.js:498:17)
[5/31/18 11:58:21 PM] at require (internal/module.js:20:19)
[5/31/18 11:58:21 PM] at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js:8:14)
[5/31/18 11:58:21 PM] at Module._compile (module.js:571:32)
[5/31/18 11:58:21 PM] at Object.Module._extensions..js (module.js:580:10)
[5/31/18 11:58:21 PM] at Module.load (module.js:488:32)
[5/31/18 11:58:21 PM] at tryModuleLoad (module.js:447:12)
[5/31/18 11:58:21 PM] at Function.Module._load (module.js:439:3)
[5/31/18 11:58:21 PM] Worker encountered an error.
[5/31/18 11:58:21 PM] Worker process with pid 60936 exited with code 1.
[5/31/18 11:58:21 PM] Start Process: node --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 64239 --workerId 13d9c4eb-ef83-4269-a3a4-96c2d21d36f7 --requestId e1d8dc1b-f79c-49f6-af53-0f06131750b1 --grpcMaxMessageLength 134217728
[5/31/18 11:58:21 PM] Debugger listening on port 5858.
[5/31/18 11:58:21 PM] Warning: This is an experimental feature and could change at any time.
[5/31/18 11:58:21 PM] To start debugging, open the following URL in Chrome:
[5/31/18 11:58:21 PM] chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/404b2994-7fe4-482c-a4d9-47b162c9c016
[5/31/18 11:58:21 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/31/18 11:58:21 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/31/18 11:58:21 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/31/18 11:58:21 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/31/18 11:58:21 PM] module.js:472
[5/31/18 11:58:21 PM] throw err;
[5/31/18 11:58:21 PM] ^
[5/31/18 11:58:21 PM] Error: Cannot find module './Worker.js'
[5/31/18 11:58:21 PM] at Function.Module._resolveFilename (module.js:470:15)
[5/31/18 11:58:21 PM] at Function.Module._load (module.js:418:25)
[5/31/18 11:58:21 PM] at Module.require (module.js:498:17)
[5/31/18 11:58:21 PM] at require (internal/module.js:20:19)
[5/31/18 11:58:21 PM] at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js:8:14)
[5/31/18 11:58:21 PM] at Module._compile (module.js:571:32)
[5/31/18 11:58:21 PM] at Object.Module._extensions..js (module.js:580:10)
[5/31/18 11:58:21 PM] at Module.load (module.js:488:32)
[5/31/18 11:58:21 PM] at tryModuleLoad (module.js:447:12)
[5/31/18 11:58:21 PM] at Function.Module._load (module.js:439:3)
[5/31/18 11:58:21 PM] Worker encountered an error.
[5/31/18 11:58:21 PM] Worker process with pid 60938 exited with code 1.
[5/31/18 11:58:21 PM] Start Process: node --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 64239 --workerId 730f8528-4b09-4340-8d85-4f3e67a7b033 --requestId cbc03b01-628f-436c-bf82-3eafd59fd699 --grpcMaxMessageLength 134217728
[5/31/18 11:58:21 PM] Debugger listening on port 5858.
[5/31/18 11:58:21 PM] Warning: This is an experimental feature and could change at any time.
[5/31/18 11:58:21 PM] To start debugging, open the following URL in Chrome:
[5/31/18 11:58:21 PM] chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/ccb6f279-c7d1-4bfe-a13a-49f79db2dbf7
[5/31/18 11:58:21 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/31/18 11:58:21 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/31/18 11:58:21 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/31/18 11:58:21 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/31/18 11:58:21 PM] module.js:472
[5/31/18 11:58:21 PM] throw err;
[5/31/18 11:58:21 PM] ^
[5/31/18 11:58:21 PM] Error: Cannot find module './Worker.js'
[5/31/18 11:58:21 PM] at Function.Module._resolveFilename (module.js:470:15)
[5/31/18 11:58:21 PM] at Function.Module._load (module.js:418:25)
[5/31/18 11:58:21 PM] at Module.require (module.js:498:17)
[5/31/18 11:58:21 PM] at require (internal/module.js:20:19)
[5/31/18 11:58:21 PM] at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js:8:14)
[5/31/18 11:58:21 PM] at Module._compile (module.js:571:32)
[5/31/18 11:58:21 PM] at Object.Module._extensions..js (module.js:580:10)
[5/31/18 11:58:21 PM] at Module.load (module.js:488:32)
[5/31/18 11:58:21 PM] at tryModuleLoad (module.js:447:12)
[5/31/18 11:58:21 PM] at Function.Module._load (module.js:439:3)
[5/31/18 11:58:21 PM] Worker encountered an error.
[5/31/18 11:58:21 PM] Worker process with pid 60939 exited with code 1.Details!
And the same error Help. |
@ahmadawais I think this is the key part of the log for you:
I would recommend updating your version of Node, but if you need to stick to v7.10.0 then you can follow the instructions to 'install required native modules' |
@EricJizbaMSFT That's the thing. As you can check from the first comment in this issue I am using Node v10 locally. VSCode 1.23.1
MacOS
Node: 10.1.0
OS: macOS Sierra
npm: 6.0.1
Chrome: 66.0.3359.181 I have also tried with Node 9.7.1 and this message is beyond me I don't know why I am getting this error. Any help? Pretty sure this is a bug. |
@ahmadawais - This issue was tracking broken debug experience from VSCode, which is now fixed in the latest version of CLI 2.0.1-beta.28. The issue you are running into might be due to node version. Can you please open a new issue in https://github.com/Azure/azure-functions-nodejs-worker repo? |
Yes I do see that. Also I switched to v9.7.1 but no luck. It's correctly in
thr $PATH ... I am a Node.js dev just in case you know. Also I use nvm for
different nide version management.
|
@ahmadawais I'll echo what @pragnagopa said. There were two issues here - one directly related to VS Code (which was fixed) and one specific to the azure-functions-nodejs-worker. I don't think there's anything we could do from the VS Code side to fix your issue and I recommend investigating it further in the repo she mentioned: https://github.com/Azure/azure-functions-nodejs-worker |
Sure done Azure/azure-functions-nodejs-worker#89 |
@ahmadawais - This line in your error log shows that VS Code thinks your version of node is an unsupported older version (I think).
I was experiencing a similar issue with VS Code thinking I was using v10.x of node. I found that it is due to how nvm interacts with shell environments and how VS Code loads the node version based on what is aliased as the The only suggested solution that worked for me was to set > ls -l /usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary
total 0
drwxr-xr-x 3 someone staff 96 Jun 7 19:43 node-v48-win32-ia32
drwxr-xr-x 3 someone staff 96 Jun 7 19:43 node-v57-darwin-ia32
drwxr-xr-x 3 someone staff 96 Jun 7 19:43 node-v57-darwin-x64
drwxr-xr-x 3 someone staff 96 Jun 7 19:43 node-v57-linux-ia32
drwxr-xr-x 3 someone staff 96 Jun 7 19:43 node-v57-linux-x64
drwxr-xr-x 3 someone staff 96 Jun 7 19:43 node-v57-win32-ia32
drwxr-xr-x 3 someone staff 96 Jun 7 19:43 node-v57-win32-x64 NOTE: Setting the @EricJizbaMSFT and @pragnagopa would making the |
UPDATE: Oh wow! I just figured it out. It's working fine now. So, here's what happened. I have Also, opened a PR to improve the error message. Azure/azure-functions-nodejs-worker#92 Thanks to |
@mikeclymer thanks for the help. In terms of this:
You might be able to use environment variables in your launch.json to get this same effect, but please file a separate issue if you're still interested and we can investigate further |
I am running into this same issue I am able to debug if I manually attach to the node process, but any reason why it's not working for me even though I have the latest tools installed? |
@markheath There's a known bug in 2.0.1-beta.31 for node functions. Please try adding |
@EricJizbaMSFT magic! that did the trick. Thanks for the speedy response. |
I'm facing a weird issue.
Error:
Launch.json
Trying to create an Azure function.
Several errors in my terminal output:
Help.
The text was updated successfully, but these errors were encountered: