You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS baseline save fails: ENOENT on device.plist.sb-* temp file #1714
On Simlock 0.8.0 (macOS 26.7.1, Xcode 27.2, iOS 27.2 runtime), every simlock baseline save of an iOS lease fails, also for a freshly leased bare
simulator:
{"error":{"code":"BASELINE_SAVE_FAILED","message":"baseline zz-probe was not saved: ENOENT: no such file or directory, lstat '~/.simlock/devices/ios/sources/<udid>/device.plist.sb-55c05b11-ISuHtw'. Lease lse_… has ended."}}
Reproduced 3 of 3 times. The device used for the save can end up quarantined with the same error in shutdown failed.
Steps
simlock lease --platform ios --device "iPhone 17 Pro" --os 27.2 --ttl 30m (kept running in the background)
Wait for boot.
simlock baseline save zz-probe --lease <id>
Cause
saveSource in dist/drivers/ios/seeds.js runs simctl clone into the
sources set and right afterwards #baselineRecord → recordLineageFiles. visitFolder in dist/drivers/ios/lineage-files.jsreaddirs the clone's
folder and then lstats each entry. CoreSimulator is still writing the
clone's device.plist atomically, so its temp file device.plist.sb-*
is listed but gone by the time of the lstat, and the ENOENT aborts the
save.
Fix that works locally
Skip entries that vanish between readdir and lstat:
Confirmed. src/drivers/ios/index-seed-record.test.ts, "a baseline is saved when files listed in its clone are gone before the walk reaches them, and only the files still there are recorded", on bug/1714-repro. The fixture lists two *.sb-* temp files (top level and nested) that are removed when lstat reaches them.
pnpm exec vitest run --project unit src/drivers/ios/index-seed-record.test.ts
AssertionError: expected Error: ENOENT: no such file or directory,… to be undefined
+ "message": "ENOENT: no such file or directory, open '/Devices/sources/EEEEEEEE-…/data/Library/Preferences/app.plist.sb-0a1b2c3d-QwErTy'"
❯ src/drivers/ios/index-seed-record.test.ts:338:25 expect(saved.error).toBeUndefined();
Root cause
Defect. src/drivers/ios/lineage-files.ts:97: visitFolderreaddirs the clone's folder, then lstats each name with no handling for a name that is gone. CoreSimulator still writes the clone's plists atomically after simctl clone returns, so its *.sb-* temp file is listed and renamed away before the lstat; the ENOENT escapes recordLineageFiles, and saveSource (seeds.ts:175) deletes the clone and fails. The seed make walks the same code, so it can fail the same way.
Simplest fix
The reporter's patch at lineage-files.ts:97: an lstat that fails with isMissingPathError skips the entry; any other error still throws.
git diff --stat # 1 file, +6 -1 in lineage-files.ts
pnpm exec vitest run --project unit src/drivers/ios/index-seed-{record,sources,provision,swap,throwaway}.test.ts src/drivers/ios/index-save-source-lifecycle.test.ts
Test Files 6 passed (6) Tests 74 passed (74)
Alternatives rejected
Wait or retry after simctl clone until the folder settles: no signal says when CoreSimulator is done, so it is a guessed delay.
Skip names matching *.sb-*: ties the walk to an Apple naming detail; any vanished file breaks it the same way.
Risk
A file gone between lstat and classify is recorded unreadable with a warning, not skipped. Harmless for a copy's swap (counted only); not covered by the test.
The WAL loop at lineage-files.ts:91 still throws on a vanished -wal; untouched by the fix.
@V3RON Thanks for merging #1786. I found one follow-up case: if a device.plist.sb-* file survives the lineage scan and contains a source UDID, Simlock can record its path. If CoreSimulator removes the file afterward, a later baseline lease can fail when it tries to rewrite that path.
I ran the regression from #1785 against the code that merged in #1786. The baseline save succeeded, but the lineage still contained device.plist.sb-in-progress. With #1785, the test records only the canonical device.plist. The follow-up filters those temporary files at the clone root and keeps #1786’s handling of vanished entries throughout the clone.
Activity
V3RON commentedon Nov 19, 2026
Reproduction
Confirmed.
src/drivers/ios/index-seed-record.test.ts, "a baseline is saved when files listed in its clone are gone before the walk reaches them, and only the files still there are recorded", onbug/1714-repro. The fixture lists two*.sb-*temp files (top level and nested) that are removed whenlstatreaches them.Root cause
Defect.
src/drivers/ios/lineage-files.ts:97:visitFolderreaddirs the clone's folder, thenlstats each name with no handling for a name that is gone. CoreSimulator still writes the clone's plists atomically aftersimctl clonereturns, so its*.sb-*temp file is listed and renamed away before thelstat; the ENOENT escapesrecordLineageFiles, andsaveSource(seeds.ts:175) deletes the clone and fails. The seed make walks the same code, so it can fail the same way.Simplest fix
The reporter's patch at
lineage-files.ts:97: anlstatthat fails withisMissingPathErrorskips the entry; any other error still throws.Alternatives rejected
simctl cloneuntil the folder settles: no signal says when CoreSimulator is done, so it is a guessed delay.*.sb-*: ties the walk to an Apple naming detail; any vanished file breaks it the same way.Risk
lstatandclassifyis recordedunreadablewith a warning, not skipped. Harmless for a copy's swap (counted only); not covered by the test.lineage-files.ts:91still throws on a vanished-wal; untouched by the fix.Fast track
Written by an agent.
V3RON commentedon Nov 19, 2026
Delivery run
Merged: #1786 (#1714)
Parked: none
Waiting: none
Decided: none
Written by an agent.
maxlapides commentedon Nov 19, 2026
@V3RON Thanks for merging #1786. I found one follow-up case: if a
device.plist.sb-*file survives the lineage scan and contains a source UDID, Simlock can record its path. If CoreSimulator removes the file afterward, a later baseline lease can fail when it tries to rewrite that path.I ran the regression from #1785 against the code that merged in #1786. The baseline save succeeded, but the lineage still contained
device.plist.sb-in-progress. With #1785, the test records only the canonicaldevice.plist. The follow-up filters those temporary files at the clone root and keeps #1786’s handling of vanished entries throughout the clone.fix(ios): a baseline save skips files that vanish from its clone (cal…