{"record":{"id":"65cabe0cb02f65f9","repo":"openimsdk/open-im-server","slug":"invalid-object-enable-s","errorCode":null,"errorMessage":"invalid object enable: %s","messagePattern":"invalid object enable: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/rpc/third/third.go","lineNumber":103,"sourceCode":"\tthirdCache := redis.NewThirdCache(rdb)\n\t// Select the oss method according to the profile policy\n\tvar o s3.Interface\n\tswitch enable := config.RpcConfig.Object.Enable; enable {\n\tcase \"minio\":\n\t\tminioCache := redis.NewMinioCache(rdb)\n\t\to, err = minio.NewMinio(ctx, minioCache, *config.MinioConfig.Build())\n\tcase \"cos\":\n\t\to, err = cos.NewCos(*config.RpcConfig.Object.Cos.Build())\n\tcase \"oss\":\n\t\to, err = oss.NewOSS(*config.RpcConfig.Object.Oss.Build())\n\tcase \"kodo\":\n\t\to, err = kodo.NewKodo(*config.RpcConfig.Object.Kodo.Build())\n\tcase \"aws\":\n\t\to, err = aws.NewAws(*config.RpcConfig.Object.Aws.Build())\n\tcase \"\":\n\t\to = disable.NewDisable()\n\tdefault:\n\t\terr = fmt.Errorf(\"invalid object enable: %s\", enable)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tuserConn, err := client.GetConn(ctx, config.Discovery.RpcService.User)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlocalcache.InitLocalCache(&config.LocalCacheConfig)\n\tthird.RegisterThirdServer(server, &thirdServer{\n\t\tthirdDatabase: controller.NewThirdDatabase(thirdCache, logdb),\n\t\ts3dataBase:    controller.NewS3Database(rdb, o, s3db),\n\t\tdefaultExpire: time.Hour * 24 * 7,\n\t\tconfig:        config,\n\t\ts3:            o,\n\t\tuserClient:    rpcli.NewUserClient(userConn),\n\t})\n\treturn nil","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/openimsdk/open-im-server/blob/175a7bb0673eca18e9d1b10bff4f728da6b1b513/internal/rpc/third/third.go#L85-L121","documentation":"The third RPC service's Start selects an object-storage implementation from config.RpcConfig.Object.Enable ('minio', 'cos', 'oss', 'kodo', 'aws', or empty to disable). An unrecognized value hits the default branch and returns 'invalid object enable: %s'. The config value must exactly match one of the supported provider keys.","triggerScenarios":"config.RpcConfig.Object.Enable is set to a string not handled by the switch — typo (e.g. 'Minio', 'minIO'), wrong provider name ('s3' instead of 'aws'), or garbage — during third service startup.","commonSituations":"Hand-edited config.yml with a misspelled object.enable; migrating between providers and leaving a placeholder value; docs vs code drift where a provider isn't supported in this version.","solutions":["Set object.enable in the config to one of: minio, cos, oss, kodo, aws (or leave empty to disable object storage)","Check for case sensitivity/typos in the enable value","Upgrade/downgrade to a version that supports the intended provider if it isn't in the switch"],"exampleFix":"// before (config.yml)\nobject: { enable: s3 }\n// after\nobject: { enable: aws }","handlingStrategy":"validation","validationCode":"var validObjectStores = map[string]bool{\"minio\": true, \"cos\": true, \"oss\": true, \"kodo\": true, \"aws\": true, \"\": true}\nif !validObjectStores[strings.ToLower(cfg.Object.Enable)] {\n\treturn fmt.Errorf(\"object.enable must be one of minio|cos|oss|kodo|aws or empty, got %q\", cfg.Object.Enable)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only documented values for object.enable (lowercase)","Lint/validate config.yml at deploy time","Leave enable empty to disable object storage instead of inventing a value"],"tags":["configuration","object-storage","startup"],"backgroundTag":"invalid-config-value","analyzedSha":"175a7bb0673eca18e9d1b10bff4f728da6b1b513","analyzedAt":"2026-09-04T16:52:56.821Z","contentChangedAt":"2026-09-04T16:52:56.821Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}