Skip to content

Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:5858). #603

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

Closed
julielerman opened this issue Sep 14, 2018 · 14 comments

Comments

@julielerman
Copy link

Yes, this again.

Extension version: I have installed 0.10.2 three times but it still says it's 0.8.1 (see issue #602 )
VS Code: Version 1.21.1
AF Tools: 2.0.1-beta.38

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.13-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.300/
.NET Core SDKs installed:
2.1.101 [/usr/local/share/dotnet/sdk]
2.1.300-rc1-008673 [/usr/local/share/dotnet/sdk]
2.1.300 [/usr/local/share/dotnet/sdk]

Node version v8.11.0

Here is my launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Attach to JavaScript Functions",
      "type": "node",
      "request": "attach",
      "port": 5858,
      "protocol": "inspector",
      "preLaunchTask": "runFunctionsHost"
    }
  ]
}

I have been trying to fix this for many hours. I've read the other (closed) issues about this. tried some of the hacks except for reverting to .25.

I think this may be notable. When running in debug mode, after the endpoints are displayed, this message comes up:
[9/14/18 12:56:18 PM] Worker e6213e9f-5bd6-498c-9674-d0d98aad7858 connecting on 127.0.0.1:61134 []

While the project I'm working on has Cosmos DB and Twilio extensions, I've tried plain vanilla projects and getting the same problem. I opened up an earlier V2 project that I was debugging back in May and it is now reporting the same problem.

What else can I share with you to help?

@ejizba
Copy link
Contributor

ejizba commented Sep 14, 2018

Can you also copy your tasks.json? That's the part that changed a few months ago due to breaking changes in the cli. There's more information here about how you can manually update your project if necessary: https://github.com/Microsoft/vscode-azurefunctions/blob/master/docs/debugConfig.md

The full output from the 'func host start' task might also be helpful

@julielerman
Copy link
Author

julielerman commented Sep 14, 2018

Here 'tis:
(also I tried adding in the options explicitly for the port as per one of the earlier issues. I see also your July suggestion to add "NODE_OPTIONS": "--inspect=5858" (bug in .30 and .31) directly to (local) settings so I'm going to go try that right now. Thanks!

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Run Functions Host",
      "identifier": "runFunctionsHost",
      "type": "shell",
      "command": "func host start",
      "isBackground": true,
      "presentation": {
        "reveal": "always"
      },
        "problemMatcher": [
        {
          "owner": "azureFunctions",
          "pattern": [
            {
              "regexp": "\\b\\B",
              "file": 1,
              "location": 2,
              "message": 3
            }
          ],
          "background": {
            "activeOnStart": true,
            "beginsPattern": "^.*Stopping host.*",
            "endsPattern": "^.*Job host started.*"
          }
        }
      ]
    }
  ]
}

@julielerman
Copy link
Author

FFS (and LOL)...adding that to local settings did the trick! I thought I'd tried everything and seen every one of the related issues on GitHub. Seriously... about 5 hours of trying and I missed that one! Anyway....maybe there should be a warning like I've seen other times, to add this to local.settings on debug or func start. Do you know where I mean? It comes right before the logo is displayed in the terminal. Or better yet, have the project creator add that to the local.settings.json it creates??

@ejizba
Copy link
Contributor

ejizba commented Sep 14, 2018

Yes we already did that back in July 😊: #478 New projects will work by default and old projects should get a prompt like this:
image

I'm hoping it was just a problem where your extension was out of date and that's the only reason you didn't get that prompt.

Also - we actually don't recommend using the solution you tried in local.settings.json. That file is never synced in git (because it has potentially sensitive connection strings) so other people won't get that change if they clone your repo. We recommend adding the languageWorkers:node:arguments environment variable as described here and shown below:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Run Functions Host",
      "identifier": "runFunctionsHost",
      "type": "shell",
      "command": "func host start",
      "options": {
        "env": {
          "languageWorkers:node:arguments": "--inspect=5858"
        }
      },
      "isBackground": true,
      "presentation": {
        "reveal": "always"
      },
      "problemMatcher": [
        {
          "owner": "azureFunctions",
          "pattern": [
            {
              "regexp": "\\b\\B",
              "file": 1,
              "location": 2,
              "message": 3
            }
          ],
          "background": {
            "activeOnStart": true,
            "beginsPattern": "^.*Stopping host.*",
            "endsPattern": "^.*Job host started.*"
          }
        }
      ]
    }
  ]
}

@ejizba ejizba closed this as completed Sep 14, 2018
@julielerman
Copy link
Author

I actually tried that last night based on a May thread about .26...but now I'll go try it again and report back.

@julielerman
Copy link
Author

what the ... ????? now it works. So maybe one of the other changes I made in betwee affected this.
So bottom line, nobody should have to spend 5 hours struggling with this. Me neither but that's my own fault. How will that be easier in the future. I spent a lot of time in the docs, even did some getting started warlk throughs to see if something in my own app was the problem, also spent a lot of time in github. So even if it was someplace that should have been obvious, I still missed it and I'm not being lazy about it. Is there a way to make it easier to discover? Also, FWIW, the note that did come up before the logo , I missed the firwt 15 times or so. It did not occur to me to scroll up that far.

@julielerman
Copy link
Author

ps. sorry I missed the whole thing about the prompt... why am ai not getting it? That is certainly a very good solution to the above...
Also I stopped the debugger. F5 again and now no debugging again. Something is awry.

@julielerman
Copy link
Author

consistently works with the hack in launch but not with the options in local.settings.

@julielerman
Copy link
Author

can you also double check my detailed list of versions of everything in case SOMETHING is bungling my system up with this? Thanks

@ejizba
Copy link
Contributor

ejizba commented Sep 14, 2018

All versions look good except an old version of VS Code. Commented on this thread: #602

@julielerman
Copy link
Author

uninstalling some other extensios to see if that helps but not... weird. I am plagued! LOL

@julielerman
Copy link
Author

2018-09-14_13-07-36
finally! I trashed .21, installed latest vscode (.27), extensions updated (I now have 0.10.2) and I got the debug prompt!!

@julielerman
Copy link
Author

2018-09-14_13-09-55
and yet... yikes!

I'm going to stop for now and use the hack tomorrow in my session so I can move on...

@julielerman
Copy link
Author

PS THANK YOU FOR BEING SO AMAZINGLY RESPONSIVE!!!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 30, 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

2 participants