Steps to reproduce
- Open multiple notes in tabs in the main window, and open multiple notes in tabs in a second window.
- With the main window focused, click the close button in a tab in the second window.
- In File Explorer, observe that .obsidian/workspace.json exists and contains content.
- On the Windows taskbar, right-click obsidian and choose “Close all windows”.
- In File Explorer, observe that .obsidian/workspace.json now has filesize 0KB and is empty.
- Open Obsidian: all previous tabs and windows are closed (the files themselves still exist).
Did you follow the troubleshooting guide? [Y/N]
Y
This occurs with restricted mode enabled, no snippets, default theme. It can’t be tested in the sandbox vault as saving to workspace.json is essential.
Expected result
Opening Obsidian, previous tabs and windows should be loaded.
Actual result
Opening Obsidian, all previous tabs and windows are lost.
Environment
SYSTEM INFO:
Obsidian version: v1.8.10
Installer version: v1.8.10
Operating system: Windows 11 Pro 10.0.22631
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
Also: for perhaps as long as multiple years I have intermittently had a layout partial-wipe problem where all secondary windows would be lost, and only the main window tabs would be restored. Perhaps also a race condition writing-while-closing situation affecting workspace.json.
Vault size: several thousand notes, 350MB including some images and PDFs.
Related posts
- The reproduction steps are identical to those described in this post: Workspace config stops being saved (due to a timing issue in debounce())
Prior to reading that post, the issue was sporadic for me. Since reading that post, and using those steps, I can reproduce my issue 100% of the time. - This might have been the same problem, though the user did not follow up: Previously open tabs not open on next launch
SysInternals ProcessMonitor logs
A record of events involving workspace.json:
# Autosaves
# ...
3:37:58.8634480 pm Obsidian.exe 13984 CreateFile C:\Users\user\vault\.obsidian\workspace.json SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
3:37:58.8634683 pm Obsidian.exe 13984 QueryBasicInformationFile C:\Users\user\vault\.obsidian\workspace.json SUCCESS CreationTime: 19/10/2022 7:10:01 am, LastAccessTime: 17/06/2025 3:37:58 pm, LastWriteTime: 17/06/2025 3:37:58 pm, ChangeTime: 17/06/2025 3:37:58 pm, FileAttributes: A
3:37:58.8634776 pm Obsidian.exe 13984 CloseFile C:\Users\user\vault\.obsidian\workspace.json SUCCESS
# Manually closed Obsidian
3:42:29.7179104 pm Obsidian.exe 13984 CreateFile C:\Users\user\vault\.obsidian\workspace.json SUCCESS Desired Access: Generic Write, Read Attributes, Disposition: OverwriteIf, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: 0, OpenResult: Overwritten
3:42:29.7406801 pm Obsidian.exe 13984 CloseFile C:\Users\user\vault\.obsidian\workspace.json SUCCESS
The workspace.json wiping event may have been the second-to-last event: AllocationSize: 0, OpenResult: Overwritten
No other processes touched workspace.json in the preceding 4 minutes.
More complete log for the last two events, adding columns “Command Line” and “Parent PID”:
3:42:29.7179104 pm Obsidian.exe 13984 CreateFile C:\Users\user\vault\.obsidian\workspace.json SUCCESS Desired Access: Generic Write, Read Attributes, Disposition: OverwriteIf, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: 0, OpenResult: Overwritten "C:\Users\user\AppData\Local\Obsidian\Obsidian.exe" --type=renderer --user-data-dir="C:\Users\user\AppData\Roaming\obsidian" --standard-schemes=app --secure-schemes=app --fetch-schemes=app --streaming-schemes=app --code-cache-schemes=app --app-path="C:\Users\user\AppData\Local\Obsidian\resources\app.asar" --no-sandbox --no-zygote --node-integration-in-worker --video-capture-use-gpu-memory-buffer --lang=en-GB --device-scale-factor=1 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1750124456820229 --launch-time-ticks=6994669446 --field-trial-handle=2652,i,7297147118279264881,15565033714741024382,262144 --enable-features=SharedArrayBuffer --disable-features=SpareRendererForSitePerProcess,WinDelaySpellcheckServiceInit,WinRetrieveSuggestionsOnlyOnDemand --variations-seed-version --mojo-platform-channel-handle=2648 /prefetch:1 25064
3:42:29.7406801 pm Obsidian.exe 13984 CloseFile C:\Users\user\vault\.obsidian\workspace.json SUCCESS "C:\Users\user\AppData\Local\Obsidian\Obsidian.exe" --type=renderer --user-data-dir="C:\Users\user\AppData\Roaming\obsidian" --standard-schemes=app --secure-schemes=app --fetch-schemes=app --streaming-schemes=app --code-cache-schemes=app --app-path="C:\Users\user\AppData\Local\Obsidian\resources\app.asar" --no-sandbox --no-zygote --node-integration-in-worker --video-capture-use-gpu-memory-buffer --lang=en-GB --device-scale-factor=1 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1750124456820229 --launch-time-ticks=6994669446 --field-trial-handle=2652,i,7297147118279264881,15565033714741024382,262144 --enable-features=SharedArrayBuffer --disable-features=SpareRendererForSitePerProcess,WinDelaySpellcheckServiceInit,WinRetrieveSuggestionsOnlyOnDemand --variations-seed-version --mojo-platform-channel-handle=2648 /prefetch:1 25064
Stack for the createFile event:
0 FLTMGR.SYS FltGetStreamContext + 0x20cb 0xfffff806538b963b C:\WINDOWS\System32\drivers\FLTMGR.SYS
1 FLTMGR.SYS FltGetStreamContext + 0x1b51 0xfffff806538b90c1 C:\WINDOWS\System32\drivers\FLTMGR.SYS
2 FLTMGR.SYS FltRequestFileInfoOnCreateCompletion + 0x4ef 0xfffff806538f1fef C:\WINDOWS\System32\drivers\FLTMGR.SYS
3 ntoskrnl.exe IofCallDriver + 0x55 0xfffff806546650d5 C:\WINDOWS\system32\ntoskrnl.exe
4 ntoskrnl.exe PsReferenceImpersonationToken + 0x1fe3 0xfffff80654abecb3 C:\WINDOWS\system32\ntoskrnl.exe
5 ntoskrnl.exe ObOpenObjectByNameEx + 0xf21 0xfffff80654aca301 C:\WINDOWS\system32\ntoskrnl.exe
6 ntoskrnl.exe ObOpenObjectByNameEx + 0x1f2 0xfffff80654ac95d2 C:\WINDOWS\system32\ntoskrnl.exe
7 ntoskrnl.exe NtCreateFile + 0xba7 0xfffff80654aace47 C:\WINDOWS\system32\ntoskrnl.exe
8 ntoskrnl.exe NtCreateFile + 0x79 0xfffff80654aac319 C:\WINDOWS\system32\ntoskrnl.exe
9 ntoskrnl.exe setjmpex + 0x90b5 0xfffff8065482a505 C:\WINDOWS\system32\ntoskrnl.exe
10 ntdll.dll NtCreateFile + 0x14 0x7ffe3fd50e44 C:\Windows\System32\ntdll.dll
11 KernelBase.dll CreateFileW + 0x710 0x7ffe3d3fa650 C:\Windows\System32\KernelBase.dll
12 KernelBase.dll CreateFileW + 0x7c 0x7ffe3d3f9fbc C:\Windows\System32\KernelBase.dll
13 Obsidian.exe node::EmitAsyncDestroy + 0xb723 0x7ff6e592e523 C:\Users\user\AppData\Local\Obsidian\Obsidian.exe
14 Obsidian.exe uv_cancel + 0x24a 0x7ff6e5af683a C:\Users\user\AppData\Local\Obsidian\Obsidian.exe
15 Obsidian.exe uv_thread_create_ex + 0x197 0x7ff6e53afa97 C:\Users\user\AppData\Local\Obsidian\Obsidian.exe
16 Obsidian.exe Cr_z_adler32 + 0x58950a 0x7ff6e792826a C:\Users\user\AppData\Local\Obsidian\Obsidian.exe
17 kernel32.dll BaseThreadInitThunk + 0x1d 0x7ffe3eb7259d C:\Windows\System32\kernel32.dll
18 ntdll.dll RtlUserThreadStart + 0x28 0x7ffe3fd0af38 C:\Windows\System32\ntdll.dll
Claude 4 Opus may or may not be right but it suggests:
The enhanced trace confirms this is a *bug in Obsidian itself*, not caused by plugins or external software. The smoking gun is clear:
**The Problem**
The CreateFile operation with `OverwriteIf` and `AllocationSize: 0` immediately truncates the file to 0 bytes. Then Obsidian closes the file WITHOUT writing any data. This is happening in a worker thread (based on the stack trace showing `uv_thread_create_ex` and Chromium internals).
**Root Cause Analysis**
Based on the evidence:
1. **Worker thread race condition during shutdown** (90% likelihood)
* The stack shows this is happening in a background thread
* The thread is likely being terminated during app shutdown before it can write
* The `Cr_z_adler32` in the stack suggests compression/decompression operations
2. **Corrupted Electron/Chromium shutdown sequence** (70% likelihood)
* The renderer process (note the `--type=renderer` in command line) is failing to complete its write
Hopefully that information provides a good start for finding out whether this is a bug or just something affecting me! Many thanks for your help.