dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.29k stars 520 forks source link

Exception while attempting to run sample app #764

Open syoguran opened 3 years ago

syoguran commented 3 years ago

As described in documentation, I tried to run the sample app on my local.

tye --version : 0.5.0-alpha.20555.1+fae47325b0c8d7dafcdec5d1248191b24b2adc23 Platform Windows 10

Full error message:

tye run -v debug Loading Application Details... Restoring and evaluating projects Resolved metadata for service frontend at C:\Users\serka\Documents\Projects\sandbox\microservice\frontend\obj\Debug\netcoreapp3.1\MicrosoftTye.ProjectMetadata.txt Resolved metadata for service backend at C:\Users\serka\Documents\Projects\sandbox\microservice\backend\obj\Debug\netcoreapp3.1\MicrosoftTye.ProjectMetadata.txt Restore and project evaluation took: 1156.0996ms Found application version: 1.0.0 RunCommand=C:\Users\serka\Documents\Projects\sandbox\microservice\frontend\bin\Debug\netcoreapp3.1\frontend.exe RunArguments= TargetPath=C:\Users\serka\Documents\Projects\sandbox\microservice\frontend\bin\Debug\netcoreapp3.1\frontend.dll PublishDir=bin\Debug\netcoreapp3.1\publish\ AssemblyName=frontend IntermediateOutputPath=obj\Debug\netcoreapp3.1\ Found target framework: netcoreapp3.1 Parsed target framework name: netcoreapp Parsed target framework version: 3.1 Found shared frameworks: Microsoft.NETCore.App, Microsoft.AspNetCore.App IsAspNet=True Evaluation Took: 1.7953ms Found application version: 1.0.0 RunCommand=C:\Users\serka\Documents\Projects\sandbox\microservice\backend\bin\Debug\netcoreapp3.1\backend.exe RunArguments= TargetPath=C:\Users\serka\Documents\Projects\sandbox\microservice\backend\bin\Debug\netcoreapp3.1\backend.dll PublishDir=bin\Debug\netcoreapp3.1\publish\ AssemblyName=backend IntermediateOutputPath=obj\Debug\netcoreapp3.1\ Found target framework: netcoreapp3.1 Parsed target framework name: netcoreapp Parsed target framework version: 3.1 Found shared frameworks: Microsoft.NETCore.App, Microsoft.AspNetCore.App IsAspNet=True Evaluation Took: 0.6879ms Launching Tye Host...

[14:36:03 INF] Executing application from C:\Users\serka\Documents\Projects\sandbox\microservice\microservice.sln An unhandled exception has occurred, how unseemly: System.Net.Sockets.SocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions. at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at Microsoft.Tye.Hosting.TyeHost.IsPortAlreadyInUse(Int32 port) in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 244 at Microsoft.Tye.Hosting.TyeHost.ComputePort(WebApplication app) in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 225 at Microsoft.Tye.Hosting.TyeHost.ConfigureApplication(WebApplication app) in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 184 at Microsoft.Tye.Hosting.TyeHost.StartAsync() in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 86 at Microsoft.Tye.Hosting.TyeHost.RunAsync() in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 60 at Microsoft.Tye.Hosting.TyeHost.RunAsync() in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 70 at Microsoft.Tye.Program.<>c.<b150>d.MoveNext() in //src/tye/Program.RunCommand.cs:line 126 --- End of stack trace from previous location where exception was thrown --- at Microsoft.Tye.Program.<>c.<b150>d.MoveNext() in //src/tye/Program.RunCommand.cs:line 126 --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context) at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>cDisplayClass4_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b19_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass14_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass22_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b10_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<b__0>d.MoveNext()

israels commented 3 years ago

I'm having the same issue on my work (domain joined) machine. It's possible some group policy is blocking communication and startup, but I don't know how to begin troubleshooting.

bozhiqian commented 2 years ago

Does anyone know if this issue has been resolved?

I have the same issue for a web api app generated by VS2019 template for .net 5. I am using my developer laptop on Windows 10 pro.

