fix(cmd): clarify notification config handling (#9459)

# Which Problems Are Solved

If configuration `notifications.LegacyEnabled` is set to false when
using cockroachdb as a database Zitadel start does not work and prints
the following error: `level=fatal msg="unable to start zitadel"
caller="github.com/zitadel/zitadel/cmd/start/start_from_init.go:44"
error="can't scan into dest[0]: cannot scan NULL into *string"`

# How the Problems Are Solved

The combination of the setting and cockraochdb are checked and a better
error is provided to the user.

# Additional Context

- introduced with https://github.com/zitadel/zitadel/pull/9321
This commit is contained in:
Silvan
2025-03-06 07:26:33 +01:00
committed by GitHub
parent 3c57e325f7
commit 92f0cf018f
3 changed files with 12 additions and 1 deletions

View File

@@ -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,
})