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

Client NextLS: connection to server is erroring. Shutting down server #28

Closed
nrzull opened this issue Jul 7, 2023 · 24 comments
Closed

Comments

@nrzull
Copy link

nrzull commented Jul 7, 2023

Ubuntu 22.04
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Elixir 1.15.2 (compiled with Erlang/OTP 26)

NextLS is enabled in settings

[Error - 8:21:13 AM] Client NextLS: connection to server is erroring. Shutting down server.
[Error - 8:21:13 AM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
	at _.shutdown (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.2.2/dist/extension.js:2:150023)
	at _.stop (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.2.2/dist/extension.js:2:149604)
	at _.stop (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.2.2/dist/extension.js:2:311618)
	at _.handleConnectionError (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.2.2/dist/extension.js:2:156111)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
@mhanberg
Copy link
Contributor

mhanberg commented Jul 7, 2023

Are you using at least OTP 26.0.2?

@nrzull
Copy link
Author

nrzull commented Jul 8, 2023

@mhanberg yes

@mhanberg
Copy link
Contributor

mhanberg commented Jul 8, 2023

Do you happen to have a runtime.exs file that calls any dependency code or might raise for some reason?

Similar to elixir-tools/next-ls#97

@nrzull
Copy link
Author

nrzull commented Jul 8, 2023

I'm using fresh mix phx.new --no-ecto --no-assets app. There is no deps in runtime.exs 🤔

@mhanberg
Copy link
Contributor

mhanberg commented Jul 8, 2023

Gotcha, I'll check with that same project when I get to a computer next.

Could you share your exact elixir, OTP, and phx.new versions?

@mhanberg
Copy link
Contributor

mhanberg commented Jul 8, 2023

Actually looks like your 1.15.2 and 26.0.2, so just need that phx.new version

@nrzull
Copy link
Author

nrzull commented Jul 8, 2023

1.7.6

@mhanberg
Copy link
Contributor

mhanberg commented Jul 8, 2023

One last thing, you've run mix deps.get, right?

@nrzull
Copy link
Author

nrzull commented Jul 9, 2023

@mhanberg yes

@mhanberg
Copy link
Contributor

@nrzull i've released a new version of Next LS, would you mind confirming if you're still seeing this problem?

@nrzull
Copy link
Author

nrzull commented Jul 13, 2023

@mhanberg no changes unfortunately 😢

@VictorGaiva
Copy link

This error was happening to me when 'credo: Adapter' was set to 'tcp'

@mhanberg
Copy link
Contributor

mhanberg commented Aug 4, 2023

Did you have the server running in tcp mode?

Or are you implying that the original poster should make sure to set the mode to stdio?

@mhanberg
Copy link
Contributor

mhanberg commented Aug 4, 2023

@nrzull can you confirm what settings you have for nextls?

@VictorGaiva
Copy link

I changed to TCP withou really understanding what it did, and this error was shown. After changing back to stdio it stopped erroring. So OP might have it set as TCP too

@nrzull
Copy link
Author

nrzull commented Aug 5, 2023

Well, I have stdio option by default for both nextls and credo so it's not my case

@mhanberg
Copy link
Contributor

@nrzull Do you mind trying again?

The distribution mechanism has changed and it uses a prebuilt executable instead of an elixir script with Mix.install, so I'm wondering if that'll have any impact for you.

@nrzull
Copy link
Author

nrzull commented Aug 17, 2023

😢

[Error - 6:02:18 PM] Client NextLS: connection to server is erroring. Shutting down server.
[Error - 6:02:18 PM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
at _.shutdown (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:96701)
at _.stop (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:96282)
at _.stop (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:258296)
at _.handleConnectionError (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:102789)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

2023-08-17_18-06

@mhanberg
Copy link
Contributor

what happens if you run ~/.cache/elixir-tools/nextls/bin/nextls --port 9000 ? does it print out "Starting on port 9000" ?

@mhanberg
Copy link
Contributor

Also, try turning Nextls > Trace: Server to "verbose" and see what that prints out

@nrzull
Copy link
Author

nrzull commented Aug 18, 2023

what happens if you run ~/.cache/elixir-tools/nextls/bin/nextls --port 9000 ? does it print out "Starting on port 9000" ?

~/.cache/elixir-tools/nextls/bin/nextls --port 9000

05:21:45.792 [notice] Protocol 'inet_tcp': register/listen error: econnrefused

Starting on port 9000

@nrzull
Copy link
Author

nrzull commented Aug 18, 2023

Also, try turning Nextls > Trace: Server to "verbose" and see what that prints out

[Trace - 5:22:12 AM] Sending request 'initialize - (0)'.
Params: {
    "processId": 124627,
    "clientInfo": {
        "name": "Visual Studio Code",
        "version": "1.81.1"
    },
    "locale": "en",
    "rootPath": "/home/user/project",
    "rootUri": "file:///home/user/project",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional",
                "normalizesLineEndings": true,
                "changeAnnotationSupport": {
                    "groupsOnLabel": true
                }
            },
            "configuration": true,
            "didChangeWatchedFiles": {
                "dynamicRegistration": true,
                "relativePatternSupport": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "resolveSupport": {
                    "properties": [
                        "location.range"
                    ]
                }
            },
            "codeLens": {
                "refreshSupport": true
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "workspaceFolders": true,
            "semanticTokens": {
                "refreshSupport": true
            },
            "fileOperations": {
                "dynamicRegistration": true,
                "didCreate": true,
                "didRename": true,
                "didDelete": true,
                "willCreate": true,
                "willRename": true,
                "willDelete": true
            },
            "inlineValue": {
                "refreshSupport": true
            },
            "inlayHint": {
                "refreshSupport": true
            },
            "diagnostics": {
                "refreshSupport": true
            }
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                },
                "codeDescriptionSupport": true,
                "dataSupport": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true,
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    },
                    "insertReplaceSupport": true,
                    "resolveSupport": {
                        "properties": [
                            "documentation",
                            "detail",
                            "additionalTextEdits"
                        ]
                    },
                    "insertTextModeSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    },
                    "labelDetailsSupport": true
                },
                "insertTextMode": 2,
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                },
                "completionList": {
                    "itemDefaults": [
                        "commitCharacters",
                        "editRange",
                        "insertTextFormat",
                        "insertTextMode"
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    },
                    "activeParameterSupport": true
                },
                "contextSupport": true
            },
            "definition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "labelSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": true,
                "disabledSupport": true,
                "dataSupport": true,
                "resolveSupport": {
                    "properties": [
                        "edit"
                    ]
                },
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                },
                "honorsChangeAnnotations": false
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true,
                "prepareSupportDefaultBehavior": 1,
                "honorsChangeAnnotations": true
            },
            "documentLink": {
                "dynamicRegistration": true,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "implementation": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true,
                "foldingRangeKind": {
                    "valueSet": [
                        "comment",
                        "imports",
                        "region"
                    ]
                },
                "foldingRange": {
                    "collapsedText": false
                }
            },
            "declaration": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            },
            "callHierarchy": {
                "dynamicRegistration": true
            },
            "semanticTokens": {
                "dynamicRegistration": true,
                "tokenTypes": [
                    "namespace",
                    "type",
                    "class",
                    "enum",
                    "interface",
                    "struct",
                    "typeParameter",
                    "parameter",
                    "variable",
                    "property",
                    "enumMember",
                    "event",
                    "function",
                    "method",
                    "macro",
                    "keyword",
                    "modifier",
                    "comment",
                    "string",
                    "number",
                    "regexp",
                    "operator",
                    "decorator"
                ],
                "tokenModifiers": [
                    "declaration",
                    "definition",
                    "readonly",
                    "static",
                    "deprecated",
                    "abstract",
                    "async",
                    "modification",
                    "documentation",
                    "defaultLibrary"
                ],
                "formats": [
                    "relative"
                ],
                "requests": {
                    "range": true,
                    "full": {
                        "delta": true
                    }
                },
                "multilineTokenSupport": false,
                "overlappingTokenSupport": false,
                "serverCancelSupport": true,
                "augmentsSyntaxTokens": true
            },
            "linkedEditingRange": {
                "dynamicRegistration": true
            },
            "typeHierarchy": {
                "dynamicRegistration": true
            },
            "inlineValue": {
                "dynamicRegistration": true
            },
            "inlayHint": {
                "dynamicRegistration": true,
                "resolveSupport": {
                    "properties": [
                        "tooltip",
                        "textEdits",
                        "label.tooltip",
                        "label.location",
                        "label.command"
                    ]
                }
            },
            "diagnostic": {
                "dynamicRegistration": true,
                "relatedDocumentSupport": false
            }
        },
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": true
                }
            },
            "showDocument": {
                "support": true
            },
            "workDoneProgress": true
        },
        "general": {
            "staleRequestSupport": {
                "cancel": true,
                "retryOnContentModified": [
                    "textDocument/semanticTokens/full",
                    "textDocument/semanticTokens/range",
                    "textDocument/semanticTokens/full/delta"
                ]
            },
            "regularExpressions": {
                "engine": "ECMAScript",
                "version": "ES2020"
            },
            "markdown": {
                "parser": "marked",
                "version": "1.1.0"
            },
            "positionEncodings": [
                "utf-16"
            ]
        },
        "notebookDocument": {
            "synchronization": {
                "dynamicRegistration": true,
                "executionSummarySupport": true
            }
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///home/user/project",
            "name": "project"
        }
    ]
}


[Error - 5:22:12 AM] Client NextLS: connection to server is erroring. Shutting down server.
[Error - 5:22:12 AM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
	at _.shutdown (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:96701)
	at _.stop (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:96282)
	at _.stop (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:258296)
	at _.handleConnectionError (/home/user/.vscode/extensions/elixir-tools.elixir-tools-0.6.0/dist/extension.js:2:102789)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

@mhanberg
Copy link
Contributor

Can you ensure that epmd is running by running epmd -daemon in the terminal? then trying again? I think that is what that error Protocol 'inet_tcp': register/listen error: econnrefused is indicating.

@nrzull
Copy link
Author

nrzull commented Aug 18, 2023

@mhanberg I guess problem is solved. There is no error during start of NextLS client anymore after running epmd -daemon

@nrzull nrzull closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants