Type: Bug
Description
Syncing a network path aborts when the folder contains Office lock files:
Syncing: /mapped/path/to/source → <kb-id>
Failed: [Errno 13] Permission denied: '...\\source\\subfolder\\~$document.xlsx'
~$... files are created by Office while a workbook is open and are exclusively locked, so they can't be read.
Root cause
Even with an include filter set, oikb walks the entire tree and reads metadata (hash) for every file before applying the filter:
sources:
- name: source
source: "/mapped/path/to/source"
kb-id: <kb-id>
filter:
include: ["target.xlsx"]
So the scanner hits a locked ~$... file that would never be uploaded anyway, and the whole sync fails.
Expected behavior
- Skip temp/lock files before reading metadata — at minimum
~$*, ~*, *.tmp, hidden files (.*).
- Apply
filter.include/exclude before opening files, so non-matching files are never read.
- Treat
PermissionError as a soft skip (warning: skip <file> (permission denied)) and continue — on network shares, locked files (Excel, Outlook, AV, concurrent users) are normal and should not be a hard failure.
Actual behavior
PermissionError is raised unhandled → the entire sync fails, nothing gets uploaded.
Repro
- Network path containing an office file, for example
.xlsx currently open in Excel (creates ~$...).
- Config pointing at that path, with
filter.include targeting a different file.
- Run sync → error above.
Workaround
Close all open documents in the source folder (removes ~$...), then re-run.
Environment
- OS: Windows 11
- python 3.11 installed with Venv
- oikb version: v0.4.0
Type: Bug
Description
Syncing a network path aborts when the folder contains Office lock files:
~$...files are created by Office while a workbook is open and are exclusively locked, so they can't be read.Root cause
Even with an
includefilter set, oikb walks the entire tree and reads metadata (hash) for every file before applying the filter:So the scanner hits a locked
~$...file that would never be uploaded anyway, and the whole sync fails.Expected behavior
~$*,~*,*.tmp, hidden files (.*).filter.include/excludebefore opening files, so non-matching files are never read.PermissionErroras a soft skip (warning: skip <file> (permission denied)) and continue — on network shares, locked files (Excel, Outlook, AV, concurrent users) are normal and should not be a hard failure.Actual behavior
PermissionErroris raised unhandled → the entire sync fails, nothing gets uploaded.Repro
.xlsxcurrently open in Excel (creates~$...).filter.includetargeting a different file.Workaround
Close all open documents in the source folder (removes
~$...), then re-run.Environment