Skip to content

Snap and MSIX install of pwsh on Ubuntu does not support Update-Help #7452

Description

Steps to reproduce

Install powershell-preview on Ubuntu 18.04 using snap i.e.
# snap install powershell-preview --classic

From pwsh-preview console enter the following command>

PS /home/donhunt> Update-Help -Force

Expected behavior

PowerShell Modules that have updatable help should refresh to latest content

Actual behavior

Update-Help : Read-only file system
At line:1 char:1
+ Update-Help -Force
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Update-Help], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.UpdateHelpCommand

Environment data

PS /home/donhunt> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.4
PSEdition                      Core
GitCommitId                    6.1.0-preview.4
OS                             Linux 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

donhunt@ubuntu:~$ snap list powershell-preview
Name                Version          Rev  Tracking  Publisher             Notes
powershell-preview  6.1.0-preview.4  6    stable    microsoft-powershell  classic

donhunt@ubuntu:/etc$ cat os-release 
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Activity

  1. iSazonov commented on Aug 6, 2018

    @iSazonov
    Collaborator

    /cc Travis Plunk (@TravisEz13) Could you please comment the Issue?

  2. TravisEz13 commented on Aug 6, 2018

    @TravisEz13
    Member

    Aditya Patwardhan (@adityapatwardhan) I thought we changed the default target to be the user?

  3. TravisEz13 commented on Aug 6, 2018

    @TravisEz13
    Member

    I verified update-help -Scope CurrentUser fails as well with the same error

  4. megamorf commented on Nov 17, 2018

    @megamorf
    Contributor

    Any updates on this?

    PS /home/megamorf> $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      6.2.0-preview.2
    PSEdition                      Core
    GitCommitId                    6.2.0-preview.2
    OS                             Linux 4.18.16-96.current #1 SMP PREEMPT Sun Oct 21 15:23:25 UTC 2018
    Platform                       Unix
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
    PS /home/megamorf> Update-Help -Force -Verbose -Scope CurrentUser
    Update-Help : Read-only file system
    At line:1 char:1
    + Update-Help -Force -Verbose -Scope CurrentUser
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Update-Help], IOException
    + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.UpdateHelpCommand
    
  5. MaximoTrinidad commented on Nov 17, 2018

    @MaximoTrinidad

    Travis Plunk (@TravisEz13) & Sebastian N. (@megamorf)

    Hum! I've been using just:

    Update-Help -force
    

    Without the "-Scope CurrentUser" parameter and is working fine on non-admin session.
    Maybe the "-Scope" is not a mandatory parameter.

    :)

    Never mind!! Only in Windows works OK.

    In Ubuntu 18.04, I'm getting the same error too!

    maxt@mars:~$ pwsh-preview
    PowerShell 6.2.0-preview.2
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    https://aka.ms/pscore6-docs
    Type 'help' to get help.
    
    PS /home/maxt> Update-Help -force
    Update-Help : Read-only file system
    At line:1 char:1
    + Update-Help -force
    + ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Update-Help], IOException
    + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.UpdateHelpCommand
     
    PS /home/maxt> 
    
  6. MaximoTrinidad commented on Nov 17, 2018

    @MaximoTrinidad

    BTW

    You can't even use "sudo" to execute "Update-Help".
    This is a bug!

    :)
    ubuntu_updatehelp_2018-11-17_7-53-07

  7. TravisEz13 commented on Nov 19, 2018

    @TravisEz13
    Member

    Here is the stack trace:

    PSMessageDetails      :
    Exception             : System.IO.IOException: Read-only file system
                               at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
                               at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
                               at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
                               at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
                               at System.Management.Automation.Configuration.PowerShellConfig.UpdateValueInFile[T](ConfigScope scope, String key, T value, Boolean addValue)
                               at System.Management.Automation.Configuration.PowerShellConfig.WriteValueToFile[T](ConfigScope scope, String key, T value)
                               at System.Management.Automation.Configuration.PowerShellConfig.SetDisablePromptToUpdateHelp(Boolean prompt)
                               at System.Management.Automation.Help.UpdatableHelpSystem.SetDisablePromptToUpdateHelp()
                               at Microsoft.PowerShell.Commands.UpdateHelpCommand.BeginProcessing()
                               at System.Management.Automation.Cmdlet.DoBeginProcessing()
                               at System.Management.Automation.CommandProcessorBase.DoBegin()
    TargetObject          :
    CategoryInfo          : NotSpecified: (:) [Update-Help], IOException
    FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.UpdateHelpCommand
    ErrorDetails          :
    InvocationInfo        : System.Management.Automation.InvocationInfo
    ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
    PipelineIterationInfo : {}
    

    The problem is SetDisablePromptToUpdateHelp it always writes to the systemwide setting which are read-only in snap.

  8. TylerLeonhardt commented on May 4, 2019

    @TylerLeonhardt
    Member

    This might be a good opportunity and excuse to move updatible help and profiles (which have the same problem) outside of pshome

  9. iSazonov commented on May 4, 2019

    @iSazonov
    Collaborator

    Snap allows to write to user home.
    Also I guess snap allows to make any directory writable (pshome too).

  10. SteveL-MSFT commented on May 4, 2019

    @SteveL-MSFT
    Member

    Please continue discussion in #9278

  11. TravisEz13 commented on Nov 5, 2019

    @TravisEz13
    Member

    The problem here is different than #9278. This cmdlet is writing the the WRONG scope even when the scope is specified. We need to fix this issue.

  12. changed the title [-]Snap install of pwsh on Ubuntu does not support Update-Help[/-] [+]Snap and MSIX install of pwsh on Ubuntu does not support Update-Help[/+] on Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Maintainers-Buildspecific to affecting the build

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions