Hibernation Wakeup: UNC File Removed
-
An issue rig specific to an HP, specs here where files loaded in from the Synology NAS are removed from the editor after hibernation wake-up. The effects of the lost connection doesn’t repro (at least with N++) on other machines connected to the NAS here, where all explorer windows opened on the NAS bounce back to “This PC” or equivalent. The outage time before recovery is very short, so manually navigating back to the UNC path in explorer, or opening the path in N++ works almost immediately.
A slightly awkward workaround could be requesting an option for UNC pathnames to be saved in a special section of the MRU somehow. Or, yes, I hear you, avoid hibernation altogether as it tends to be discouraged by many these days. :) -
@Laurie-Stearn said in Hibernation Wakeup: UNC File Removed:
where files loaded in from the Synology NAS are removed from the editor after hibernation wake-up
You can either leave the N++ opened with its files/tabs before the hibernation or use the N++ Preferences > Backup > Remember inaccessible files from past session.
Notepad++ is an in-memory editor. So while editing a loaded file in N++, the N++ does not keep the original file handle opened (until one tries to save the edited file/tab data). Hibernation then moves everything from the volatile computer memory (RAM) to a permanent storage (HDD). So this means that all the running process of the N++ and all its data (open docs tabs) will be stored temporarily on the system HDD, regardless of where the original files came from. So there will not be a reason for an edited file/tab to be missing in N++ after waking up from the hibernation.
If you mean a situation when someone closes the N++ app (with opened files/tabs in it), then does the hibernation/waking up sequence and open N++ while the files for the opened N++ session are not ready yet - then use this setting in N++:
With this, after the N++ has been re-launched (after the waking up), you will obtain this msg:
Choose yes and when your files will be available again, N++ automatically replaces temporarily created read-only empty placeholder tabs with its real counterparts.
@Laurie-Stearn said in Hibernation Wakeup: UNC File Removed:
Or, yes, I hear you, avoid hibernation altogether as it tends to be discouraged by many these days. :)
I use it often without any problems.
-
@xomx said in Hibernation Wakeup: UNC File Removed:
So this means that all the running process of the N++ and all its data (open docs tabs) will be stored temporarily on the system HDD, regardless of where the original files came from. So there will not be a reason for an edited file/tab to be missing in N++ after waking up from the hibernation.
In that case, could it be N++ has a problem retrieving these UNC pathnames during the commencement of hibernation?
Thanks, never used sessions, thus it might be a good idea to do so. Would also definitely be more comfortable with a little more flexibility in hibernation, means extras like BCDEdit or HORM though.
-
@Laurie-Stearn said in Hibernation Wakeup: UNC File Removed:
could it be N++ has a problem retrieving these UNC pathnames during the commencement of hibernation?
So I tried to test somehow (N++ not being able to check the file path for an opened file) … and no such problem for me:
Maybe you are doing something different than me(?).
-
@xomx: Not just me, rather a combination of the effects of hibernation on the UNC pathnames, rig, Network Sharing and N++.
No issues at all with files on the local disks as you have just illustrated. -
@Laurie-Stearn , Please clarify what you mean by “removed from the editor” in your initial post.
Is Notepad++ running at the time you hibernate and if so, does the file tab just vanish without any message, or … what?
If you exit/close Notepad++ prior to hibernate and you then restart Notepad++ once you are running do all of the tabs other than the ones for files stored on the NAS reopen at the positions where you were at in the files prior to exit/close Notepad++?
Notepad++ does not keep files open when you are editing them. However, it is checking regularly to see if the modified time stamp for the file on disk, or its size change and if so alerts the user asking if they want to continue editing with the copy in the editor or to reload what’s on disk into the editor. Are you getting Reload pop-ups that mention “This file has been modified by another program?”
Are you getting pop-ups about “Keep non existing file / The file “(file path)” doesn’t exist anymore. Keep this file in editor?”
Please post the debug info from your editor. See Please Read This Before Posting for more about this.
-
@mkupper: Hi, N++ running, file tab was not there on wake-up.
Closing N++ prior to hibernate and restarting at any time is fine, if the NAS is down there will be, of course a “Keep non existing file” popup on tab activation for the file.
No other popups/errors noted -here’s the debug:Notepad++ v8.6.9 (64-bit) Build time : Jul 12 2024 - 05:09:25 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : OFF Cloud Config : OFF Periodic Backup : ON OS Name : Windows 11 Pro (64-bit) OS Version : 23H2 OS Build : 22631.4037 Current ANSI codepage : 1252 Plugins : mimeTools (3.1) NppConverter (4.6) NppExport (0.4)
Do apologise for not explaining that this is, in fact, an intermittent issue, for instance after hibernation yesterday (and again today) the loaded NAS files are still in the editor.
There is an issue related to AC power with this rig that triggers a clean boot out of the S4 state, which necessitates the relaunching of N++. There is a good chance the NAS files have gone AWOL at that time, in which case I may not have noticed they were gone until after next hibernation.
Even in this scenario, all local files are still loaded with the relaunch, sometimes the NAS files are not, in any case do not expect a sudden plug pull to N++ (or any program for that matter) for consistent results.
The NAS Diskstation also has a periodic login timeout, this usually won’t affect direct access to files, there could be other reasons for lost connections though.Have daisy chained a power switch to the UPS, thus manually shutting off power after each hibernate prevents the thing from rebooting.
Thanks for your interest, this is one to watch, and will update the thread once more information comes to hand. -
@Laurie-Stearn One thing that may provide additional information is to create a
%AppData%\Notepad++\nppLogNetworkDriveIssue.xml
configuration file. It’s mentioned in the https://npp-user-manual.org/docs/config-files/#other-configuration-files section of the Notepad++ manual.I suspect nothing will get logged as you mentioned there have been no pop-ups and I suspect that
c:\temp\nppLogNetworkDriveIssue.log
is only updated when for certain pop-ups.It’s strange that tabs are disappearing. My understanding of hibernation was that running processes were suspended and the RAM used by the applications was saved to disk. A power outage during hibernation should not bother Windows itself or the suspended applications, including Notepad++.
-
@Laurie-Stearn said in Hibernation Wakeup: UNC File Removed:
triggers a clean boot out of the S4 state, which necessitates the relaunching of N++
With this info, I already have an idea of what might be going on. The clean boot means that all the N++ process data, previously saved by the hibernation process to the Windows file “C:\hiberfil.sys”, is thrown away. So no previously opened files/tabs buffers in N++ available, N++ will start from the scratch with opening its files according to its session.xml file. Unfortunately N++ is updating its session.xml file content only at its regular exit (I was once considering the session.xml update after every successful file opening, but that was rejected for good reasons), not continuously right when a file is opened. So then the N++, after its re-launch, does not have the actual info needed for the opening of all your previous N++ files…
@Laurie-Stearn said in Hibernation Wakeup: UNC File Removed:
Even in this scenario, all local files are still loaded with the relaunch
It will depend on the previous state of your session.xml file. Simple test - if every time you finish work and are about to hibernate, you first exit the N++ and then re-launch it before the Windows hibernation itself - I bet that the session.xml will contain the complete information about your session files and there will not be your described issue…
You can also use the N++ menu > File > Save Session… to always have a fresh backup for your session.
@mkupper said in Hibernation Wakeup: UNC File Removed:
nppLogNetworkDriveIssue.xml
That logging trigger is intended for something else (detection of the last write timestamps for network files), it will not help us here.