{"record":{"id":"4cfb9aea5d5311f2","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-latest-firestore-release-w","errorCode":null,"errorMessage":"failed to get latest Firestore release: %w","messagePattern":"failed to get latest Firestore release: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/firestore/firestore.go","lineNumber":461,"sourceCode":"\t\tcollData := make(map[string]any)\n\t\tcollData[\"id\"] = collRef.ID\n\t\tcollData[\"path\"] = collRef.Path\n\n\t\t// If this is a subcollection, include parent information\n\t\tif collRef.Parent != nil {\n\t\t\tcollData[\"parent\"] = collRef.Parent.Path\n\t\t}\n\t\tresults[i] = collData\n\t}\n\treturn results, nil\n}\n\nfunc (s *Source) GetRules(ctx context.Context) (any, error) {\n\t// Get the latest release for Firestore\n\treleaseName := fmt.Sprintf(\"projects/%s/releases/cloud.firestore/%s\", s.GetProjectId(), s.GetDatabaseId())\n\trelease, err := s.FirebaseRulesClient().Projects.Releases.Get(releaseName).Context(ctx).Do()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get latest Firestore release: %w\", err)\n\t}\n\n\tif release.RulesetName == \"\" {\n\t\treturn nil, fmt.Errorf(\"no active Firestore rules were found in project '%s' and database '%s'\", s.GetProjectId(), s.GetDatabaseId())\n\t}\n\n\t// Get the ruleset content\n\truleset, err := s.FirebaseRulesClient().Projects.Rulesets.Get(release.RulesetName).Context(ctx).Do()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get ruleset content: %w\", err)\n\t}\n\n\tif ruleset.Source == nil || len(ruleset.Source.Files) == 0 {\n\t\treturn nil, fmt.Errorf(\"no rules files found in ruleset\")\n\t}\n\n\treturn ruleset, nil\n}","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/firestore/firestore.go#L443-L479","documentation":"Error \"failed to get latest Firestore release: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/firestore/firestore.go:461 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}