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

Error on first execution of 9.1 #7587

Open
afscrome opened this issue Feb 13, 2025 · 6 comments
Open

Error on first execution of 9.1 #7587

afscrome opened this issue Feb 13, 2025 · 6 comments
Milestone

Comments

@afscrome
Copy link
Contributor

afscrome commented Feb 13, 2025

Trying out 9.1 preview and hit the following error on my first execution. I have only seen it the first time and haven't been able to reproduce since, so this may not be actionable.

dotnet new install Aspire.ProjectTemplates::9.1.0-* --force 
dotnet new aspire-starter     

And then added the following into the AppHost

var builder = DistributedApplication.CreateBuilder(args);

var apiService = builder.AddProject<Projects.aspire91_ApiService>("apiservice");

var web = builder.AddProject<Projects.aspire91_Web>("webfrontend")
    .WithExternalHttpEndpoints()
    .WithReference(apiService)
    .WaitFor(apiService);

// START ADDITION
web.WithHttpHealthCheck();
// END ADDITION

builder.Build().Run();

On start up, the app failed with the following errors.

info: Aspire.Hosting.DistributedApplication[0]
      Login to the dashboard at https://localhost:17015/login?t=0f93f7cf12e2638c9a945a896c9f5740
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application started. Press Ctrl+C to shut down.
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      could not perform substitution for environment variable ASPNETCORE_URLS'  {"Executable": {"name":"webfrontend-frbcgszp"}, "Reconciliation": 9, "Input": "https://localhost:{{- portForServing \"webfrontend-https\" -}};http://localhost:{{- portForServing \"webfrontend-http\" -}}", "error": "template: envar:1:82: executing \"envar\" at <portForServing \"webfrontend-http\">: error calling portForServing: service '/webfrontend-http' referenced by executable '/webfrontend-frbcgszp' specification does not exist"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      could not create Endpoint object  {"Executable": {"name":"webfrontend-frbcgszp"}, "Reconciliation": 11, "ServiceName": "webfrontend-http", "Workload": "/webfrontend-frbcgszp", "error": "service-producer annotation is invalid: missing information about the port to expose the service"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      could not create Endpoint object  {"Executable": {"name":"webfrontend-frbcgszp"}, "Reconciliation": 12, "ServiceName": "webfrontend-http", "Workload": "/webfrontend-frbcgszp", "error": "service-producer annotation is invalid: missing information about the port to expose the service"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      could not create Endpoint object  {"Executable": {"name":"webfrontend-frbcgszp"}, "Reconciliation": 13, "ServiceName": "webfrontend-http", "Workload": "/webfrontend-frbcgszp", "error": "service-producer annotation is invalid: missing information about the port to expose the service"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      could not create Endpoint object  {"Executable": {"name":"webfrontend-frbcgszp"}, "Reconciliation": 14, "ServiceName": "webfrontend-http", "Workload": "/webfrontend-frbcgszp", "error": "service-producer annotation is invalid: missing information about the port to expose the service"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      could not create Endpoint object  {"Executable": {"name":"webfrontend-frbcgszp"}, "Reconciliation": 17, "ServiceName": "webfrontend-http", "Workload": "/webfrontend-frbcgszp", "error": "service-producer annotation is invalid: missing information about the port to expose the service"}

Versions:

  <Sdk Name="Aspire.AppHost.Sdk" Version="9.1.0-preview.1.25111.2" />
  <PackageReference Include="Aspire.Hosting.AppHost" Version="9.1.0-preview.1.25111.2" />
@davidfowl
Copy link
Member

cc @karolz-ms @danegsta

@davidfowl davidfowl added area-orchestrator untriaged New issue has not been triaged labels Feb 13, 2025
@karolz-ms
Copy link
Member

We might have a timing issue here. In typical Aspire app startup sequence Executables are created shortly after Services and the caches used by the internal (controller) client might need a bit of time to catch up. A couple of short-time retries should eliminate this failure mode.

@danmoseley danmoseley added this to the 9.1 milestone Feb 14, 2025
@davidfowl davidfowl removed the untriaged New issue has not been triaged label Feb 14, 2025
@danmoseley
Copy link
Member

@karolz-ms do we need those retries in 9.1?

@mitchdenny
Copy link
Member

Is it possible that this is a timing issue where a previous instance of DCP was running (old 9.0 version) but the AppModel is trying to use annotations which are only in 9.1?

@karolz-ms
Copy link
Member

@danmoseley I do not think so, this should be rare

@mitchdenny I do not think so either. I mean the service-producer annotation is invalid errors in the log are unrelated to the first error that complains about inability to do environment value variable substitution. The variable substitution mechanism did not change between 9.0 and 9.1.

@dbreshears
Copy link
Contributor

@danmoseley. Going to move this to 9.2

@dbreshears dbreshears modified the milestones: 9.1, 9.2 Feb 18, 2025
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

6 participants