Skip to content

Log response body when failing to download http sources #21964

Open
@chris-smith-zocdoc

Description

@chris-smith-zocdoc

Is your feature request related to a problem? Please describe.
Sometimes http_source sources are unreliable and may produce 5xx responses, or clients may configure the wrong credentials resulting in a 4xx response. Pants makes this difficult to troubleshoot right now because only the status code is logged under debug logger.

Describe the solution you'd like
In the event of a error response, log the complete response body

Additional context
Related to #21955 where S3 produces a detailed error response, but its not visible the pants output.

In the case of S3, it might look something like

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>User: foo is not authorized to perform: s3:GetObject on resource: "arn::..." because no identity-based policy allows the s3:GetObject action</Message><RequestId>123</RequestId><HostId>456</HostId></Error>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    diagnosticsPoor diagnostics, error messages that could be improvedenhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions