PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.69k stars 481 forks source link

v1.8.0: Permissions to the pipe file were not set properly cannot start #1421

Closed fcharlie closed 6 years ago

fcharlie commented 6 years ago

System Details

Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v

1.25.0
0f080e5267e829de46638128001aeb7ca2d6d50e
x64

$pseditor.EditorServicesVersion
**NOT START**

code --list-extensions --show-versions

Ionide.Ionide-FAKE@1.2.3
akamud.vscode-theme-onedark@2.1.0
akamud.vscode-theme-onelight@2.1.0
arcticicestudio.nord-visual-studio-code@0.6.0
bbenoist.Doxygen@1.0.0
be5invis.toml@0.0.3
be5invis.vscode-icontheme-nomo-dark@1.3.5
cduruk.thrift@0.0.1
cssho.vscode-svgviewer@1.4.4
file-icons.file-icons@1.0.12
foxundermoon.shell-format@1.1.3
jtlowe.vscode-icon-theme@1.6.2
kalitaalexey.vscode-rust@0.4.2
ms-python.python@2018.6.0
ms-vscode.Theme-MarkdownKit@0.1.4
ms-vscode.Theme-MaterialKit@0.1.4
ms-vscode.Theme-TomorrowKit@0.1.4
ms-vscode.azure-account@0.4.1
ms-vscode.cpptools@0.17.6
ms-vscode.csharp@1.15.2
ms-vscode.Go@0.6.84
ms-vscode.mono-debug@0.15.8
ms-vscode.PowerShell@1.8.0
timonwong.shellcheck@0.5.1
twxs.cmake@0.0.17
vector-of-bool.cmake-tools@1.0.1

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.3
PSEdition                      Core
GitCommitId                    v6.1.0-preview.3
OS                             Linux 4.15.0-24-generic #26-Ubuntu SMP Wed Jun 13 08:44:47 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

I am experiencing a problem with...

Attached Logs

Follow the instructions in the README about capturing and sending logs.

Permissions to the pipe file were not set properly. Expected: 600 Actual: srw------- forfile: /tmp/CoreFxPipe_PSES_5528b497-d670-4c6d-8aa3-252f2210aaae
>file /tmp/CoreFxPipe_PSES_5528b497-d670-4c6d-8aa3-252f2210aaae
/tmp/CoreFxPipe_PSES_5528b497-d670-4c6d-8aa3-252f2210aaae socket

>ls -l /tmp/CoreFxPipe_PSES_5528b497-d670-4c6d-8aa3-252f2210aaae
srw-------

./modules/PowerShellEditorServices/Start-EditorServices.ps1:233:

function Set-NamedPipeMode {
    param(
        [Parameter(Mandatory=$true)]
        [ValidateNotNullOrEmpty()]
        [string]
        $PipeFile
    )
    chmod $DEFAULT_USER_MODE $PipeFile
    if ($IsLinux) {
        $mode = stat -c "%A" $PipeFile
    }
    else {
        $mode = stat -f "%A" $PipeFile
    }
    if ($mode -ne $DEFAULT_USER_MODE) {
        ExitWithError "Permissions to the pipe file were not set properly. Expected: $DEFAULT_USER_MODE Actual: $mode for file: $PipeFile"
    }
}

command stat format error:

function Set-NamedPipeMode {
    param(
        [Parameter(Mandatory=$true)]
        [ValidateNotNullOrEmpty()]
        [string]
        $PipeFile
    )
    chmod $DEFAULT_USER_MODE $PipeFile
    if ($IsLinux) {
        $mode = stat -c "%a" $PipeFile
    }
    else {
        $mode = stat -f "%A" $PipeFile
    }
    if ($mode -ne $DEFAULT_USER_MODE) {
        ExitWithError "Permissions to the pipe file were not set properly. Expected: $DEFAULT_USER_MODE Actual: $mode for file: $PipeFile"
    }
}

https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/PowerShellEditorServices/Start-EditorServices.ps1#L227

Rollback to 1.7 start ext success.

rjmholt commented 6 years ago

I've opened a PR to fix this: https://github.com/PowerShell/PowerShellEditorServices/pull/698

rjmholt commented 6 years ago

@fcharlie Can you update your extension version to 1.8.1 and see if this is fixed?

fcharlie commented 6 years ago

@rjmholt 1.8.1 is running