{"record":{"id":"f721db2a91f0ae5f","repo":"usememos/memos","slug":"notificationsetting-must-be-populated-for-key-noti","errorCode":null,"errorMessage":"notificationSetting must be populated for key NOTIFICATION","messagePattern":"notificationSetting must be populated for key NOTIFICATION","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"store/deployment_config.go","lineNumber":273,"sourceCode":"\t\t\t\t{name: \"accessKeyId\", value: s3Config.AccessKeyId},\n\t\t\t\t{name: \"accessKeySecret\", value: s3Config.AccessKeySecret},\n\t\t\t\t{name: \"endpoint\", value: s3Config.Endpoint},\n\t\t\t\t{name: \"region\", value: s3Config.Region},\n\t\t\t\t{name: \"bucket\", value: s3Config.Bucket},\n\t\t\t} {\n\t\t\t\tif strings.TrimSpace(field.value) == \"\" {\n\t\t\t\t\treturn errors.Errorf(\"storageSetting default S3 config.%s is required\", field.name)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase storepb.InstanceSettingKey_MEMO_RELATED:\n\t\tif setting.GetMemoRelatedSetting() == nil {\n\t\t\treturn errors.New(\"memoRelatedSetting must be populated for key MEMO_RELATED\")\n\t\t}\n\tcase storepb.InstanceSettingKey_NOTIFICATION:\n\t\tnotification := setting.GetNotificationSetting()\n\t\tif notification == nil {\n\t\t\treturn errors.New(\"notificationSetting must be populated for key NOTIFICATION\")\n\t\t}\n\t\tif email := notification.Email; email != nil && email.Enabled {\n\t\t\tif strings.TrimSpace(email.SmtpHost) == \"\" || email.SmtpPort <= 0 || strings.TrimSpace(email.FromEmail) == \"\" {\n\t\t\t\treturn errors.New(\"enabled notification email requires smtpHost, a positive smtpPort, and fromEmail\")\n\t\t\t}\n\t\t\tif email.UseTls && email.UseSsl {\n\t\t\t\treturn errors.New(\"notification email cannot enable both useTls and useSsl\")\n\t\t\t}\n\t\t}\n\tcase storepb.InstanceSettingKey_AI:\n\t\tif setting.GetAiSetting() == nil {\n\t\t\treturn errors.New(\"aiSetting must be populated for key AI\")\n\t\t}\n\t\tif err := normalizeDeploymentAISetting(setting.GetAiSetting()); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase storepb.InstanceSettingKey_BASIC, storepb.InstanceSettingKey_TAGS:\n\t\treturn errors.Errorf(\"key %s cannot be deployment configured\", setting.Key)","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/usememos/memos/blob/14d757ce1fb31c78590f374bc042f8dbedbc20d7/store/deployment_config.go#L255-L291","documentation":"Thrown when an instance-setting deployment file declares \"key\": \"NOTIFICATION\" but its notificationSetting payload message is nil. The notificationSetting carries the email/SMTP configuration; a NOTIFICATION file without it would configure nothing, so the loader fails at startup. Note the enum name: in the deployment JSON the key is written as \"NOTIFICATION\".","triggerScenarios":"A memos-instance-setting-notification.json with only { \"key\": \"NOTIFICATION\" }, or a payload key typo like \"notification_setting\" leaving the oneof unset.","commonSituations":"Placeholder files created before SMTP details are known; converting an admin-API settings dump where the notification payload was nested differently.","solutions":["Add a \"notificationSetting\" object, e.g. { \"key\": \"NOTIFICATION\", \"notificationSetting\": { \"email\": { \"enabled\": true, ... } } }.","Check the exact payload key notificationSetting."],"exampleFix":"// before\n{ \"key\": \"NOTIFICATION\" }\n\n// after\n{ \"key\": \"NOTIFICATION\", \"notificationSetting\": { \"email\": { \"enabled\": false } } }","handlingStrategy":"validation","validationCode":"if setting.Key == storepb.InstanceSettingKey_NOTIFICATION && setting.GetNotificationSetting() == nil {\n    return errors.New(\"NOTIFICATION setting requires a notificationSetting payload\")\n}","typeGuard":"func hasNotificationPayload(s *storepb.InstanceSetting) bool {\n    return s.GetKey() == storepb.InstanceSettingKey_NOTIFICATION && s.GetNotificationSetting() != nil\n}","tryCatchPattern":null,"preventionTips":["Ship notification files only once SMTP details are provisioned.","Keep the payload key exactly notificationSetting."],"tags":["configuration","validation","instance-setting","notification","startup"],"backgroundTag":null,"analyzedSha":"14d757ce1fb31c78590f374bc042f8dbedbc20d7","analyzedAt":"2026-08-15T09:27:36.538Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}