Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Connect-ExchangeOnline from AWS PowerShell lambda throws PSRemotingTransportException #849

Closed
geekganesh opened this issue Apr 8, 2021 · 3 comments
Labels
guidance Question that needs advice or information. module/lambda-client-lib p2 This is a standard priority issue queued

Comments

@geekganesh
Copy link

I am trying to connect to exchange from AWS Powershell Lambda function. The script is working fine locally but throws below error when executed from AWS.

{
  "errorType": "PSRemotingTransportException",
  "errorMessage": "This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.",
  "stackTrace": [
    "at Amazon.Lambda.PowerShellHost.PowerShellFunctionHost.ExecuteFunction(Stream inputStream, ILambdaContext context)",
    "at lambda_method(Closure , Stream , Stream , LambdaContextInternal )"
  ],
  "cause": {
    "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 System.Management.Automation.Remoting.Client.WSManNativeApi.WSManInitialize(Int32 flags, IntPtr& wsManAPIHandle)",
      "at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager.WSManAPIDataCommon..ctor()"
    ]
  }
}
@geekganesh geekganesh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 8, 2021
@ashishdhingra ashishdhingra added module/lambda-client-lib and removed needs-triage This issue or PR still needs to be triaged. labels Apr 8, 2021
@ashishdhingra
Copy link
Contributor

Hi @geekganesh,

Good morning.

Please refer the existing issues aws/aws-tools-for-powershell#203 and #332 for details about this error and possible resolution. This error is related to OpenSSL library. Let me know if these help.

Thanks,
Ashish

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to close soon in 7 days. label Apr 8, 2021
@geekganesh
Copy link
Author

geekganesh commented Apr 12, 2021

Hi @ashishdhingra

I have created a AWS openssl layer to the lambda function. openssl support is available to lambda but i am getting the same error. Do i need to have my own container?

Regards
Ganesh

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to close soon in 7 days. label Apr 13, 2021
@nickadam
Copy link

nickadam commented Feb 4, 2022

PSWSMan rewrites shared object files when running Install-WSMan. I have not been able to get it to work with a zip. Since it takes ~1 min to connect to exchange online, I've decided to build a container image, https://github.com/nickadam/powershell-lambda, https://github.com/nickadam/exo-lambda. It's slow but it works.

@ashishdhingra ashishdhingra added p2 This is a standard priority issue and removed A labels Nov 1, 2022
@normj normj added guidance Question that needs advice or information. and removed bug This issue is a bug. labels Sep 9, 2024
@aws aws locked and limited conversation to collaborators Sep 18, 2024
@ashishdhingra ashishdhingra converted this issue into discussion #1811 Sep 18, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
guidance Question that needs advice or information. module/lambda-client-lib p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

5 participants