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

Langserver fails to connect on windows with docker #33

Open
attilaersek opened this issue Oct 30, 2018 · 8 comments
Open

Langserver fails to connect on windows with docker #33

attilaersek opened this issue Oct 30, 2018 · 8 comments

Comments

@attilaersek
Copy link

Hi!
I tried to setup a development environment on Windows and running hhvm and hh_client in docker (Linux), unfortunately without luck.
Has anyone succeeded with similar setup? The diag log here is not really helpful as the lang server gracefully disconnects and after 3 tries the extension gives up.

@PranayAgarwal
Copy link
Member

Hi @retk, could you post versions of everything you are using in this setup? I'll try and get a repro.

@attilaersek
Copy link
Author

hi @PranayAgarwal, sry for the late answer! here are the details:

code --version
1.28.2
7f3ce96ff4729c91352ae6def877e59c561f4850
x64

docker --version
Docker version 18.06.1-ce, build e68fc7a

Hack extension version is: 1.0.1

hhvm running in docker:

docker run -d -t --name my-hhvm -v c:/sources/hack-proof:/mnt/project hhvm/hhvm:latest
docker exec -t my-hhvm hhvm --version
HipHop VM 3.29.1 (rel)
Compiler: 1540927204_429022038
Repo schema: 35c5e7214afd06767bbd9fd42039b2f7f5ee7c9d

workspace settings

{
    "hack.clientPath": "docker exec -i my-hhvm hh_client",
    "hack.workspaceRootPath": "/mnt/project",
    "hack.trace.server": "verbose",
    "hack.useHhast": false
}

extension output:

[Trace - 5:09:55 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 23240,
    "rootPath": "c:\\sources\\hack-proof",
    "rootUri": "file:///mnt/project",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": 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
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": 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
                },
                "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
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ]
                }
            },
            "definition": {
                "dynamicRegistration": 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
            },
            "codeAction": {
                "dynamicRegistration": true,
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true
            },
            "documentLink": {
                "dynamicRegistration": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            }
        }
    },
    "initializationOptions": {
        "useTextEditAutocomplete": true
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///mnt/project",
            "name": "hack-proof"
        }
    ]
}


[Trace - 5:09:56 PM] Received notification 'telemetry/event'.
Params: {
    "type": 1,
    "message": "End_of_file, from_client\nRaised at file \"string.ml\", line 118, characters 19-34\nCalled from file \"sexp.ml\", line 112, characters 13-47\n---\nRaised at file \"client/clientLsp.ml\", line 397, characters 32-79\nCalled from file \"client/clientLsp.ml\", line 2353, characters 18-46\n"
}


[Info  - 5:09:56 PM] Connection to server got closed. Server will restart.

@PranayAgarwal
Copy link
Member

@retk I tried to repro this, but was actually able to get the language server started successfully with errors, intellisense and other features mostly working. There was a small problem with path translations (windows to linux) which I will fix, but other than that I didn't see the benavior you mentioned.

Could you try to run docker exec -it my-hhvm /bin/bash, navigate to your application path and run hh_client and see the output?

@attilaersek
Copy link
Author

could be an issue on my end, but currently have no idea where to look.
the output:

root@b193ca487f6f:/mnt/project# hh_client
For more detailed logs, try `tail -f $(hh_client --monitor-logname) $(hh_client --logname)`
Server launched with the following command:
        '/usr/bin/hh_server' '-d' '/mnt/project' '--waiting-client' '5'
Spawned typechecker (child pid=70)
Logs will go to /tmp/hh_server/monitor_logs/zSmntzSproject-2018-11-16-21-09-12.monitor_log
No errors!

@attilaersek
Copy link
Author

Can you share your setup? Versions and relevant settings. I also noticed noticed that if I change a file outside in Windows hh_server must be restarted within the container to detect the change. But afaik it is a known limitation of docker on windows.

@PranayAgarwal
Copy link
Member

PranayAgarwal commented Nov 16, 2018

Basically the same as yours. Win 10, latest Docker, hhvm/hhvm:3.29.1 image, same docker commands. I tested with the https://github.com/hhvm/hhast repository, which may have made the difference.

@attilaersek
Copy link
Author

I'll try it out soon and get back to you. If it is source related at least I have an idea where to start debugging.
What was that small path translation issue is about?
Thanks for your help!

@zoltanka
Copy link

zoltanka commented Apr 26, 2019

I just wrote about this into the PR (#44).
Can it be, that maybe the problem is with the docker container itself?
Did anybody else try it with - either other docker container or - a manually installed VM?

Update:
I just tried it with a VM. I installed a Ubuntu, and an HHVM, openned ssh to it. Shared the necessary folders, so now it's in sync. But the SSH probably doesn't even try to connect to it. Is there any possibility to open some debug panel or something?

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