[0.10.110][macOS] In-app update never installs when lsof prints a warning: the installer runs lsof with +w
Describe the bug
The in-app update downloads and pre-stages the new bundle. Then the install script keeps the old app, and the app quits without a relaunch. The staged Nowledge Mem.app.updating.<pid>.<ts>.app stays in /Applications. Both attempts on 2026-10-29 (0.10.109 → 0.10.110) failed this way. From $TMPDIR/nowledge_update_install.log:
Backend release could not be verified: lsof status=1 lsof: WARNING: can't stat() smbfs file system /Volumes/.timemachine/<nas>/<uuid>/timemachine
Backend release was not confirmed; preserving the staged bundle and existing app
Cause: wait_for_backend_port_release() runs
lsof -nP -iTCP:14242 -sTCP:LISTEN -t +w 2>&1
and accepts only status 1 with empty output. On macOS (lsof 4.91), +w turns warnings on and -w turns them off (the man page wording suggests the opposite). 2>&1 then puts any warning into the output. A network Time Machine destination stays mounted between backups, at a mount point that a user process cannot stat, so lsof always warns.
To Reproduce With a Time Machine SMB share mounted, start an in-app update. Or probe a free port:
lsof -nP -iTCP:14243 -sTCP:LISTEN -t +w 2>&1; echo $? # 1, plus the warning
lsof -nP -iTCP:14243 -sTCP:LISTEN -t -w 2>&1; echo $? # 1, empty
Expected behavior
The update installs when port 14242 is free. Fix: -w instead of +w, or drop 2>&1 and use the exit status and stdout only.
Additional context macOS 27.0.1 (26A434), arm64, Nowledge Mem 0.10.109 and 0.10.110. The running app's installer does the update, so a fix applies from the update after the fixed version. A manual swap of the staged bundle works.
Hi @elfensky, thank you for tracking this down to the exact lsof flag and the Time Machine mount. Your analysis was spot on and saved us a lot of time.
This is fixed in 0.10.112, released today. The update helper still keeps lsof warnings on, but it now tolerates warnings about unrelated SMB mounts, while real process-inspection failures still stop the update. We didn't switch to plain -w, because on macOS that can also hide a genuine lsof error and let an update replace the app while the backend is still running.
As you pointed out, the fix only applies to updates started by the fixed version. So the update to 0.10.112 itself may still fail the old way while the share is mounted. For that one step, the manual swap of the staged bundle you described works, or you can download 0.10.112 directly.
Once you're on 0.10.112, could you let us know how the next in-app update goes with the Time Machine share still mounted: does it install, reopen, and clean up the staged bundle? If it fails, the redacted error lines from $TMPDIR/nowledge_update_install.log are all we need.
Thanks! A partial confirmation on 0.10.115:
- The in-app updates on 2026-11-05 and 2026-11-06 installed, relaunched and removed their staged bundles (
Backend port 14242 is free→Nowledge Mem update installed and relaunched). - Neither one proves the fix. On 2026-11-06 the Time Machine share was not mounted when the update ran, and the system log no longer shows the mount state for 2026-11-05. A correction to my report: here Time Machine mounts the share only for each hourly backup (about 10 to 60 minutes), not between backups.
- So I ran
lsof_output_allows_absent_listenerfrom the 0.10.115 binary against a free port while the share was mounted. lsof returns status 1 with thecan't stat() smbfs file system /Volumes/.timemachine/…warning and its two continuation lines. The new check accepts that output. The old check refused that exact output. - One leftover from the old failure was still there:
Nowledge Mem.app.updating.8944.1793454736014.app(0.10.111, 2026-10-30). That is expected, because the new helper removes only its own staging. I deleted it by hand.
I will report back after the next in-app update that runs while the share is mounted.
Thanks @elfensky for the careful partial confirmation, and for running the new check against real output from the mounted share. That's really helpful, and good to hear the last two updates installed and relaunched cleanly.
Thanks also for the correction about when Time Machine mounts the share. Whenever an update happens to run while it's mounted, we'd be glad to hear how it goes. No rush at all.
Confirmed end-to-end: 0.10.115 → 0.10.116 on 2026-11-09, with the Time Machine share mounted for the whole update.
- A watcher sampled every 2 s: the mount state, the helper's own call
lsof -nP -iTCP:<free port> -sTCP:LISTEN -t +w 2>&1, the port 14242 listener, the app version and the staged bundles. - From 17:57:17Z until after the relaunch, the share stayed mounted. Every probe returned status 1 with the
can't stat() smbfs file system /Volumes/.timemachine/…warning. - The update log:
[2026-11-09T17:57:55Z] Preparing Nowledge Mem update
Backend port 14242 is free
Using pre-staged app bundle: /Applications/Nowledge Mem.app.updating.31516.1794247074112.app
Backend port 14242 is free
Relaunched updated app at /Applications/Nowledge Mem.app
[2026-11-09T17:58:03Z] Nowledge Mem update installed and relaunched
- The app relaunched as 0.10.116. The backend listened on 14242 again 10 s later, and the staged bundle was removed.
The update log does not print the helper's own lsof output, so the warning evidence comes from my probe in the same 2 s window, not from the helper itself.
Fixed from my side. Thanks for the quick fix!
Thanks so much @elfensky for checking this end to end with the share mounted for the whole update, and for being so clear about what your probe showed versus what the update log prints. That made it easy to trust the result, and we really appreciate the time you put into it.
Glad to hear it's fixed on your side, so we'll close this now. If it ever comes back, just let us know and we'll take another look.