From 08f708eb71517cd9598ee5ce3c25a71eededd12e Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sat, 28 Mar 2026 09:26:19 -0700 Subject: [PATCH] Add logging to path mismatch fix handler for diagnosis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fix was failing silently — returning error results without writing to any log. Added info/warning logs at each failure point (missing paths, source not found, path escapes transfer, destination conflict) so Docker path resolution issues can be diagnosed. --- core/repair_worker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/repair_worker.py b/core/repair_worker.py index 64bf5f32..8e45e118 100644 --- a/core/repair_worker.py +++ b/core/repair_worker.py @@ -1973,24 +1973,30 @@ class RepairWorker: rel_from = details.get('from', '') rel_to = details.get('to', '') if not rel_from or not rel_to: + logger.warning("Path mismatch fix: missing from/to in details") return {'success': False, 'error': 'Missing from/to paths in finding details'} transfer = self.transfer_folder src = os.path.normpath(os.path.join(transfer, rel_from)) dst = os.path.normpath(os.path.join(transfer, rel_to)) + logger.info("Path mismatch fix: src=%s dst=%s transfer=%s", src, dst, transfer) + # Safety: both paths must be inside transfer folder transfer_norm = os.path.normpath(transfer) if not src.startswith(transfer_norm + os.sep) or not dst.startswith(transfer_norm + os.sep): + logger.warning("Path mismatch fix: path escapes transfer folder. src=%s, dst=%s, transfer=%s", src, dst, transfer_norm) return {'success': False, 'error': 'Path escapes transfer folder'} if not os.path.isfile(src): # Source may have been moved already — check if destination already exists if os.path.isfile(dst): return {'success': True, 'action': 'already_moved', 'message': 'File already at expected location'} + logger.warning("Path mismatch fix: source file not found: %s", src) return {'success': False, 'error': f'Source file not found: {rel_from}'} if os.path.exists(dst) and not os.path.samefile(src, dst): + logger.warning("Path mismatch fix: destination already exists (different file): %s", dst) return {'success': False, 'error': 'Destination already exists (different file)'} try: