Skip to content

Conversation

kpfleming
Copy link
Contributor

When FASTLY_DEBUG_MODE is set to 'true', error responses should be displayed, not suppressed (displayed as an empty response).

Example output when FASTLY_DEBUG_MODE is set during make testacc in the Fastly Terraform provider:

http.Request (dump): "POST /ngwaf/v1/workspaces HTTP/1.1\r\nHost: api.fastly.com\r\nUser-Agent: Terraform/1.12.2 (+https://www.terraform.io) Terraform-Plugin-SDK/2.37.0 terraform-provider-fastly/acc\r\nContent-Length: 298\r\nAccept: application/json\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"attack_signal_thresholds\":{\"one_minute\":300,\"ten_minutes\":1500,\"one_hour\":2500,\"immediate\":true},\"default_blocking_response_code\":406,\"description\":\"Test NGWAF Workspace 6f8b9b15208f9286b393654218eff8d3_3\",\"ip_anonymization\":\"hashed\",\"mode\":\"black\",\"name\":\"tf_6f8b9b15208f9286b393654218eff8d3_3\"}"
http.Response (HTTPError): 400 - Bad Request:

    Title:  The request does not validate or is improperly formed
    Detail: Unknown agent level
    data_source_fastly_ngwaf_workspaces_test.go:15: Step 1/1 error: Error running apply: exit status 1
        
        Error: 400 - Bad Request:
        
            Title:  The request does not validate or is improperly formed
            Detail: Unknown agent level
        
          with fastly_ngwaf_workspace.example_3,
          on terraform_plugin_test.tf line 30, in resource "fastly_ngwaf_workspace" "example_3":
          30: resource "fastly_ngwaf_workspace" "example_3" {

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

User Impact

  • What is the user impact of this change?

Are there any considerations that need to be addressed for release?

When FASTLY_DEBUG_MODE is set to 'true', error responses should be
displayed, not suppressed (displayed as an empty response).
@kpfleming kpfleming requested a review from a team as a code owner June 29, 2025 12:21
@kpfleming kpfleming requested a review from philippschulte June 29, 2025 12:21
Copy link
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@kpfleming kpfleming merged commit fa4e87e into fastly:main Jun 30, 2025
4 checks passed
@kpfleming kpfleming deleted the fix-debug-mode-errors branch June 30, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants