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

Issue with Persistent Cosmos DB Container Restart in Aspire (.NET 9) #6740

Open
1 task done
Thovenaar opened this issue Nov 20, 2024 · 0 comments
Open
1 task done

Comments

@Thovenaar
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Dear Support Team,

I hope this message finds you well.

We are currently encountering an issue with Aspire while using Cosmos DB in a .NET 9 project. The problem occurs with the Cosmos DB container configured as persistent. While it functions correctly during the initial startup, it fails upon subsequent restarts—either triggered manually via Docker or after a system reboot. Specifically, the container hangs at approximately 75% completion during startup.

Below is the relevant code snippet from the project setup:

IResourceBuilder<AzureCosmosDBResource> cosmos = builder.AddAzureCosmosDB(CosmosName)
    .RunAsEmulator(e => e
        .WithLifetime(ContainerLifetime.Persistent)
        .WithDataVolume()
        .WithPartitionCount(30)
        .WithGatewayPort(8663));

We are using the following (relevant) Aspire packages:

  • Aspire.Hosting.AppHost 9.0.0
  • Aspire.Hosting.Azure.CosmosDB 9.0.0

For reference, these are the container logs during the second startup (after the initial successful session):

2024-11-20 12:07:54 This is an evaluation version.  There are [124] days left in the evaluation period.
2024-11-20 12:07:55 2.14.20.0 (dd7750b6)
2024-11-20 12:07:55 Copyright (C) Microsoft Corporation. All rights reserved.
2024-11-20 12:07:56 Starting
2024-11-20 12:08:26 Started 1/31 partitions
2024-11-20 12:08:26 Started 2/31 partitions
2024-11-20 12:08:27 Started 3/31 partitions
2024-11-20 12:08:27 Started 4/31 partitions
2024-11-20 12:08:27 Started 5/31 partitions
2024-11-20 12:08:28 Started 6/31 partitions
2024-11-20 12:08:28 Started 7/31 partitions
2024-11-20 12:08:28 Started 8/31 partitions
2024-11-20 12:08:29 Started 9/31 partitions
2024-11-20 12:08:29 Started 10/31 partitions
2024-11-20 12:08:29 Started 11/31 partitions
2024-11-20 12:08:29 Started 12/31 partitions
2024-11-20 12:08:30 Started 13/31 partitions
2024-11-20 12:08:30 Started 14/31 partitions
2024-11-20 12:08:30 Started 15/31 partitions
2024-11-20 12:08:31 Started 16/31 partitions
2024-11-20 12:08:31 Started 17/31 partitions
2024-11-20 12:08:32 Started 18/31 partitions
2024-11-20 12:08:32 Started 19/31 partitions
2024-11-20 12:08:32 Started 20/31 partitions
2024-11-20 12:08:33 Started 21/31 partitions
2024-11-20 12:08:33 Started 22/31 partitions
2024-11-20 12:08:33 Started 23/31 partitions
2024-11-20 12:08:33 Started 24/31 partitions

We would greatly appreciate your assistance in identifying the root cause of this issue and any guidance on resolving it. Please let us know if additional information or logs are required.

Best regards,
Thovenaar

Expected Behavior

The Cosmos DB container configured with Aspire should function correctly across all sessions, regardless of restarts triggered manually through Docker or via system reboots. Specifically:

  1. The Cosmos DB container should initialize and reach 100% startup completion consistently after any restart.
  2. The persistent configuration should ensure that data, volume mappings, and partition settings remain intact and accessible across sessions.
  3. The startup process should not hang or experience significant delays, ensuring seamless operation and availability of the Cosmos DB emulator.

This behavior should align with the provided Aspire configuration and package versions, without requiring additional manual intervention.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

.NET 9

Anything else?

No response

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

No branches or pull requests

1 participant