diff --git a/cmd/setup/setup.go b/cmd/setup/setup.go index b693df3022..9d57928d06 100644 --- a/cmd/setup/setup.go +++ b/cmd/setup/setup.go @@ -467,10 +467,14 @@ func startCommandsQueries( config.DefaultInstance.SecretGenerators, ) logging.OnError(err).Fatal("unable to start commands") + + if !config.Notifications.LegacyEnabled && dbClient.Type() == "cockroach" { + logging.Fatal("notifications must be set to LegacyEnabled=true when using CockroachDB") + } q, err := queue.NewQueue(&queue.Config{ Client: dbClient, }) - logging.OnError(err).Fatal("unable to start queue") + logging.OnError(err).Fatal("unable to init queue") notify_handler.Register( ctx, diff --git a/cmd/start/start.go b/cmd/start/start.go index b12dde2182..76ffdb8921 100644 --- a/cmd/start/start.go +++ b/cmd/start/start.go @@ -4,6 +4,7 @@ import ( "context" "crypto/tls" _ "embed" + "errors" "fmt" "math" "net/http" @@ -268,6 +269,9 @@ func startZitadel(ctx context.Context, config *Config, masterKey string, server actionsLogstoreSvc := logstore.New(queries, actionsExecutionDBEmitter, actionsExecutionStdoutEmitter) actions.SetLogstoreService(actionsLogstoreSvc) + if !config.Notifications.LegacyEnabled && dbClient.Type() == "cockroach" { + return errors.New("notifications must be set to LegacyEnabled=true when using CockroachDB") + } q, err := queue.NewQueue(&queue.Config{ Client: dbClient, }) diff --git a/internal/queue/queue.go b/internal/queue/queue.go index d680221753..b45a7eb8cb 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -27,6 +27,9 @@ type Config struct { } func NewQueue(config *Config) (_ *Queue, err error) { + if config.Client.Type() == "cockroach" { + return nil, nil + } return &Queue{ driver: riverpgxv5.New(config.Client.Pool), config: &river.Config{