tye --version 0.8.0-alpha.21352.1+fc0ab39f1bd2f1cd4d5b5c0a07f66f61a44263ea

This api app is just standard weather forcast api from the template without any change by me. As soon as I run tye from VScode terminal, I get error.

`PS D:\Dev\temp3\demoapi> tye run -v debug Loading Application Details... Restoring and evaluating projects Resolved metadata for service demoapi at D:\Dev\temp3\demoapi\demoapi\obj\Debug\net5.0\MicrosoftTye.ProjectMetadata.txt Restore and project evaluation took: 1204.1741ms Found application version: 1.0.0 RunCommand=D:\Dev\temp3\demoapi\demoapi\bin\Debug\net5.0\demoapi.exe RunArguments= TargetPath=D:\Dev\temp3\demoapi\demoapi\bin\Debug\net5.0\demoapi.dll PublishDir=bin\Debug\net5.0\publish\ AssemblyName=demoapi IntermediateOutputPath=obj\Debug\net5.0\ Found target framework: net5.0 Parsed target framework name: net Parsed target framework version: 5.0 Found shared frameworks: Microsoft.NETCore.App, Microsoft.AspNetCore.App IsAspNet=True Evaluation Took: 3.6032ms Launching Tye Host...

An unhandled exception has occurred, how unseemly: System.Net.Sockets.SocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions. at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at Microsoft.Tye.Hosting.TyeHost.IsPortAlreadyInUse(Int32 port) in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 258 at Microsoft.Tye.Hosting.TyeHost.ComputePort(Nullable`1 port) in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 242 at Microsoft.Tye.Hosting.TyeHost.<>cDisplayClass27_0.b_1(IWebHostBuilder builder) in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 157 at Microsoft.Extensions.Hosting.GenericHostBuilderExtensions.<>cDisplayClass0_0.b0(IWebHostBuilder webHostBuilder) at Microsoft.Extensions.Hosting.GenericHostWebHostBuilderExtensions.ConfigureWebHost(IHostBuilder builder, Action1 configure) at Microsoft.Extensions.Hosting.GenericHostBuilderExtensions.ConfigureWebHostDefaults(IHostBuilder builder, Action1 configure) at Microsoft.Tye.Hosting.TyeHost.BuildWebApplication(Application application, HostOptions options, ILogEventSink sink) in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 129 at Microsoft.Tye.Hosting.TyeHost.StartAsync() in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 86 at Microsoft.Tye.Hosting.TyeHost.RunAsync() in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 70 at Microsoft.Tye.Hosting.TyeHost.RunAsync() in //src/Microsoft.Tye.Hosting/TyeHost.cs:line 80 at Microsoft.Tye.Program.<>c.<b180>d.MoveNext() in //src/tye/Program.RunCommand.cs:line 126 --- End of stack trace from previous location where exception was thrown --- at Microsoft.Tye.Program.<>c.<b180>d.MoveNext() in //src/tye/Program.RunCommand.cs:line 126 --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context) at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>cDisplayClass4_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b19_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass17_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass14_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass22_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b10_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass12_0.<b__0>d.MoveNext()`

By the way, I have updated the launchSettings.json with change of port from 5001/5000 to 8001/8000.

{ "$schema": "http://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:7596", "sslPort": 44310 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "demoapi": { "commandName": "Project", "dotnetRunMessages": "true", "launchBrowser": true, "launchUrl": "swagger", "applicationUrl": "https://localhost:8001;http://localhost:8000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } }

bozhiqian commented 2 years ago

I have figured it out. The tye run on port 8000 but one of my app has been already running on my machine with the port 8000 so tye host won't be able to start. I would expect tye would be able to change on its default port number by user in future.

onurcanyilmaz commented 1 year ago

I have figured it out. The tye run on port 8000 but one of my app has been already running on my machine with the port 8000 so tye host won't be able to start. I would expect tye would be able to change on its default port number by user in future.

Hi @bozhiqian, I've faced same issue. I've found solution that related problem

tye run --port <your_port>

By the way I've read this document https://github.com/dotnet/tye/blob/main/docs/reference/schema.md

cheers