{"record":{"id":"9a9db3fe6a8ac14d","repo":"gradle/gradle","slug":"unable-to-create-gzip-output-stream-for-file-s","errorCode":null,"errorMessage":"Unable to create gzip output stream for file %s.","messagePattern":"Unable to create gzip output stream for file (.+?)\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"platforms/core-configuration/file-operations/src/main/java/org/gradle/api/internal/file/archive/compression/GzipArchiver.java","lineNumber":50,"sourceCode":"        super(resource);\n    }\n\n    @Override\n    protected String getSchemePrefix() {\n        return \"gzip:\";\n    }\n\n    public static ArchiveOutputStreamFactory getCompressor() {\n        // this is not very beautiful but at some point we will\n        // get rid of ArchiveOutputStreamFactory in favor of the writable Resource\n        return destination -> {\n            OutputStream outStr = new FileOutputStream(destination);\n            try {\n                return new GZIPOutputStream(outStr);\n            } catch (Exception e) {\n                IoActions.closeQuietly(outStr);\n                String message = String.format(\"Unable to create gzip output stream for file %s.\", destination);\n                throw new RuntimeException(message, e);\n            }\n        };\n    }\n\n    @Override\n    public InputStream read() {\n        InputStream input = new BufferedInputStream(resource.read());\n        try {\n            return new GZIPInputStream(input);\n        } catch (Exception e) {\n            IoActions.closeQuietly(input);\n            throw ResourceExceptions.readFailed(resource.getDisplayName(), e);\n        }\n    }\n}\n","sourceCodeStart":32,"sourceCodeEnd":66,"githubUrl":"https://github.com/gradle/gradle/blob/534f27719b66953f95cc907aae7f2c1b12f5482d/platforms/core-configuration/file-operations/src/main/java/org/gradle/api/internal/file/archive/compression/GzipArchiver.java#L32-L66","documentation":"Gradle throws this error when the following condition is violated: Unable to create gzip output stream for file <value>.","triggerScenarios":"Thrown at platforms/core-configuration/file-operations/src/main/java/org/gradle/api/internal/file/archive/compression/GzipArchiver.java:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the archive file exists and is a valid, non-corrupted archive.","Specify the compression explicitly if the archive extension is misleading."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"534f27719b66953f95cc907aae7f2c1b12f5482d","analyzedAt":"2026-08-22T08:09:12.375Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}