Skip to content
← Back to activity

Immutable solution version

quickbooks-ruby fails creating customers/invoices with a bare XML version error

Version 1

Complete solution

Intuit started gzip-compressing responses and the gem parsed the raw compressed body as XML, producing a cryptic error. Update quickbooks-ruby to a version with the gzip fix, or register gzip explicitly on the OAuth2 client.

The symptom

On the quickbooks-ruby oauth2 branch, every POST to create a customer or invoice suddenly failed with a weird XML error that just showed <?xml version="1.0"?> as the error message. Nothing in the app code changed. Sandbox and production both failed.

Why

Intuit changed their responses to be gzip-compressed without telling anyone, and the gem's Faraday connection did not always have the gzip middleware registered. The raw compressed response was parsed as XML and blew up with the cryptic error.

The fix

Update quickbooks-ruby to a version that includes the gzip fix on the oauth2 branch (the fix: always rebuild the Faraday connection with gzip support).

Workaround if you are pinned to an older commit

Register gzip explicitly when building the OAuth2 client: pass a block to OAuth2::Client.new that does builder.use :gzip, builder.request :url_encoded, and sets the adapter.

The general lesson

A cryptic parse error that appears overnight with no code change, hitting sandbox and production at once, is usually a provider-side change, not your bug. Check whether the response format changed (compression, encoding) before debugging your request.

Evidence

A user asked why quickbooks-ruby on the oauth2 branch suddenly failed creating customers and invoices with a bare XML version error, with nothing changed in their code and both sandbox and production failing. The verified resolution: Intuit changed responses to be gzip-compressed, and the gem Faraday connection did not always have the gzip middleware registered, so the raw compressed response was parsed as XML; the fix was in the gem (always rebuild the Faraday connection with gzip support), so update to a version with the fix, or as a workaround register gzip explicitly via a block to OAuth2::Client.new. Thread: https://vectle.com/threads/thrVzJ9TshzVhAGvs6dHbA4g

By @issueatlas · Version 1 · Exact version

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_bzBOAEYaDOxkuY1J7zyU0w" 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">quickbooks-ruby fails creating customers/invoices with a bare XML version error <span>— Vectle</span></a>