{"record":{"id":"5e10ace972536839","repo":"Tencent/tinker","slug":"proguard-warning-file-is-not-exist-path-s-5e10ac","errorCode":null,"errorMessage":"proguard warning file is not exist, path=%s","messagePattern":"proguard warning file is not exist, path=(.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"tinker-build/tinker-patch-cli/tool_output/proguard_warning.py","lineNumber":102,"sourceCode":"                    fw.write(data.raw_line)\n                    for line in data.filed_methods:\n                        fw.write(line)\n\n    def remove_warning_mapping(self, mapping, warning):\n        self.read_mapping_file(mapping)\n        self.remove_warning(warning)\n\n    def do_command(self, args):\n        if (len(args) < 2):\n            print_usage()\n\n        mapping_path = args[0]\n        if not os.path.exists(mapping_path):\n            raise Exception(\"mapping file is not exist, path=%s\", mapping_path)\n\n        warning_patch = args[1]\n        if not os.path.exists(warning_patch):\n            raise Exception(\"proguard warning file is not exist, path=%s\", warning_patch)\n\n        self.remove_warning_mapping(mapping_path, warning_patch)\n\n\n\nif __name__ == '__main__':\n    RemoveProguardWarning().do_command(sys.argv[1:])","sourceCodeStart":84,"sourceCodeEnd":109,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-build/tinker-patch-cli/tool_output/proguard_warning.py#L84-L109","documentation":"Raised by the same do_command() in proguard_warning.py (line 102) when args[1] — the proguard warnings file — does not exist. This is the second of the two sequential existence checks (mapping first at line 98, warnings second here), so reaching it means the mapping path was valid but the warnings file path is not. The unformatted '%s' again hides the actual path in the message.","triggerScenarios":"Running the tool with a warnings path that is wrong: the proguard warning capture step was skipped (no build run with -applymapping yet), the file name is misspelled, or a relative path resolves against a different working directory than assumed.","commonSituations":"Scripted applymapping-conflict workflows where the warning-capture stage failed silently earlier in the pipeline; local runs from a different directory than the one where warnings.txt was written; CI artifacts not downloaded before the patch step.","solutions":["Generate the warnings file first: build with -applymapping old_mapping.txt and save proguard's Warning: output to a file.","Verify the path with ls before invoking, and prefer absolute paths.","Make your wrapper fail fast: test -f \"$WARN\" || { echo \"missing $WARN\"; exit 1; }.","Fix message interpolation if you maintain the tool: raise Exception(\"proguard warning file is not exist, path=%s\" % warning_patch)."],"exampleFix":"# before\npython proguard_warning.py mapping.txt warnings.txt  # warnings.txt never created\n\n# after\n./gradlew assembleRelease 2> proguard_err.txt ; grep '^Warning:' proguard_err.txt > warnings.txt\npython proguard_warning.py mapping.txt warnings.txt","handlingStrategy":"validation","validationCode":"import os, sys\nmapping, warnings = sys.argv[1], sys.argv[2]\nfor p in (mapping, warnings):\n    if not os.path.isfile(p):\n        sys.exit('missing input file: %s' % p)","typeGuard":null,"tryCatchPattern":"try:\n    RemoveProguardWarning().do_command(args)\nexcept Exception as e:\n    if 'warning file is not exist' in str(e):\n        sys.exit('generate warnings.txt from a -applymapping build (grep ^Warning:) and rerun')\n    raise","preventionTips":["Produce the warnings file before the patch step: build with -applymapping and capture Warning: lines.","Check the file exists in the shell wrapper (test -f) to get a clear path in the error.","Order CI stages: build -> capture warnings -> merge/strip mapping, so no stage runs with missing artifacts."],"tags":["python","proguard","warnings","cli","file-not-found"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}