Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unable to create PSSession into Windows container (possible regression of #13347?) #19337

Copy link
Copy link
@hemisphera

Description

@hemisphera
Issue body actions

Prerequisites

Steps to reproduce

There seems to be some sort of regression of #13347. I am unable to create a PSSession into a running windows container using PowerShell 7.3.3 or 7.4.0-preview1, whereas I am correctly able to do so with PowerShell 5.1.x

The command I execute is this:

New-PSSession -ContainerId <containerid> -RunAsAdministrator

New-PSSession: The input ContainerId <containerid> does not exist, or the corresponding container is not running.

This was a bug I encountered on an older version and I opened I issue and PR (13375) for (see above).
I checked the code and everything we did back then still seems to be in place, so maybe something else broke. The issue however is almost the same.

Expected behavior

A PSSessions should be created.

Actual behavior

The command fails with the message above.

Error details

Exception             :
    Type        : System.Management.Automation.PSInvalidOperationException
    ErrorRecord :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : The input ContainerId <id> does not exist, or the corresponding container is not running.
            HResult : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : InvalidOperation
    TargetSite  :
        Name          : CreateContainerProcess
        DeclaringType : System.Management.Automation.Runspaces.ContainerProcess, System.Management.Automation, Version=7.3.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
        MemberType    : Method
        Module        : System.Management.Automation.dll
    Message     : The input ContainerId <id> does not exist, or the corresponding container is not running.
    Source      : System.Management.Automation
    HResult     : -2146233079
    StackTrace  :
   at System.Management.Automation.Runspaces.ContainerProcess.CreateContainerProcess()
   at Microsoft.PowerShell.Commands.NewPSSessionCommand.CreateRunspacesWhenContainerParameterSpecified()
CategoryInfo          : InvalidOperation: (:) [New-PSSession], PSInvalidOperationException
FullyQualifiedErrorId : CreateRemoteRunspaceForContainerFailed,Microsoft.PowerShell.Commands.NewPSSessionCommand
InvocationInfo        :
    MyCommand        : New-PSSession
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 1
    Line             : New-PSSession -ContainerId <id> -RunAsAdministrator
    PositionMessage  : At line:1 char:1
                       + New-PSSession -ContainerId <id> -RunAsAdminis …
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : New-PSSession
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more

    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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.