Repository navigation
New-PSSession now fails with a NullReferenceException and core dump #942
Copy link
Copy link
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-RemotingPSRP issues with any transport layerPSRP issues with any transport layer
Milestone
Description
Note from Andy Jordan (@andschwa) (hijacking for visibility):
As this is the oldest issue, I'm going to keep it and close all others. New-PSSession (whether its loopback on the local machine or not) is PSRP (as is Enter-PSSession and Invoke-Command etc.), which is in progress but not yet supported. Please follow the progress on the PSRP on Linux repo. We (mostly Paul Allen (@paulcallen) and George Fleming (@palladia)) are working hard to get this ready, and clearly hear how much you all want it! Please be patient while we finish the implementation.
Original issue:
Before submitting this issue, please first:
- Search the existing issues.
- Refer to the FAQ.
- Refer to the known issues.
- If it is a bug, fill out this form:
Steps to reproduce
new-pssession
Expected behavior
graceful failure
Actual behavior
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at System.Management.Automation.Remoting.PrioritySendDataCollection.Clear()
at System.Management.Automation.Remoting.Client.BaseClientTransportManager.CloseAsync()
at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager.CloseAsync()
at System.Management.Automation.Remoting.Client.BaseClientTransportManager.Finalize()
Aborted (core dumped)
Environment data
Linux jimtru-ops2 4.2.0-35-generic #40~14.04.1-Ubuntu SMP Fri Mar 18 16:37:35 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Please fill in the results of the following commands:
$ dotnet --info
.NET Command Line Tools (1.0.0-rc2-002543)
Product Information:
Version: 1.0.0-rc2-002543
Commit Sha: 38d0c28a1e
Runtime Environment:
OS Name: ubuntu
OS Version: 14.04
OS Platform: Linux
RID: ubuntu.14.04-x64
$ git rev-parse HEAD && git status
PS> git rev-parse HEAD;git status
aa9547930792e5d536f17002a69346cc6c9a0612
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
dotnet-host-ubuntu-x64.latest.deb
dotnet-sdk-ubuntu-x64.latest.deb
dotnet-sharedframework-ubuntu-x64.latest.deb
newitem.tests.ps1
nothing added to commit but untracked files present (use "git add" to track)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-RemotingPSRP issues with any transport layerPSRP issues with any transport layer
Activity
andyleejordan commentedon May 4, 2016
I have good news and bad news. In #939, the ConsoleHost at least doesn't fail immediately. It first bails with:
For the Linux configuration, it's looking for the remoting library, which on Linux, is Paul Allen (@paulcallen)'s PSRP provider. Once I provide it:
Since
WSManInitializeis unimplemented. A (@ealexjordan) and Paul Allen (@paulcallen), is this something you plan to implement?andyleejordan commentedon May 4, 2016
And on Windows:
I suspect this is just a configuration issue for me.
andyleejordan commentedon May 4, 2016
We also don't quite support this:
And even though I successfully ran it in an administrative session and restarted my ConsoleHost, I still couldn't run it.
JamesWTruher commentedon May 4, 2016
The last one makes sense - it's essentially a registry editor and sets a bunch of WSMan state (although it should work just fine on windows)
JamesWTruher commentedon May 4, 2016
as for the error
New-PSSession : [localhost] Connecting to remote server localhost failedtake a look at $error[0].Exception (and the rest) - the exception from the remote context should also be available to you, as well as a call stackitadder commentedon Aug 19, 2016
Just typed New-PSSession
Then I got this.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at System.Management.Automation.Remoting.PrioritySendDataCollection.Clear()
at System.Management.Automation.Remoting.Client.BaseClientTransportManager.CloseAsync()
at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager.CloseAsync()
at System.Management.Automation.Remoting.Client.BaseClientTransportManager.Finalize()
Abort trap: 6
Environment
Darwin MacBook-Pro.posh.net 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
27 remaining items
paulcallen commentedon Feb 1, 2017
We will be dropping new nuget packages to powershell in a week or two that will make the client more stable. It will also enable initial work for getting Linux/OSX powershell connection to exchange/office365. At the same time new documents for NTLM will be posted. You can look at the documents referred to by Bruce Campbell (@yakman2020). If there is something specific we can certainly help you.
ElFerminador commentedon Feb 1, 2017
Excellent news about being able to access Office 365 from Mac OS! On another subject, how will updating PowerShell on the Mac work? I've recently switched from Windows, still a bit new to git. Thanks for any advice!
JamesWTruher commentedon Feb 1, 2017
I have a little more data to add - I have updated my base PowerShell to version .15 and I'm now not seeing the issue with that version. However, I just built and ran, with the following strangeness:
I don't know whether this helps you at all, but I thought I would let you know.
paulcallen commentedon Feb 1, 2017
James Truher (@JamesWTruher) I just installed .15 on my Ubuntu 16.04 machine and things worked just fine. What platform are you on?
paulcallen commentedon Feb 1, 2017
ElFerminador mac osx installation details are here. I believe it deletes the old directory and installs a new one. That is what happens on Ubuntu 16.04 at least.
paulcallen commentedon Mar 9, 2017
I am closing this thread as the primary issue should now be fixed, along with some of the sub issues that have shown up on this thread. The office 365 fixes should be in the alpha.17 build when it comes out.
vinodc commentedon Mar 10, 2017
Paul Allen (@paulcallen) I've confirmed connectivity to Office 365 via PowerShell from Ubuntu 14.04 works great!! Thank you and Bruce Campbell (@yakman2020) very much for your hard work the past two months to make this happen. Really appreciate it.
andyleejordan commentedon Mar 10, 2017
This is awesome!
paulcallen commentedon Mar 10, 2017
Vinod Chandru (@vinodc) Glad it is working for you.
Also wanted to mention George Fleming (@palladia) as well. Both Bruce Campbell (@yakman2020) and George Fleming (@palladia) have been instrumental to our OMI/PSRP work on Linux.
yakman2020 commentedon Mar 13, 2017
Thanks. It really means a lot to hear.
Now on to the next thing, already in progress.
rodel0723 commentedon Aug 21, 2017
Paul Allen (@paulcallen) as you have mentioned to Vinod Chandru (@vinodc) here that proxy setting/authentication is not yet supported, is this still true on below version?
PSVersion 6.0.0-beta
PSEdition Core
GitCommitId v6.0.0-beta.5
OS Linux 3.10.0-693.el7.x86_64 #1 SMP Thu Jul 6 19:56:57 EDT 2017
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
if yes, are there any workaround to use powershell behind proxy on linux for New-PSSession cmdlet?
thank you in advance.
paulcallen commentedon Aug 21, 2017
OMI client does not support proxy settings, and does not respond to proxy responses. Sorry.
If there are enough asks for it we could certainly consider it. If it were done, then the psrp client layer for Linux would need to be updated once completed.
Don't know how Microsoft does it inside their firewall, but our proxy servers have a component installed on the client machine that does the proxying automatically so we don't need support at the application level. I think it handles it at the socket layer.
rodel0723 commentedon Aug 22, 2017
Paul Allen (@paulcallen) Thank you for your reply. How about setting the http_proxy before running powershell, will it take too long to change the code? It will be really helpful for us working behind proxies if it will be implemented.
paulcallen commentedon Sep 11, 2017
I created an OMI issue to track adding proxy support for the omi client: omi issue 403