{"record":{"id":"6fbd0794444d6ac2","repo":"hyperledger/fabric","slug":"invalid-log-level-provided-s","errorCode":null,"errorMessage":"invalid log level provided - %s","messagePattern":"invalid log level provided - (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/peer/common/common.go","lineNumber":306,"sourceCode":"\t\torgAddresses = append(orgAddresses, org.Endpoints()...)\n\t}\n\n\tordererAddresses := bundle.ChannelConfig().OrdererAddresses()\n\tif len(orgAddresses) > 0 {\n\t\tif len(ordererAddresses) > 0 {\n\t\t\tlogger.Warningf(\"Deprecated global OrdererAddresses exist: %s; ignoring them\", ordererAddresses)\n\t\t}\n\t\treturn orgAddresses, nil\n\t}\n\n\tlogger.Warningf(\"Org specific endpoints are missing, returning (deprecated) global OrdererAddresses: %s; \", ordererAddresses)\n\treturn ordererAddresses, nil\n}\n\n// CheckLogLevel checks that a given log level string is valid\nfunc CheckLogLevel(level string) error {\n\tif !flogging.IsValidLevel(level) {\n\t\treturn errors.Errorf(\"invalid log level provided - %s\", level)\n\t}\n\treturn nil\n}\n\nfunc configFromEnv(prefix string) (address string, clientConfig comm.ClientConfig, err error) {\n\taddress = viper.GetString(prefix + \".address\")\n\tclientConfig = comm.ClientConfig{}\n\tconnTimeout := viper.GetDuration(prefix + \".client.connTimeout\")\n\tif connTimeout == time.Duration(0) {\n\t\tconnTimeout = defaultConnTimeout\n\t}\n\tclientConfig.DialTimeout = connTimeout\n\tsecOpts := comm.SecureOptions{\n\t\tUseTLS:             viper.GetBool(prefix + \".tls.enabled\"),\n\t\tRequireClientCert:  viper.GetBool(prefix + \".tls.clientAuthRequired\"),\n\t\tTimeShift:          viper.GetDuration(prefix + \".tls.handshakeTimeShift\"),\n\t\tServerNameOverride: viper.GetString(prefix + \".tls.serverhostoverride\"),\n\t}","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/common/common.go#L288-L324","documentation":"Validation in CheckLogLevel: the supplied log level string is not one of the levels accepted by flogging (e.g. debug/info/warning/error/critical or a named level). The %s is the invalid value passed by the caller (typically the peer node set-loglevel command).","triggerScenarios":"Calling CheckLogLevel (or log-level-set operations that call it) with a string like \"verbose\", \"trace2\", or a misspelled level instead of the accepted ones (debug, info, warning, error, critical, or valid spec strings).","commonSituations":"Typo in FABRIC_LOGGING_SPEC or in a peer CLI command like `peer node loglevel`, case/format mismatch, or passing a module=level spec that flogging cannot parse.","solutions":["Use a valid level: debug, info, warning, error, or critical (case-insensitive)","Check for typos in the level string passed to the command or env var","If using a logging spec (module=level), validate the whole spec syntax","List available levels via flogging docs or `peer logging loglevel` output"],"exampleFix":"// before\nerr := common.CheckLogLevel(\"verbose\")\n// after\nerr := common.CheckLogLevel(\"debug\")","handlingStrategy":"validation","validationCode":"validLevels := []string{\"debug\", \"info\", \"warning\", \"error\", \"critical\"}\nfunc isValidLevel(l string) bool {\n    for _, v := range validLevels {\n        if strings.EqualFold(l, v) { return true }\n    }\n    return false\n}","typeGuard":"func validLogLevel(s string) bool { return flogging.IsValidLevel(s) }","tryCatchPattern":"if err := common.CheckLogLevel(level); err != nil {\n    fmt.Printf(\"%v; allowed: debug|info|warning|error|critical\\n\", err)\n    os.Exit(2)\n}","preventionTips":["Use only the canonical level names (debug/info/warning/error/critical)","Trim and case-normalize user-supplied levels before validating","Validate spec strings (module=level) before applying"],"tags":["fabric","logging","validation","log-level"],"backgroundTag":"invalid-log-level","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}