{"record":{"id":"e776bd9c32cca11f","repo":"usememos/memos","slug":"name-is-required","errorCode":null,"errorMessage":"name is required","messagePattern":"name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"store/deployment_config.go","lineNumber":166,"sourceCode":"\t}\n\tif err := (protojson.UnmarshalOptions{DiscardUnknown: false}).Unmarshal(content, message); err != nil {\n\t\tif matches := protoJSONUnknownFieldMatcher.FindStringSubmatch(err.Error()); len(matches) == 2 {\n\t\t\treturn errors.Errorf(\"failed to decode protobuf JSON: unknown field %q\", matches[1])\n\t\t}\n\t\treturn errors.New(\"failed to decode protobuf JSON; verify field names, value types, and JSON syntax\")\n\t}\n\treturn nil\n}\n\nfunc validateDeploymentIdentityProvider(provider *storepb.IdentityProvider) error {\n\tif provider.Id != 0 {\n\t\treturn errors.New(\"id must be omitted\")\n\t}\n\tif !base.UIDMatcher.MatchString(provider.Uid) {\n\t\treturn errors.New(\"uid is invalid\")\n\t}\n\tif strings.TrimSpace(provider.Name) == \"\" {\n\t\treturn errors.New(\"name is required\")\n\t}\n\tif provider.Type != storepb.IdentityProvider_OAUTH2 {\n\t\treturn errors.New(\"type must be OAUTH2\")\n\t}\n\tif provider.IdentifierFilter != \"\" {\n\t\tif _, err := regexp.Compile(provider.IdentifierFilter); err != nil {\n\t\t\treturn errors.Wrap(err, \"identifierFilter must be a valid regular expression\")\n\t\t}\n\t}\n\tconfig := provider.Config.GetOauth2Config()\n\tif config == nil {\n\t\treturn errors.New(\"config.oauth2Config is required\")\n\t}\n\trequired := []struct {\n\t\tname  string\n\t\tvalue string\n\t}{\n\t\t{name: \"clientId\", value: config.ClientId},","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/usememos/memos/blob/14d757ce1fb31c78590f374bc042f8dbedbc20d7/store/deployment_config.go#L148-L184","documentation":"Thrown when validating an identity-provider deployment file (memos-idp-*.json) whose 'name' field is empty or whitespace-only after trimming. The name is the human-readable label shown on the sign-in page, so a blank name makes the IdP unusable. The error aborts startup loading of /etc/secrets and is wrapped with the offending filename.","triggerScenarios":"A memos-idp-*.json that omits the \"name\" key entirely, sets it to \"\", or sets it to \"   \".","commonSituations":"Hand-minimal JSON where the author assumed uid doubles as the display name; template substitution (e.g. envsubst) producing an empty name; YAML-to-JSON conversion dropping the field.","solutions":["Add a non-empty \"name\" to the memos-idp-*.json file, e.g. \"name\": \"GitHub\".","If the name comes from a templating step, verify the rendered JSON actually contains the value before deploying."],"exampleFix":"// before\n{ \"uid\": \"github\", \"type\": \"OAUTH2\", \"config\": { ... } }\n\n// after\n{ \"uid\": \"github\", \"name\": \"GitHub\", \"type\": \"OAUTH2\", \"config\": { ... } }","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(name) == \"\" {\n    return errors.New(\"idp name must not be blank\")\n}","typeGuard":"func hasDisplayName(name string) bool { return strings.TrimSpace(name) != \"\" }","tryCatchPattern":null,"preventionTips":["Treat name and uid as a required pair in any IdP template.","After rendering templated deployment files, assert the rendered JSON still has non-empty values."],"tags":["configuration","validation","identity-provider","startup"],"backgroundTag":null,"analyzedSha":"14d757ce1fb31c78590f374bc042f8dbedbc20d7","analyzedAt":"2026-08-15T09:27:36.538Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}