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

[BUG] postgresql and redis cluster create error: DCS initialize failed: MY_CLUSTER_NAME or KB_CLUSTER_NAME must be set #8749

Closed
JashBook opened this issue Jan 6, 2025 · 0 comments · Fixed by apecloud/kubeblocks-addons#1388
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@JashBook
Copy link
Collaborator

JashBook commented Jan 6, 2025

Describe the bug

kbcli version
Kubernetes: v1.28.3-vke.17
KubeBlocks: 1.0.0-beta.21
kbcli: 1.0.0-beta.8

To Reproduce
Steps to reproduce the behavior:

  1. create cluster
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: postgres-cuxvnb
  namespace: default
spec:
  terminationPolicy: WipeOut
  clusterDef: postgresql
  topology: replication
  componentSpecs:
    - name: postgresql
      labels:
        apps.kubeblocks.postgres.patroni/scope: postgres-cuxvnb-postgresql
      replicas: 2
      serviceAccountName:
      disableExporter: true
      resources:
        limits:
          cpu: 100m
          memory: 0.5Gi
        requests:
          cpu: 100m
          memory: 0.5Gi
      volumeClaimTemplates:
        - name: data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
  1. See error
➜  ~ kubectl get cluster postgres-cuxvnb 
NAME              CLUSTER-DEFINITION   TERMINATION-POLICY   STATUS     AGE
postgres-cuxvnb   postgresql           WipeOut              Creating   81m
➜  ~ kubectl get pod -l app.kubernetes.io/instance=postgres-cuxvnb 
NAME                           READY   STATUS    RESTARTS   AGE
postgres-cuxvnb-postgresql-0   4/4     Running   0          81m
postgres-cuxvnb-postgresql-1   4/4     Running   0          81m

logs pod kbagent

kubectl logs postgres-cuxvnb-postgresql-0 kbagent --tail 50 
2025-01-06T05:41:56Z	INFO	send probe event	{"probe": "roleProbe", "probe": "roleProbe", "code": -1, "output": "", "message": "exit code: 255, stderr: Error: DCS initialize failed: KB_CLUSTER_NAME must be set\nUsage:\n  dbctl database getrole [flags]\n\nExamples:\n\ndbctl database getrole \n  \n\nFlags:\n  -h, --help   Print this help message\n\nGlobal Flags:\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\n      --config-path string                dbctl default config directory for builtin type (default \"/tools/config/dbctl/components/\")\n      --disable-dns-checker               disable dns checker, for test&dev\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\n      --logtostderr                       log to standard error instead of files (default true)\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\n      --skip_headers                      If true, avoid header prefixes in the log messages\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\n      --tools-dir string                  The directory of tools binaries (default \"/tools/\")\n  -v, --v Level                           number for the log level verbosity\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\n\n: failed"}
2025-01-06T05:41:56Z	ERROR	failed to send event	{"probe": "roleProbe", "reason": "roleProbe", "message": "{\"instance\":\"postgres-cuxvnb-postgresql\",\"probe\":\"roleProbe\",\"code\":-1,\"message\":\"exit code: 255, stderr: Error: DCS initialize failed: KB_CLUSTER_NAME must be set\\nUsage:\\n  dbctl database getrole [flags]\\n\\nExamples:\\n\\ndbctl database getrole \\n  \\n\\nFlags:\\n  -h, --help   Print this help message\\n\\nGlobal Flags:\\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\\n      --config-path string                dbctl default config directory for builtin type (default \\\"/tools/config/dbctl/components/\\\")\\n      --disable-dns-checker               disable dns checker, for test\\u0026dev\\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\\n      --logtostderr                       log to standard error instead of files (default true)\\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\\n      --skip_headers                      If true, avoid header prefixes in the log messages\\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\\n      --tools-dir string                  The directory of tools binaries (default \\\"/tools/\\\")\\n  -v, --v Level                           number for the log level verbosity\\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value \\u003e 0 which corresponds to custom debug levels of increasing verbosity\\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\\n\\n: failed\"}", "error": "failed to handle event after 30 attempts: Event \"postgres-cuxvnb-postgresql-0.20794e99\" is invalid: message: Invalid value: \"\": can have at most 1024 characters", "errorVerbose": "Event \"postgres-cuxvnb-postgresql-0.20794e99\" is invalid: message: Invalid value: \"\": can have at most 1024 characters\nfailed to handle event after 30 attempts\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.createOrUpdateEvent\n\t/src/pkg/kbagent/util/event.go:124\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1\n\t/src/pkg/kbagent/util/event.go:47\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2\n\t/src/pkg/kbagent/util/event.go:59\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"}
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1
	/src/pkg/kbagent/util/event.go:49
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2
	/src/pkg/kbagent/util/event.go:59
