Skip to content

Adobe CF (2023 + 2025): cfheader(attributeCollection) throws 'Failed to add HTML header' — blocks all tests #2741

Closed

Description

@bpamiri

Describe the bug

On Adobe ColdFusion 2023, every request to the test endpoint (and likely every Wheels request in general) fails with:

Failed to add HTML header.
ColdFusion was unable to add the header you specified to the output stream. This is probably because you have already used a cfflush tag in your template or buffered output is turned off.

The error occurred in /wheels-test-suite/vendor/wheels/Global.cfc: line 123
Called from /wheels-test-suite/vendor/wheels/events/EventMethods.cfc: line 113
Called from /wheels-test-suite/vendor/wheels/Global.cfc: line 248
Called from /wheels-test-suite/vendor/wheels/Global.cfc: line 41
Called from /wheels-test-suite/public/Application.cfc: line 308

121 :   cfheader(attributeCollection = "#local.args#");
122 : } else {
123 :   cfheader(attributeCollection = "#arguments#");
124 : }

The compat-matrix Adobe 2023 job records 0 pass / 0 fail / 0 err because no test request gets past application boot — every spec file's HTTP request returns the Wheels error HTML page rather than the test results JSON.

Reproduction

  1. Run tools/test-matrix.sh adobe2023 mysql (any DB)
  2. Watch every result fail JSON parsing — the body is the Wheels error page
  3. Or: curl http://localhost:62023/wheels/core/tests?db=mysql — same error

Evidence

Compat-matrix run 25978222394 (develop, 2026-05-17). Adobe 2023 artifact (test-results-adobe2023) contains HTML for every DB.

Suspected cause

The cfheader(attributeCollection = "#arguments#") call at vendor/wheels/Global.cfc:123 — passing arguments directly. Adobe 2023 likely rejects this shape (maybe expects a struct rather than the arguments scope, or stricter validation than Lucee/BoxLang/Adobe 2021).

The call site is on the dispatch path (EventMethods.cfc:113 → Global.cfc:248 → Global.cfc:41), so every controller action hits it. Lucee 6/7 and BoxLang pass through without issue.

Expected behavior

cfheader(attributeCollection=…) should work cross-engine. Either the call shape needs adjustment for Adobe 2023, or the helper needs to bridge arguments to a plain struct before calling cfheader.

Pending: confirm Adobe 2025 status

The same run's adobe2025 job was still in progress at filing time. If 2025 hits the same regression, this issue covers both versions.

Desktop

  • OS: Any
  • CFML Engine: Adobe ColdFusion 2023

Activity

  1. wheels-bot commented on May 17, 2026

    @wheels-bot
    Contributor

    Wheels Bot — Triage

    Classified as bug.

    Suspected layer

    controller — see .ai/wheels/controllers/ for canonical patterns, and .ai/wheels/cross-engine-compatibility.md for the Adobe-CF-specific gotchas that apply here. The defect is in the global $header helper that controllers and the dispatch path call to emit HTTP response headers.

    Fix sketch

    vendor/wheels/Global.cfc:112-125 — the $header() function calls cfheader(attributeCollection = "#arguments#"), passing the arguments scope directly. Adobe CF 2023 rejects this shape (Lucee 6/7 and BoxLang accept it). The same function already has the pattern needed for the fix: the statusText branch above copies arguments into a plain local.args struct before calling cfheader. Apply that same copy unconditionally so every call path hands cfheader a plain struct, not the arguments scope. One file, no API change, no caller updates. Verify on Adobe 2023 via tools/test-matrix.sh adobe2023 sqlite (and re-check Adobe 2025 once that job finishes — the issue body flags it as pending).

    Confidence: medium

    Report and fix location are unambiguous and the shape is mechanical, but cross-engine concern (Adobe-vs-Lucee-vs-BoxLang cfheader parsing) fires the auto-downgrade rule — at most medium.

    <!-- wheels-bot:triage:2741 -->
    <!-- wheels-bot:triage-class:bug -->
    <!-- wheels-bot:triage-confidence:medium -->

  2. wheels-bot commented on May 17, 2026

    @wheels-bot
    Contributor

    Wheels Bot — Fix proposed

    Draft PR: #2751

    Spec: vendor/wheels/tests/specs/global/headerSpec.cfc — covers name/value, statuscode, charset, and statuscode+statusText call shapes. Passes locally on Lucee 7 both before and after the fix (Lucee already accepts the arguments scope), so it documents the cross-engine contract; the failure manifests on Adobe 2023 only and will be verified by the compat-matrix job once the PR runs CI.

    Implementation: vendor/wheels/Global.cfc — $header() now copies the arguments scope into a plain struct (and strips statusText for Adobe CF 2025 compatibility) before invoking cfheader(attributeCollection=...), collapsing the previous two-branch shape into one uniform code path.

    A human review is required before merge. Reviewer A and Reviewer B will weigh in shortly. Doc updates (MDX guides, .ai/wheels/, CLAUDE.md) are handled separately by bot-update-docs.yml.

  3. bpamiri commented on May 18, 2026

    @bpamiri
    CollaboratorAuthor

    Adobe 2025 update — same regression

    The Adobe 2025 job from run 25978222394 finished after this issue was filed. Confirmed: Adobe 2025 hits the exact same cfheader(attributeCollection) failure at vendor/wheels/Global.cfc:123 on every DB (cockroachdb, mysql, oracle, postgres, sqlite, sqlserver — all return the Wheels error HTML page).

    So both Adobe 2023 and Adobe 2025 are wholesale blocked by this regression. Scope of this issue should be read as "Adobe ColdFusion (2023 + 2025)" rather than 2023-only.

  4. changed the title [-]Adobe 2023: cfheader(attributeCollection) throws 'Failed to add HTML header' — blocks all tests[/-] [+]Adobe CF (2023 + 2025): cfheader(attributeCollection) throws 'Failed to add HTML header' — blocks all tests[/+] on May 18, 2026
  5. added a commit that references this issue on May 19, 2026
    afcd208
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions