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

DCP unable to bind port to container #6991

Open
1 task done
Kralizek opened this issue Dec 27, 2024 · 4 comments
Open
1 task done

DCP unable to bind port to container #6991

Kralizek opened this issue Dec 27, 2024 · 4 comments

Comments

@Kralizek
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When I start the AppHost, I get the following message

dotnet run --project .\tools\AppHost\
Using launch settings from .\tools\AppHost\Properties\launchSettings.json...
Building...
info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 9.0.0+01ed51919f8df692ececce51048a140615dc759d
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: C:\Users\rg1844\Development\EduConvert\EduConvert\tools\AppHost
info: Aspire.Hosting.DistributedApplication[0]
      Now listening on: https://localhost:17197
info: Aspire.Hosting.DistributedApplication[0]
      Login to the dashboard at https://localhost:17197/login?t=65e02eeb65a9c10bbbd4597e31f84e6b
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy {"ServiceName": {"name":"EduConvertDB"}, "Reconciliation": 14, "error": "could not start the proxy for the service: listen tcp [::1]:53000: bind: An attempt was made to access a socket in a way forbidden by its access permissions."}
fail: Aspire.Hosting.Dcp.dcpctrl.ServiceReconciler[0]
      could not start the proxy {"ServiceName": {"name":"EduConvertDB"}, "Reconciliation": 21, "error": "could not start the proxy for the service: listen tcp [::1]:53000: bind: An attempt was made to access a socket in a way forbidden by its access permissions."}

The database container is defined as such

var database = builder.AddPostgres("postgres", password: password, userName: username, port: 53000)
                      .WithImageTag("16")
                      .WithContainerName("EduConvertDB")
                      .WithLifetime(ContainerLifetime.Persistent)
                      .PublishAsConnectionString()
                      .WithDataVolume(name: "npgsql-educonvert")
                      .AddDatabase("database", databaseName: "educonvert");

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

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

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100\

.NET workloads installed:
 [aspire]
   Installation Source: VS 17.11.35222.181
   Manifest Version:    8.2.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
   Install Type:              Msi

Configured to use loose manifests when installing new manifests.

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

.NET SDKs installed:
  6.0.428 [C:\Program Files\dotnet\sdk]
  8.0.307 [C:\Program Files\dotnet\sdk]
  8.0.400 [C:\Program Files\dotnet\sdk]
  8.0.404 [C:\Program Files\dotnet\sdk]
  9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  C:\Users\rg1844\Development\EduConvert\EduConvert\global.json

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

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

Anything else?

No response

@karolz-ms
Copy link
Member

@Kralizek error message has been showing up for people who are using some sort of VPN that restricts the use of IPv6. Or when their machine places limitations on IPv6 usage in general. Have you read through the discussion on #3355? Try setting DCP IP preference and see if that helps. Let us know!

@Kralizek
Copy link
Author

@Kralizek error message has been showing up for people who are using some sort of VPN that restricts the use of IPv6. Or when their machine places limitations on IPv6 usage in general. Have you read through the discussion on #3355? Try setting DCP IP preference and see if that helps. Let us know!

@karolz-ms uhm, I haven't changed anything in my setup. Yesterday, it was working. Today, it isn't.

I'll check the linked issue.

@jack775544
Copy link

I got a similar issue after updating to the latest version of Docker Desktop to 4.37. Rolling back Docker desktop to version 4.36 has worked around the issue for me.

@Kralizek
Copy link
Author

I'm already on Docker Desktop 4.36.0. On the other hand, I started the AppHost again after a reboot and it seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants