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

[BUG] No keychain is available #102

Open
MonsieurTib opened this issue Aug 10, 2020 · 8 comments
Open

[BUG] No keychain is available #102

MonsieurTib opened this issue Aug 10, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@MonsieurTib
Copy link

Describe the bug
Export-ACMECertificate function is getting me the following error on MACOS "No keychain is available. You may need to restart your computer."
The same script works fine in a runbook on azure.

@MonsieurTib MonsieurTib added the bug Something isn't working label Aug 10, 2020
@glatzert
Copy link
Collaborator

OT: Now I need to find a MAC, to reproduce..

Is there more in the error message?
Like a callstack to point out which function exactly fails.

You might get one with $error[0] after it happened.

Do you have further system information? $PSVersionTable, ModuleVersion, etc?

@MonsieurTib
Copy link
Author

MonsieurTib commented Aug 11, 2020

more info in the error message :
Line |
77 | Export-ACMECertificate -State $AcmeTempDir -Order $order -Certificate …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "Export" with "2" argument(s): "No keychain is available. You may need to restart your computer."

$PSVersionTable output : 

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Darwin 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul  5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module version : latest

@glatzert
Copy link
Collaborator

Thee More questions:

  1. Can you please post the complete call to Export-ACMECertificate?
  2. Do you set a password?
  3. Could you try to get the CallStack? It might be in $error[0].Exception.CallStack or $error[0].CallStack

I might have an idea, what's the issue ...

@MonsieurTib
Copy link
Author

  1. Export-ACMECertificate -State $AcmeTempDir -Order $order -CertificateKey $certKey -Path $CertificateExportPath -Password $password
  2. i try both, with and without password

try {
Export-ACMECertificate -State $AcmeTempDir -Order $order -CertificateKey $certKey -Path $CertificateExportPath -Password $password
}
catch {
Write-Output $error[0].Exception.CallStack
Write-Output $error[0].CallStack
Write-Output $_.ScriptStackTrace
}

at ExportPfxChain, /Users/xxx/.local/share/powershell/Modules/ACME-PS/1.3.1/ACME-PS.psm1: line 113
at ExportPfxChain, /Users/xxx/.local/share/powershell/Modules/ACME-PS/1.3.1/ACME-PS.psm1: line 258
at Export-Certificate, /Users/xxx/.local/share/powershell/Modules/ACME-PS/1.3.1/ACME-PS.psm1: line 2313

hope this help

@glatzert
Copy link
Collaborator

One last question:
Does Export-ACMECertificate with -ExcludeChain work, by any chance?

@MonsieurTib
Copy link
Author

Nice one, it works with -ExcludeChain

@glatzert
Copy link
Collaborator

Unforturnatley this will only be the end-certificate. You'll need openSSL or something else to create the certificate chain.
I'll open an issue with dotnet and ask, what might be going on there.. your error message seems to come from the OS.

@MonsieurTib
Copy link
Author

Ok, thank you for your time. Please let me know if a fix will be found. Meanwhile i can test my script on azure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants