Fixing API request failed Error#215
Open
ishree-dev wants to merge 1 commit into
Open
Conversation
tarunz
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resolves a "404 Not Found" API error encountered when calling the Chronicle API's runAnalysis endpoint from the
trigger_github_checksfunction.Problem:
The runAnalysis API call was failing with a 404 error when list_parsers successfully returned one or more parsers for a given log_type. The error message indicated a duplicated segment in the URL path, specifically the
projects/{project}/locations/{location}/instances/{instance}part.Root Cause:
The list_parsers function returns parser objects where the "name" field contains the full resource path (e.g.,
projects/P/locations/L/instances/I/logTypes/LT/parsers/PA). In the original implementation, this full name was being used in conjunction with a base URL construction in chronicle_request that already included the instance path. This led to the instance path being duplicated in the final request URL sent to the Chronicle API.Solution:
The
trigger_github_checksfunction has been updated to correctly construct the endpoint_path for the runAnalysis call:Extract Parser ID: When list_parsers returns one or more parsers, the code now extracts only the parser_id from the "name" field of the first parser.
Relative Endpoint Path: The endpoint_path is now consistently built using the format
logTypes/{log_type}/parsers/{parser_id}:runAnalysis. This path is relative to the Chronicle instance.Fallback Consistency: The fallback case, where list_parsers finds no parsers, already used a relative path (
logTypes/{log_type}/parsers/-:runAnalysis), so the updated logic aligns with this structure.