{"record":{"id":"6c133baa572d0a34","repo":"qishibo/AnotherRedisDesktopManager","slug":"zlib-gzip-parse-failed","errorCode":null,"errorMessage":"Zlib Gzip Parse Failed!","messagePattern":"Zlib Gzip Parse Failed!","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/viewers/ViewerGzip.vue","lineNumber":26,"sourceCode":"\nconst zlib = require('zlib');\n\nexport default {\n  components: { JsonEditor },\n  props: ['content'],\n  computed: {\n    newContent() {\n      const { formatStr } = this;\n\n      if (typeof formatStr === 'string') {\n        if (this.$util.isJson(formatStr)) {\n          return JSONbig.parse(formatStr);\n        }\n\n        return formatStr;\n      }\n\n      return 'Zlib Gzip Parse Failed!';\n    },\n    formatStr() {\n      return this.$util.zippedToString(this.content, 'gzip');\n    },\n  },\n  methods: {\n    getContent() {\n      const content = this.$refs.editor.getRawContent(true);\n      return zlib.gzipSync(content);\n    },\n    copyContent() {\n      return this.formatStr;\n    },\n  },\n};\n</script>\n","sourceCodeStart":8,"sourceCodeEnd":43,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/viewers/ViewerGzip.vue#L8-L43","documentation":"Placeholder string shown in the gzip viewer's decoded-content pane when decompression fails. formatStr calls $util.zippedToString(content, 'gzip') (src/util.js:164), which runs zlib.gunzipSync and returns the decoded UTF-8 string — or false on any throw or empty result. newContent falls back to 'Zlib Gzip Parse Failed!' whenever formatStr is not a string, so the message means: the stored bytes are not a valid gzip stream.","triggerScenarios":"Viewing a key whose type is detected/labeled gzip but whose bytes lack the gzip magic (1f 8b) or are truncated; double-gzip data; zlib.gunzipSync throwing 'incorrect header check' or 'unexpected end of file'; decompressed length 0 also maps to false.","commonSituations":"Values compressed with raw deflate instead of gzip; payload encrypted before compression; partial writes/corruption; content type misdetected because a previous key in the session was gzip.","solutions":["Check the value is really gzip: first bytes should be 1f 8b (hex view)","If it is raw deflate, deflateRaw, or brotli, switch the viewer mode accordingly","Inspect in the binary/hex viewer for truncation or an encryption layer","If you control the writer, verify it flushes complete gzip streams (e.g. gzipSync vs streaming Gzip without .end())"],"exampleFix":"// before\nreturn 'Zlib Gzip Parse Failed!';\n\n// after - surface the zlib reason\n// in util.js, return the error for display\ntry {\n  return zlib.gunzipSync(buf).toString();\n} catch (e) {\n  return `Zlib Gzip Parse Failed: ${e.message}`;\n}","handlingStrategy":"type-guard","validationCode":"const ok = typeof this.$util.zippedToString(buf, 'gzip') === 'string';\nif (!ok) { /* do not render gzip viewer; fall back to hex */ }","typeGuard":"// same predicate the app itself uses (src/util.js isGzip)\nconst isGzip = (buf) => typeof $util.zippedToString(buf, 'gzip') === 'string';","tryCatchPattern":null,"preventionTips":["Producers: write complete gzipSync output (no unterminated streaming Gzip)","Consumers: switch viewer by detection (isGzip/isDeflate/isBrotli in util.js) instead of hardcoding the mode","Hex-check the 1f 8b magic when detection disagrees with expectation"],"tags":["gzip","zlib","decompression","vue","redis-viewer"],"backgroundTag":"zlib-decompress-failed","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}