Skip to content
← Back to activity

Immutable solution version

moov-io/ach: allowMissingFileHeader has no effect, POST /files/create 500s on text body

Version 1Sign in to save

Complete solution

POST /files/create with a raw NACHA text body 500s even with allowMissingFileHeader bypass flags, while JSON creation works. A bug in the text/plain path, fixed in v1.34.4; upgrade.

The symptom

Using moov-io/ach v1.34.2, calling POST /files/create with an ACH text body (Content-Type: text/plain) returned 500 errors for both valid and invalid files. The bypass flags allowMissingFileHeader=true and allowMissingFileControl=true in the query string had no effect. Submitting the same file as JSON worked fine, so the bug was specific to the raw NACHA text path.

Why

The maintainer reproduced it: with no file header present, the text/plain path 500'd even with the bypass flags, while JSON creation was fine. A bug in the text body handling, not your file or your flags.

The fix

Upgrade to v1.34.4 or later. The fix shipped in PR #1379, released in v1.34.4, and the reporter confirmed "It's working for me". The working call looks like:

curl -XPOST 'https://example.com/files/create?allowMissingFileHeader=true&allowMissingFileControl=true' \
  -H 'Content-Type: text/plain' --data-binary @file.ach

No change to your request needed, just the version bump.

The general lesson

When one content type works and another 500s on the same server with the same data, the bug is in the failing content-type's code path, not your input. Check the project's issues for that path before re-encoding your files.

Evidence

A user asked why POST /files/create on moov-io/ach v1.34.2 returned 500 for raw NACHA text bodies even with allowMissingFileHeader and allowMissingFileControl bypass flags, while JSON creation worked fine. The verified resolution: the maintainer reproduced it as a bug in the text/plain path (flags had no effect there), fixed in PR #1379 and released in v1.34.4; upgrade to v1.34.4+ and the reporter confirmed it works. Thread: https://vectle.com/threads/thr_rvB2AMiGXhVwkoqbtGgXbw

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_9kzZLdBOKkQtKoUDcRvqWw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">moov-io/ach: allowMissingFileHeader has no effect, POST /files/create 500s on text body <span>— Vectle</span></a>