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

Aspire 9 on macOS 15.1 won't launch due to "The JSON-RPC connection with the remote party was lost before the request could complete." #6701

Open
1 task done
JamesAlexander42 opened this issue Nov 17, 2024 · 21 comments
Assignees
Labels
area-tooling vs-code Issues related to vs code tooling for aspire
Milestone

Comments

@JamesAlexander42
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Similar to issue #5860 but new since updating to macOS 15.1, the 9.0 dotnet aspire templates and updating the solution to aspire 9. I should also note this happens immediately when using the new starter template. The error "The JSON-RPC connection with the remote party was lost before the request could complete." occurring on F5 in VS Code used to happen until the update to .net 8 or using .net 9 with aspire 8.

Interestingly enough, it doesn't happen to existing or new aspire 8 projects. If I create a new vanilla start aspire 9 project via dotnet new aspire-starter and then attempt to debug app host, I get the error on macOS 15.1.

Odder still is that I've only updated my Mac Studio to 15.1 but my MacBook Pro is on 15.0. The exact same aspire 9 repo/solution on 15.0 without issue.

Installed Workload Id Manifest Version Installation Source

aspire 8.2.2/8.0.100 SDK 9.0.100

C# Dev Kit v1.13.9

Expected Behavior

On F5 the AppHost and related projects will start successfully without an error of "The JSON-RPC connection with the remote party was lost before the request could complete."

Steps To Reproduce

  • macOS 15.1
  • updated aspire templates
  • dotnet 9.0.1
  • mkdir aspire-starter-test
  • cd aspire-starter-test
  • dotnet new aspire-starter
  • VS Code with C# DevKit v1.13.9
  • Right click on .AppHost project and select Debug -> Start New Instance

Exceptions (if any)

Running on macOS 15.0 appears to work fine

.NET Version info

.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.c6f19616
MSBuild version: 17.12.7+5b8665660

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.1
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.100/

.NET workloads installed:
[aspire]
Installation Source: SDK 9.0.100
Manifest Version: 8.2.2/8.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.aspire/8.2.2/WorkloadManifest.json
Install Type: FileBased

Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.0
Architecture: arm64
Commit: 9d5a6a9aa4

.NET SDKs installed:
7.0.304 [/usr/local/share/dotnet/sdk]
8.0.100 [/usr/local/share/dotnet/sdk]
8.0.101 [/usr/local/share/dotnet/sdk]
9.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Anything else?

No response

@davidfowl davidfowl added area-tooling vs-code Issues related to vs code tooling for aspire labels Nov 17, 2024
@JamesAlexander42
Copy link
Author

So interestingly enough, I realized that my Mac Studio is running an older version of .net core 8 (8.0.1). I updated just .net core 8 (even though I'm doing all .net core 9 stuff and using aspire 9) to .net 8.0.11 and the issue appears to be resolved. Odder still is on another MacBook, I only have .net 9 installed and also don't have the issue.

@joperezr
Copy link
Member

Thanks for the confirmation @JamesAlexander42, just to confirm, can you share the version of the 8.0 SDK (who brought that 8.0.11) so we can validate things are working as expected?

@joperezr joperezr added needs-author-action An issue or pull request that requires more info or actions from the author. and removed untriaged labels Nov 20, 2024
@quoctuancqt
Copy link

I’ve already faced this issue since I updated net 9 and aspire 9.

@JamesAlexander42
Copy link
Author

Thanks for the confirmation @JamesAlexander42, just to confirm, can you share the version of the 8.0 SDK (who brought that 8.0.11) so we can validate things are working as expected?

It looks like I actually updated from 8.0.1 runtime up to 8.0.10 and it started working. Again, even though I'm targeting .net 9 and aspire 9. Here's my current info:

.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.c6f19616
MSBuild version: 17.12.7+5b8665660

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.1
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.100/

.NET workloads installed:
[aspire]
Installation Source: SDK 9.0.100
Manifest Version: 8.2.2/8.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.aspire/8.2.2/WorkloadManifest.json
Install Type: FileBased

Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.0
Architecture: arm64
Commit: 9d5a6a9aa4

.NET SDKs installed:
6.0.100 [/usr/local/share/dotnet/sdk]
6.0.102 [/usr/local/share/dotnet/sdk]
6.0.401 [/usr/local/share/dotnet/sdk]
6.0.403 [/usr/local/share/dotnet/sdk]
6.0.405 [/usr/local/share/dotnet/sdk]
7.0.100 [/usr/local/share/dotnet/sdk]
7.0.200-preview.22628.1 [/usr/local/share/dotnet/sdk]
7.0.302 [/usr/local/share/dotnet/sdk]
8.0.100 [/usr/local/share/dotnet/sdk]
8.0.101 [/usr/local/share/dotnet/sdk]
8.0.401 [/usr/local/share/dotnet/sdk]
8.0.403 [/usr/local/share/dotnet/sdk]
9.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
x64 [/usr/local/share/dotnet/x64]

Environment variables:
Not set

global.json file:
Not found

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 22, 2024
@Ruben-J
Copy link

Ruben-J commented Dec 4, 2024

So interestingly enough, I realized that my Mac Studio is running an older version of .net core 8 (8.0.1). I updated just .net core 8 (even though I'm doing all .net core 9 stuff and using aspire 9) to .net 8.0.11 and the issue appears to be resolved. Odder still is on another MacBook, I only have .net 9 installed and also don't have the issue.

I can confirm this. My solution is .NET 9 and Aspire 9 and had sdk 8.0.300 and 9.0.100 installed. After I updated .NET 8 sdk to 8.0.404 it was solved.

@jjoergensen
Copy link

I also had .NET 9.0.101 installed and 8.0.100. Installing 8.0.404 also fixed my issue with Aspire Starter Kit on MacOS.

@maddymontaquila
Copy link
Member

Currently running only 9.0.100 (upgraded to 9.0.102) and removed all .NET 8 and this is repro'ing

@bradygaster
Copy link
Member

Closing as it seems this is the resolution:

I also had .NET 9.0.101 installed and 8.0.100. Installing 8.0.404 also fixed my issue with Aspire Starter Kit on MacOS.

@davidfowl
Copy link
Member

@bradygaster @maddymontaquila is still running into it.

@bradygaster
Copy link
Member

@LittleLittleCloud - @maddymontaquila has seen a few folks run into this during conference trips. She probably has some solid repro scenarios/machines that could aid in troubleshooting.

@LittleLittleCloud
Copy link

@maddymontaquila or @JamesAlexander42
Might be a servichub-related issue given the The JSON-RPC connection with the remote party was lost before the request could complete. log?

while I clear the dust and charging my macbook to bring it back alive, would you mind share the aspire log from C# devkit with us. You can find these logs using the following approach

  • Go to Developer: Open Extension Logs Folder. That brings you to extension log folder

Image

  • Go to ms-dotnettools.csdevkit folder under extension log folder
  • Upload Aspire.log and ServiceHub in a .zip file

Image

@maddymontaquila
Copy link
Member

ServiceHub.zip

weirdly... I don't have Aspire.log ?!?!

@LittleLittleCloud
Copy link

LittleLittleCloud commented Jan 31, 2025

@maddymontaquila probably because the aspire service fail to be created so you didn't see any aspire log.

I do find out something fishy from your log though,, there's an exception in Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The specified item is no longer valid. It may have been deleted from the keychain. HResult='-25304' when creating Aspire service,, I think that's why you see JSON-RPC connection lost from VSCode

{"jsonrpc":"2.0","method":"HostServicesStartedAsync","params":["dotnet.aspireServer$C94B8CFE-E3FD-4BAF-A941-2866DBB566FE"]}
01/31/2025 17:59:12 Greenwich Mean Time : Information : Creating service Microsoft.WebTools.AspireServer.ServiceFactory from factory with FactoryVersion=Version2 and ClientRequestedVersion=1.0.
01/31/2025 17:59:12 Greenwich Mean Time : Information : Setting up RPC connection for service 'Microsoft.WebTools.AspireServer.ServiceFactory' from factory
01/31/2025 17:59:12 Greenwich Mean Time : Error : Error creating Microsoft.WebTools.AspireServer.ServiceFactory instance of CLR service module 'Microsoft.VisualStudio.AspireServer': System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. HResult='-2146232828' 
   at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ServiceHub.HostStub.Utilities.InvokeMethodIfObjectImplementsInterfaceAsync(Object obj, Type implementedInterface, String methodName, Object[] parameters, Boolean throwOnError)
   at Microsoft.ServiceHub.HostStub.ServiceManager.InvokeServiceHubServiceFactory(AssemblyName serviceHubFramework, Object serviceFactory, Object[] args, String serviceHubServiceFactoryTypeName, String methodName)
   at Microsoft.ServiceHub.HostStub.ServiceManager.<>c__DisplayClass74_0.<<CreateServiceModuleObjectWithFactoryAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.ServiceHub.Framework.ServiceManagerReflectionHelpers.SetupRpcConnectionAsync(Func`2 getRpcObject, Stream stream, ServiceRpcDescriptor serviceDescriptor, ServiceActivationOptions options, TraceSource traceSource, Action`1 completionTask)
   at Microsoft.ServiceHub.HostStub.ServiceManager.ExecuteServiceManagerReflectionHelperMethodAsync(AssemblyName serviceHubFramework, String methodName, Object[] parameters)
   at Microsoft.ServiceHub.HostStub.ServiceManager.CreateServiceModuleObjectWithFactoryAsync(ServiceModuleInfo smi, ServiceFactoryDetails serviceFactoryDetails, String serializedServiceActivationOptions, Stream stream, TraceSource serviceModuleTracer, AssemblyName serviceHubFrameworkReference, CancellationToken cancellationToken)
   at Microsoft.ServiceHub.HostStub.ServiceManager.CreateAndConfigureServiceAsync(ServiceModuleInfo smi, Type serviceModuleType, Stream stream, String serializedServiceActivationOptions, CancellationTokenSource cts)
===InnerException===
**Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The specified item is no longer valid. It may have been deleted from the keychain. HResult='-25304'** 
   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.CertificateRequest.CreateSelfSigned(DateTimeOffset notBefore, DateTimeOffset notAfter)
   at Microsoft.WebTools.AspireServer.CertGenerator.GenerateCert()
   at Microsoft.WebTools.AspireServer.AspireServerService..ctor(IAspireServerEvents aspireServerEvents, IServiceProvider hostProvidedServices, IServiceBroker serviceBroker)
   at Microsoft.WebTools.AspireServer.ServiceFactory.CreateAsync(IServiceProvider hostProvidedServices, ServiceMoniker serviceMoniker, ServiceActivationOptions serviceActivationOptions, IServiceBroker serviceBroker, AuthorizationServiceClient authorizationServiceClient, CancellationToken cancellationToken)
   at InvokeStub_IMultiVersionedServiceFactory.CreateAsync(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
01/31/2025 17:59:12 Greenwich Mean Time : Information : Checking if 'Microsoft.WebTools.AspireServer.ServiceFactory' implements Microsoft.VisualStudio.Threading.IAsyncDisposable.
01/31/2025 17:59:12 Greenwich Mean Time : Information : Checking if 'Microsoft.WebTools.AspireServer.ServiceFactory' implements System.IAsyncDisposable.
01/31/2025 17:59:12 Greenwich Mean Time : Information : Checking if 'Microsoft.WebTools.AspireServer.ServiceFactory' implements System.IDisposable.
01/31/2025 17:59:12 Greenwich Mean Time : Information : hubHostClr write: Content-Length: 121

@LittleLittleCloud
Copy link

LittleLittleCloud commented Feb 3, 2025

The cause for issue is CertificateRequest.CreateSelfSigned fails on macOS Sequoia and has been resolved in dotnet October release

To fix this issue, please kindly install the latest .NET 8 SDK (currently,the latest .NET 8 SDK is 8.0.405, according to @jjoergensen 8.0.404 also works) and reload VSCode.

@JamesAlexander42 please let me know if the suggestion above resolves the issue you have.

@maddymontaquila
Copy link
Member

The cause for issue is CertificateRequest.CreateSelfSigned fails on macOS Sequoia and has been resolved in dotnet October release

To fix this issue, please kindly install the latest .NET 8 SDK (currently,the latest .NET 8 SDK is 8.0.405, according to @jjoergensen 8.0.404 also works) and reload VSCode.

@JamesAlexander42 please let me know if the suggestion above resolves the issue you have.

I still don't think this is "solved" considering 9 isn't working. How do we get 9 to work?

@LittleLittleCloud
Copy link

@maddymontaquila C#DK is still in the progress of migrating to .NET 9, it should work once after the migrating process complete.

@ManbirSinghRakhra
Copy link

Hi Everyone,

I encountered the same issue and found a solution. The problem was resolved after I removed all the previous versions of .NET from my Mac, keeping only the latest version, 9.0.200. As shown in my screenshots, I had multiple versions of .NET installed, and once I uninstalled all the old versions, the issue was fixed.

Image

Image

@JakeRadMSFT
Copy link

Leaving this issue open but it's related to:

microsoft/vscode-dotnettools#1768

@JakeRadMSFT
Copy link

To resolve this issue install the latest version of the runtime for C#DK.

For release versions of Dev Kit -- This would be updating .NET 8 runtime to latest .NET 8 runtime.

For pre-release versions of Dev Kit -- This would be updating .NET 9 runtime to latest .NET 9 runtime.

@HarounDemor
Copy link

I had the same issue with these versions of dotnet

.NET SDKs:
Version Status

8.0.303 Patch 8.0.309 is available.
9.0.200 Up to date.

.NET Runtimes:
Name Version Status

Microsoft.AspNetCore.App 8.0.7 Patch 8.0.13 is available.
Microsoft.NETCore.App 8.0.7 Patch 8.0.13 is available.
Microsoft.AspNetCore.App 9.0.2 Up to date.
Microsoft.NETCore.App 9.0.2 Up to date.

Even though my project was targetting .net 9.0, I was still facing the same issue

The issue was resolved by upgrading my .net 8.0 runtime to the latest.

@maddymontaquila
Copy link
Member

@JakeRadMSFT do you think we could intercept this error and add a note in it to update all versions of .NET? because .NET doesnt keep itself up to date, i worry this might lag for a while...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-tooling vs-code Issues related to vs code tooling for aspire
Projects
None yet
Development

No branches or pull requests