Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote connect new-pssession fails - Unable to load shared library 'libpsrpclient' or one of its dependencies. #332

Closed
softwaresamuraisarathy opened this issue Oct 4, 2018 · 6 comments
Labels
bug This issue is a bug. closed-for-staleness module/sys-mgr-ext response-requested Waiting on additional info and feedback. Will move to close soon in 7 days.

Comments

@softwaresamuraisarathy
Copy link

Followed the steps given in the URL and deployed below Powershell Core script as a Lambda Function.

--------------------------------------- Script ---------------------------------

#Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}

$pw = convertto-securestring -AsPlainText -Force -String "Password"
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "UserID",$pw

$s = new-pssession -computername "AWSECS2DNS" -credential $cred

Invoke-Command -Session $s -ScriptBlock {Get-Service}


When trigger the Lambda function, It fails. This Powershell script tries to remote connect a Windows EC2 Instance and run Commandlet "Get-Service". It fails at the Commandlet "new-pssession". Same script runs fine in Windows Computer powershell.

--------------------------------------- Error -----------------------------------------------

{
"errorType": "DllNotFoundException",
"errorMessage": "Unable to load shared library 'libpsrpclient' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibpsrpclient: cannot open shared object file: No such file or directory",
"stackTrace": [
"at Amazon.Lambda.PowerShellHost.PowerShellFunctionHost.ExecuteFunction(Stream inputStream, ILambdaContext context)",
"at lambda_method(Closure , Stream , Stream , LambdaContextInternal )"
]
}

@knabb
Copy link

knabb commented Oct 29, 2018

I have noticed the same problem when attempting to deploy a powershell lambda function. Executes locally correctly, but fails in lambda with the above error.

@JustinGrote
Copy link

JustinGrote commented Dec 27, 2018

Same here, I notice the Get-PSSesssionOption is also missing. I'm thinking the Publish-AWSPowershellLambda is not capturing all the DLLs for PSCore into the zip.

@JustinGrote
Copy link

This may also be relevant, they changed libpsrpclient to psrp, maybe something in the code didn't get the memo:
PowerShell/PowerShell#3477

@ashishdhingra ashishdhingra added bug This issue is a bug. module/sys-mgr-ext needs-triage This issue or PR still needs to be triaged. labels Aug 12, 2020
@ashishdhingra
Copy link
Contributor

Hi @softwaresamuraisarathy,

Good afternoon.

I was going through backlog and came across this issue. Please refer the forum article https://forums.aws.amazon.com/thread.jspa?messageID=918094 for possible solution. Kindly note that Lambda works on minimal RHEL image. Let me know if it works for you.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to close soon in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 16, 2020
@github-actions
Copy link
Contributor

This issue has not recieved a response in 2 weeks. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Oct 31, 2020
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 7, 2020
@github-actions github-actions bot closed this as completed Nov 7, 2020
@andybirenzi
Copy link

The solutions suggested in the AWS forums doesn't work for me. I'm on MacOS and can't seem to find following dependecies :
The missing deps are:
libcrypto.so.1.0.0
libssl.so.1.0.0

I copied them from /opt/microsoft/powershell/6/ to ~/.nuget/packages/microsoft.powershell.native/6.1.0/runtimes/linux-x64/native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness module/sys-mgr-ext response-requested Waiting on additional info and feedback. Will move to close soon in 7 days.
Projects
None yet
Development

No branches or pull requests

5 participants