2025-01-06T05:41:57Z	INFO	send probe event	{"probe": "roleProbe", "probe": "roleProbe", "code": -1, "output": "", "message": "exit code: 255, stderr: Error: DCS initialize failed: KB_CLUSTER_NAME must be set\nUsage:\n  dbctl database getrole [flags]\n\nExamples:\n\ndbctl database getrole \n  \n\nFlags:\n  -h, --help   Print this help message\n\nGlobal Flags:\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\n      --config-path string                dbctl default config directory for builtin type (default \"/tools/config/dbctl/components/\")\n      --disable-dns-checker               disable dns checker, for test&dev\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\n      --logtostderr                       log to standard error instead of files (default true)\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\n      --skip_headers                      If true, avoid header prefixes in the log messages\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\n      --tools-dir string                  The directory of tools binaries (default \"/tools/\")\n  -v, --v Level                           number for the log level verbosity\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\n\n: failed"}
2025-01-06T05:41:57Z	ERROR	failed to send event	{"probe": "roleProbe", "reason": "roleProbe", "message": "{\"instance\":\"postgres-cuxvnb-postgresql\",\"probe\":\"roleProbe\",\"code\":-1,\"message\":\"exit code: 255, stderr: Error: DCS initialize failed: KB_CLUSTER_NAME must be set\\nUsage:\\n  dbctl database getrole [flags]\\n\\nExamples:\\n\\ndbctl database getrole \\n  \\n\\nFlags:\\n  -h, --help   Print this help message\\n\\nGlobal Flags:\\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\\n      --config-path string                dbctl default config directory for builtin type (default \\\"/tools/config/dbctl/components/\\\")\\n      --disable-dns-checker               disable dns checker, for test\\u0026dev\\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\\n      --logtostderr                       log to standard error instead of files (default true)\\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\\n      --skip_headers                      If true, avoid header prefixes in the log messages\\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\\n      --tools-dir string                  The directory of tools binaries (default \\\"/tools/\\\")\\n  -v, --v Level                           number for the log level verbosity\\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value \\u003e 0 which corresponds to custom debug levels of increasing verbosity\\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\\n\\n: failed\"}", "error": "failed to handle event after 30 attempts: Event \"postgres-cuxvnb-postgresql-0.20794e99\" is invalid: message: Invalid value: \"\": can have at most 1024 characters", "errorVerbose": "Event \"postgres-cuxvnb-postgresql-0.20794e99\" is invalid: message: Invalid value: \"\": can have at most 1024 characters\nfailed to handle event after 30 attempts\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.createOrUpdateEvent\n\t/src/pkg/kbagent/util/event.go:124\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1\n\t/src/pkg/kbagent/util/event.go:47\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2\n\t/src/pkg/kbagent/util/event.go:59\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"}
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1
	/src/pkg/kbagent/util/event.go:49
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2
	/src/pkg/kbagent/util/event.go:59

pod 1

kubectl logs postgres-cuxvnb-postgresql-1 kbagent --tail 50

2025-01-06T05:42:49Z	INFO	send probe event	{"probe": "roleProbe", "probe": "roleProbe", "code": -1, "output": "", "message": "exit code: 255, stderr: Error: DCS initialize failed: KB_CLUSTER_NAME must be set\nUsage:\n  dbctl database getrole [flags]\n\nExamples:\n\ndbctl database getrole \n  \n\nFlags:\n  -h, --help   Print this help message\n\nGlobal Flags:\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\n      --config-path string                dbctl default config directory for builtin type (default \"/tools/config/dbctl/components/\")\n      --disable-dns-checker               disable dns checker, for test&dev\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\n      --logtostderr                       log to standard error instead of files (default true)\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\n      --skip_headers                      If true, avoid header prefixes in the log messages\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\n      --tools-dir string                  The directory of tools binaries (default \"/tools/\")\n  -v, --v Level                           number for the log level verbosity\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\n\n: failed"}
2025-01-06T05:42:49Z	ERROR	failed to send event	{"probe": "roleProbe", "reason": "roleProbe", "message": "{\"instance\":\"postgres-cuxvnb-postgresql\",\"probe\":\"roleProbe\",\"code\":-1,\"message\":\"exit code: 255, stderr: Error: DCS initialize failed: KB_CLUSTER_NAME must be set\\nUsage:\\n  dbctl database getrole [flags]\\n\\nExamples:\\n\\ndbctl database getrole \\n  \\n\\nFlags:\\n  -h, --help   Print this help message\\n\\nGlobal Flags:\\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\\n      --config-path string                dbctl default config directory for builtin type (default \\\"/tools/config/dbctl/components/\\\")\\n      --disable-dns-checker               disable dns checker, for test\\u0026dev\\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\\n      --logtostderr                       log to standard error instead of files (default true)\\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\\n      --skip_headers                      If true, avoid header prefixes in the log messages\\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\\n      --tools-dir string                  The directory of tools binaries (default \\\"/tools/\\\")\\n  -v, --v Level                           number for the log level verbosity\\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value \\u003e 0 which corresponds to custom debug levels of increasing verbosity\\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\\n\\n: failed\"}", "error": "failed to handle event after 30 attempts: Event \"postgres-cuxvnb-postgresql-1.c005ee6f\" is invalid: message: Invalid value: \"\": can have at most 1024 characters", "errorVerbose": "Event \"postgres-cuxvnb-postgresql-1.c005ee6f\" is invalid: message: Invalid value: \"\": can have at most 1024 characters\nfailed to handle event after 30 attempts\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.createOrUpdateEvent\n\t/src/pkg/kbagent/util/event.go:124\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1\n\t/src/pkg/kbagent/util/event.go:47\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2\n\t/src/pkg/kbagent/util/event.go:59\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"}
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1
	/src/pkg/kbagent/util/event.go:49
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2
	/src/pkg/kbagent/util/event.go:59

redis cluster error pod kbagent logs

kubectl logs redis-wlqdsu-redis-0 kbagent --tail 50

2025-01-06T05:42:24Z	INFO	send probe event	{"probe": "roleProbe", "probe": "roleProbe", "code": -1, "output": "", "message": "exit code: 255, stderr: Error: DCS initialize failed: MY_CLUSTER_NAME or KB_CLUSTER_NAME must be set\nUsage:\n  dbctl database getrole [flags]\n\nExamples:\n\ndbctl database getrole \n  \n\nFlags:\n  -h, --help   Print this help message\n\nGlobal Flags:\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\n      --config-path string                dbctl default config directory for builtin type (default \"/tools/config/dbctl/components/\")\n      --disable-dns-checker               disable dns checker, for test&dev\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\n      --logtostderr                       log to standard error instead of files (default true)\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\n      --skip_headers                      If true, avoid header prefixes in the log messages\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\n      --tools-dir string                  The directory of tools binaries (default \"/tools/\")\n  -v, --v Level                           number for the log level verbosity\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\n\n: failed"}
2025-01-06T05:42:25Z	ERROR	failed to send event	{"probe": "roleProbe", "reason": "roleProbe", "message": "{\"instance\":\"redis-wlqdsu-redis\",\"probe\":\"roleProbe\",\"code\":-1,\"message\":\"exit code: 255, stderr: Error: DCS initialize failed: MY_CLUSTER_NAME or KB_CLUSTER_NAME must be set\\nUsage:\\n  dbctl database getrole [flags]\\n\\nExamples:\\n\\ndbctl database getrole \\n  \\n\\nFlags:\\n  -h, --help   Print this help message\\n\\nGlobal Flags:\\n      --add_dir_header                    If true, adds the file directory to the header of the log messages\\n      --alsologtostderr                   log to standard error as well as files (no effect when -logtostderr=true)\\n      --config-path string                dbctl default config directory for builtin type (default \\\"/tools/config/dbctl/components/\\\")\\n      --disable-dns-checker               disable dns checker, for test\\u0026dev\\n      --kubeconfig string                 Paths to a kubeconfig. Only required if out-of-cluster.\\n      --log_backtrace_at traceLocation    when logging hits line file:N, emit a stack trace (default :0)\\n      --log_dir string                    If non-empty, write log files in this directory (no effect when -logtostderr=true)\\n      --log_file string                   If non-empty, use this log file (no effect when -logtostderr=true)\\n      --log_file_max_size uint            Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)\\n      --logtostderr                       log to standard error instead of files (default true)\\n      --one_output                        If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)\\n      --skip_headers                      If true, avoid header prefixes in the log messages\\n      --skip_log_headers                  If true, avoid headers when opening log files (no effect when -logtostderr=true)\\n      --stderrthreshold severity          logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)\\n      --tools-dir string                  The directory of tools binaries (default \\\"/tools/\\\")\\n  -v, --v Level                           number for the log level verbosity\\n      --vmodule moduleSpec                comma-separated list of pattern=N settings for file-filtered logging\\n      --zap-devel                         Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)\\n      --zap-encoder encoder               Zap log encoding (one of 'json' or 'console')\\n      --zap-log-level level               Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value \\u003e 0 which corresponds to custom debug levels of increasing verbosity\\n      --zap-stacktrace-level level        Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').\\n      --zap-time-encoding time-encoding   Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.\\n\\n: failed\"}", "error": "failed to handle event after 30 attempts: Event \"redis-wlqdsu-redis-0.c5f03496\" is invalid: message: Invalid value: \"\": can have at most 1024 characters", "errorVerbose": "Event \"redis-wlqdsu-redis-0.c5f03496\" is invalid: message: Invalid value: \"\": can have at most 1024 characters\nfailed to handle event after 30 attempts\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.createOrUpdateEvent\n\t/src/pkg/kbagent/util/event.go:124\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1\n\t/src/pkg/kbagent/util/event.go:47\ngithub.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2\n\t/src/pkg/kbagent/util/event.go:59\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"}
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func1
	/src/pkg/kbagent/util/event.go:49
github.com/apecloud/kubeblocks/pkg/kbagent/util.SendEventWithMessage.func2
	/src/pkg/kbagent/util/event.go:59

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@JashBook JashBook added the kind/bug Something isn't working label Jan 6, 2025
@JashBook JashBook added this to the Release 1.0.0 milestone Jan 6, 2025
@xuriwuyun xuriwuyun linked a pull request Jan 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants