Skip to content

Permission denied when trying to read stdout of another program in Snap #14481

@bjbr-dev

Description

@bjbr-dev

Steps to reproduce

PS > $foo = docker -v

Expected behavior

I expect the variable $foo to contain the string Docker version 19.03.11, build dd360c7 since running docker -v like below returns that data

PS > docker -v
Docker version 19.03.11, build dd360c7

Actual behavior

It errors

write /dev/stdout: permission denied

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.0
PSEdition                      Core
GitCommitId                    7.1.0
OS                             Linux 5.8.0-33-generic #36-Ubuntu SMP Wed Dec 9…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


Ubuntu version: 20.10
Installed powershell with Snap

I originally raised this as a stackoverflow question -> https://stackoverflow.com/questions/65260463/how-to-capture-docker-version-in-powershell-cross-platform but I believe it is a bug.

The equivalent code works in bash

#> VERSION=$(docker -v)
#> echo $VERSION

I believe it also works on Ubuntu 20.04 when pwsh is installed with apt-get, but as fair as I can tell you can only install pwsh with snap on 20.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Maintainers-Buildspecific to affecting the build

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions