{"record":{"id":"70ee28865fbeb628","repo":"Tencent/WeKnora","slug":"engine-id-is-required-for-google-provider","errorCode":null,"errorMessage":"engine ID is required for Google provider","messagePattern":"engine ID is required for Google provider","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/web_search_provider.go","lineNumber":161,"sourceCode":"\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// validateProviderParameters validates required parameters for each provider type\nfunc validateProviderParameters(provider types.WebSearchProviderType, params types.WebSearchProviderParameters) error {\n\tswitch provider {\n\tcase types.WebSearchProviderTypeBing:\n\t\tif params.APIKey == \"\" {\n\t\t\treturn fmt.Errorf(\"API key is required for Bing provider\")\n\t\t}\n\tcase types.WebSearchProviderTypeGoogle:\n\t\tif params.APIKey == \"\" {\n\t\t\treturn fmt.Errorf(\"API key is required for Google provider\")\n\t\t}\n\t\tif params.EngineID == \"\" {\n\t\t\treturn fmt.Errorf(\"engine ID is required for Google provider\")\n\t\t}\n\tcase types.WebSearchProviderTypeTavily:\n\t\tif params.APIKey == \"\" {\n\t\t\treturn fmt.Errorf(\"API key is required for Tavily provider\")\n\t\t}\n\tcase types.WebSearchProviderTypeOllama:\n\t\tif params.APIKey == \"\" {\n\t\t\treturn fmt.Errorf(\"API key is required for Ollama provider\")\n\t\t}\n\tcase types.WebSearchProviderTypeBaidu:\n\t\tif params.APIKey == \"\" {\n\t\t\treturn fmt.Errorf(\"API key is required for Baidu provider\")\n\t\t}\n\tcase types.WebSearchProviderTypeExa:\n\t\tif params.APIKey == \"\" {\n\t\t\treturn fmt.Errorf(\"API key is required for Exa provider\")\n\t\t}\n\tcase types.WebSearchProviderTypeZhipu:","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/web_search_provider.go#L143-L179","documentation":"Parameter validation in validateProviderParameters: the provider type is Google and params.EngineID is empty (the API key may be present). Google Programmable Search requires the custom search engine ID in addition to the key, so the configuration is rejected until an engine ID is supplied.","triggerScenarios":"Thrown at internal/application/service/web_search_provider.go:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set engine_id to the Programmable Search engine (cx) value","Create a search engine in the Google Cloud console if none exists","Re-test the provider config after filling engine ID"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}