dapr / dapr

Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge.

Home Page:https://dapr.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sidecar doesn't try again after 'FATAL: the database system is starting up'

paule96 opened this issue · comments

Ask your question here

I have configured as an actor state store for my dapr environment a Postgres database. My Environment is hosted in aspire.
One of the rules in Aspire is, that everything communicates in a resilient way with each other. That's why there is currently no startup order implemented if you use different services.

This means that my dapr sidecar and my Postgres database start around the same time.
But a Postgres database needs some seconds from the start to be ready. That's when the dapr sidecar will receive the following error message:

time="2024-04-09T14:02:51.3669434+02:00" level=fatal msg="Fatal error from runtime: process component xxx-actorstatestore error: [INIT_COMPONENT_FAILURE]: initialization error occurred for xxx-actorstatestore (state.postgresql/v2): [INIT_COMPONENT_FAILURE]: initialization error occurred for xxx-actorstatestore (state.postgresql/v2): failed to ping the database: failed to connect to `host=localhost user=postgres database=dapractorstatestore`: server error (FATAL: the database system is starting up (SQLSTATE 57P03))" app_id=dmsdocservice instance=PC2024001 scope=dapr.runtime type=log ver=1.13.0

Is there any setting where you can configure the sidecar to try it a defined number of times before it it fails?

This question is likely out of scope for Dapr. I will transfer it to the Dapr runtime repo for now however because this question applies to the entire Dapr project all up and isn't really component specific in nature.

Also tagging @philliphoff who has done lots of work with Aspire and might have thoughts.

I do think that question likely is for the Aspire team however.