gzip: stdin: not in gzip format 🐧 Linux

gzip: stdin: not in gzip format / tar: Error is not recoverable: exiting now

The file isn’t actually a gzip archive — often an HTML error page saved by curl/wget, or an archive with a different compression.

Seen on: Linux

Meaning

Downloading without following redirects (curl without -L) or from a URL requiring login saves an HTML page with a .tar.gz name. The file may also be plain tar, xz or zstd.

Common causes

  • curl without -L saved a redirect/HTML page
  • Download needs authentication (saved login page)
  • Archive is .tar, .tar.xz or .zst, not gzip
  • Incomplete download

⚡ Quick fix

  1. Check the real type: file archive.tar.gz
  2. Re-download with curl -L (and auth)
  3. Let tar auto-detect: tar -xf archive

Detailed fix by platform

Linux

  1. bash
    file app.tar.gz
    head -c 200 app.tar.gz   # HTML?
    curl -fLO https://example.com/app.tar.gz
    tar -xf app.tar.gz

How to diagnose

  1. Type — file output
  2. Size — Suspiciously small?
  3. URL — Redirects/auth?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.