Skip to content

Add two troubleshooters #1249

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

Merged
merged 8 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/troubleshooting/connection-string-missing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: The connection string is missing
description: Learn how to troubleshoot the error "ConnectionString is missing" during execution of your app.
ms.date: 07/03/2024
---

# The specified name is already in use

## Symptoms

When your app accesses a service that needs one of the components in your app, it may fail with an exception similar to the following:

> "InvalidOperationException: ConnectionString is missing."

## Possible solutions

Verify that the name of the resource, for instance a database resource, is the same in the AppHost and the Service that fails.

Check failure on line 17 in docs/troubleshooting/connection-string-missing.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces [Expected: 0 or 2; Actual: 1]

For example, if the AppHost defines a PostgreSQL resource with the name db1 like this:

Check failure on line 19 in docs/troubleshooting/connection-string-missing.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces [Expected: 0 or 2; Actual: 1]

```csharp
var db1 = builder.AddPostgres("pg1").AddDatabase("db1");
```

Check failure on line 24 in docs/troubleshooting/connection-string-missing.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces [Expected: 0 or 2; Actual: 1]
Then the service needs to resolve the resource with the same name `db1`.

Check failure on line 25 in docs/troubleshooting/connection-string-missing.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces [Expected: 0 or 2; Actual: 1]

```csharp
var builder = WebApplication.CreateBuilder(args);

builder.AddNpgsqlDbContext<MyDb1Context>("db1");
```

Any other value than the one provided in the AppHost will result in the exception message described above.
31 changes: 31 additions & 0 deletions docs/troubleshooting/container-runtime-unhealthy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Container runtime appears to be unhealthy
description: Learn how to troubleshoot the error "Container runtime 'docker' was found but appears to be unhealthy" during execution of your app.
ms.date: 07/03/2024
---

# Container runtime appears to be unhealthy

## Symptoms

When starting the AppHost the dashboard doesn't show up and an exception stack trace similar to this example is displayed in the console:

Check failure on line 11 in docs/troubleshooting/container-runtime-unhealthy.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces [Expected: 0 or 2; Actual: 1]

```sh
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 8.1.0-dev
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: D:\aspire\playground\PostgresEndToEnd\PostgresEndToEnd.AppHost
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
Aspire.Hosting.DistributedApplicationException: Container runtime 'docker' was found but appears to be unhealthy. The error from the container runtime check was error during connect: this error may indicate that the docker daemon is not running: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.45/containers/json?limit=1": open //./pipe/docker_engine: The system cannot find the file specified..
```

## Possible solutions

Confirm that Docker is installed and running.

Check failure on line 27 in docs/troubleshooting/container-runtime-unhealthy.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces [Expected: 0 or 2; Actual: 1]

* On Windows, check that in the system tray the Docker icon is present and marked as "Running".

Check failure on line 29 in docs/troubleshooting/container-runtime-unhealthy.md

View workflow job for this annotation

GitHub Actions / lint

Unordered list style [Expected: dash; Actual: asterisk]

Check failure on line 29 in docs/troubleshooting/container-runtime-unhealthy.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces [Expected: 0 or 2; Actual: 1]

* On Linux, check that "docker ps -a" returns success.

Check failure on line 31 in docs/troubleshooting/container-runtime-unhealthy.md

View workflow job for this annotation

GitHub Actions / lint

Unordered list style [Expected: dash; Actual: asterisk]
Loading