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

DSC fails to start on MacOS 15 (Sequoia) #653

Open
VeraPochobut opened this issue Jan 15, 2025 · 1 comment
Open

DSC fails to start on MacOS 15 (Sequoia) #653

VeraPochobut opened this issue Jan 15, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@VeraPochobut
Copy link

Brige-to-Kubernetes dsc cli fails to start on MacOS 15 (Sequoia) because of compatibility issue affecting .NET prior to 8.0.10, see dotnet/announcements#324 for details.

Error message is:

./dsc check-credentials --namespace default                                                                                                                                                                        The specified item is no longer valid. It may have been deleted from the keychain.

Stack trace:

An exception of type 'Interop.AppleCrypto.AppleCommonCryptoCryptographicException' occurred in System.Security.Cryptography.dll but was not handled in user code: 'The specified item is no longer valid. It may have been deleted from the keychain.'
   at Interop.AppleCrypto.X509CopyWithPrivateKey(SafeSecCertificateHandle certHandle, SafeSecKeyRefHandle privateKeyHandle, SafeKeychainHandle targetKeychain)
   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(SafeSecKeyRefHandle privateKey)
   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(RSA privateKey)
   at System.Security.Cryptography.X509Certificates.RSACertificateExtensions.CopyWithPrivateKey(X509Certificate2 certificate, RSA privateKey)
   at System.Security.Cryptography.X509Certificates.X509Certificate2.ExtractKeyFromPem[TAlg](ReadOnlySpan`1 keyPem, String[] labels, Func`1 factory, Func`2 import)
   at System.Security.Cryptography.X509Certificates.X509Certificate2.CreateFromPem(ReadOnlySpan`1 certPem, ReadOnlySpan`1 keyPem)
   at k8s.CertUtils.GeneratePfx(KubernetesClientConfiguration config)
   at k8s.CertUtils.GetClientCert(KubernetesClientConfiguration config)
   at k8s.Kubernetes.InitializeFromConfig(KubernetesClientConfiguration config)
   at k8s.Kubernetes..ctor(KubernetesClientConfiguration config, DelegatingHandler[] handlers)
   at Microsoft.BridgeToKubernetes.Common.Kubernetes.K8sClientFactory.CreateFromKubeConfig(K8SConfiguration kubeConfig) in /Users/verapocobut/Projects/Bridge-To-Kubernetes/src/common/Kubernetes/K8sClientFactory.cs:line 119
   at Microsoft.BridgeToKubernetes.Common.Kubernetes.KubernetesClient.<>c__DisplayClass12_0.<.ctor>b__0() in /Users/verapocobut/Projects/Bridge-To-Kubernetes/src/common/Kubernetes/KubernetesClient.cs:line 81
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)

Same error is displayed when starting via VS Code Bridge to Kubernetes plugin.

Workaround is to re-target to .net 8.0 instead and set custom binaries path for VS Code plugin:

export BRIDGE_BUILD_PATH="/Users/....../Bridge-To-Kubernetes/src/dsc/bin/Debug/net8.0/"
export DOTNET_ROOT=/usr/local/share/dotnet
code
@VeraPochobut VeraPochobut added the bug Something isn't working label Jan 15, 2025
@garyburgmann
Copy link
Contributor

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