{"record":{"id":"dff00134006066a8","repo":"rocksdanister/lively","slug":"livelyinfo-json-not-found-dff001","errorCode":null,"errorMessage":"LivelyInfo.json not found","messagePattern":"LivelyInfo\\.json not found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Lively/Lively.Common/Helpers/Archive/ZipExtract.cs","lineNumber":30,"sourceCode":"{\n    public static class ZipExtract\n    {\n\n        /// <summary>\n        /// Extract zip file to given output directory.\n        /// </summary>\n        /// <param name=\"archivePath\">Source .zip path.</param>\n        /// <param name=\"outFolder\">Destination directory.</param>\n        /// <param name=\"isLivelyFile\">Verify whether the archive is lively wallpaper format, throws Exception if not.</param>\n        public static void ZipExtractFile(string archivePath, string outFolder, bool isLivelyFile)\n        {\n            using (Stream fsInput = File.OpenRead(archivePath))\n            using (var zf = new ZipFile(fsInput))\n            {\n\n                if (isLivelyFile && zf.FindEntry(\"LivelyInfo.json\", true) == -1)\n                {\n                    throw new Exception(\"LivelyInfo.json not found\");\n                }\n\n                //long i = 0;\n                foreach (ZipEntry zipEntry in zf)\n                {\n                    //progress\n                    //float percentage = (float)++i / zf.Count;\n                    //Debug.WriteLine(percentage + \" \" + zipEntry.Name);\n\n                    if (!zipEntry.IsFile)\n                    {\n                        // Ignore directories\n                        continue;\n                    }\n\n                    String entryFileName = zipEntry.Name;\n                    // to remove the folder from the entry:\n                    //entryFileName = Path.GetFileName(entryFileName);","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/rocksdanister/lively/blob/c1036feb664960722e34bf4309042c247d6a909d/src/Lively/Lively.Common/Helpers/Archive/ZipExtract.cs#L12-L48","documentation":"Thrown by ZipExtractFile when isLivelyFile is true and the archive has no top-level 'LivelyInfo.json' entry (zf.FindEntry returns -1). It is the archive-level equivalent of error 0: the zip is not a valid lively wallpaper package. Note it throws the base System.Exception, which weakens catchability.","triggerScenarios":"ZipExtractFile(archivePath, outFolder, isLivelyFile: true) on a .zip/.lwzip that is missing the LivelyInfo.json entry — e.g. a plain wallpaper zip, a repackaged archive that dropped the manifest, or a corrupt/partial zip.","commonSituations":"User drags in an arbitrary .zip that just happens to share the package extension; archive re-compressed externally and manifest moved into a subfolder (FindEntry expects it at root); truncated download.","solutions":["Confirm the archive genuinely is a lively package (root-level LivelyInfo.json); open it and inspect entries.","Re-download or re-export the wallpaper package from the source that produced it.","If maintaining the lib, throw a typed exception (e.g. InvalidDataException) so callers can branch instead of catching Exception."],"exampleFix":"// before\nif (isLivelyFile && zf.FindEntry(\"LivelyInfo.json\", true) == -1)\n    throw new Exception(\"LivelyInfo.json not found\");\n\n// after\nif (isLivelyFile && zf.FindEntry(\"LivelyInfo.json\", true) == -1)\n    throw new InvalidDataException(\"Archive is not a lively wallpaper package: missing LivelyInfo.json\");","handlingStrategy":"validation","validationCode":"bool IsLivelyArchive(string archivePath)\n{\n    using var fs = File.OpenRead(archivePath);\n    using var zf = new ZipFile(fs);\n    return zf.FindEntry(\"LivelyInfo.json\", true) != -1;\n}\n// call before ZipExtractFile(..., isLivelyFile: true)","typeGuard":"static bool IsLivelyZip(string archivePath)\n{\n    try\n    {\n        using var fs = File.OpenRead(archivePath);\n        using var zf = new ZipFile(fs);\n        return zf.FindEntry(\"LivelyInfo.json\", true) != -1;\n    }\n    catch { return false; }\n}","tryCatchPattern":"try { ZipExtractFile(path, out, isLivelyFile: true); }\ncatch (Exception ex) when (ex.Message.Contains(\"LivelyInfo.json not found\"))\n{ /* report invalid package to user */ }","preventionTips":["Validate the archive is a lively package (root LivelyInfo.json) before extracting with isLivelyFile=true.","Reject renamed ordinary zips at the UI layer before they reach extraction.","Prefer a typed exception if you maintain the library."],"tags":["zip","archive","validation","wallpaper","manifest"],"backgroundTag":null,"analyzedSha":"c1036feb664960722e34bf4309042c247d6a909d","analyzedAt":"2026-08-13T13:03:12.648Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}