Notepad++ just deleted all the text from my files



  • I just restarted my computer to update and when I tried to open Notepad++, everything was blank. The color scheme went back to default, and there were no tabs open. Every other time I restarted the app (including after restarting the computer) all the tabs I previously had open were restored. The only thing that stayed the same is that spellcheck is on, which by default it isn’t.

    I thought that was weird enough, but then I tried to open the files I was working on and everything was blank. Not entirely blank, rather every character seems to have been replaced with an icon that says “NUL”.

    When I open the files with Windows’s native app, the text files appear to be completely blank. They’re all there, still properly named, and they have the same file size, but they’re all just full of [NUL]

    This only applies to the files I had open in Notepad++ before the restart. Files I wasn’t using N+ on are fine.

    These particular files are really important to me. I was thinking about writing a novel, and those files are mostly notes, plus some prose samples, probably about 50-100 hours of work at least. It was still in early stages though so I hadn’t made backups, but I think there’s potential there. I really don’t want to have to remake all those files from memory.



  • @Maddock-Emerson said:

    every character seems to have been replaced with an icon that says “NUL”

    It is likely that your files are nonrecoverable.

    Yea, it’s kind of a long, sad history of this kind of thing with Notepad++. Just googling Notepad++ nul yields some hits, including this one which is over a year old: https://notepad-plus-plus.org/community/topic/15531/nul-nul-nul-problem-notpad

    still in early stages though so I hadn’t made backups

    My own philosophy is that if you type even one character that you want to keep, it is worth saving and naming and making independent backups of the file.



  • @Alan-Kilborn AAAARGHHHHH What a [DATA EXPUNGED]

    Well it’s a good thing I have decent memory about things that interest me, but man this’ll be a grind.

    Okay, duly noted: don’t trust N+ with anything important.



  • @Maddock-Emerson said:

    don’t trust N+ with anything important.

    Trust…but verify.



  • @Maddock-Emerson said:

    Okay, duly noted

    if you’re willing to stick around and help out: the developers thought they had fixed the NUL-on-crash issue a few releases ago. Which version of Notepad++ were you using when it happened? (? > Debug Info > Copy debug info into clipboard).

    • If it’s an older release, you might want to try to upgrade to v7.7.1, because the newer version might be more reliable.
    • If you were already using the most recent, if you have a reliable way of reproducing the problem, the developers would love to use that methodology to test future fixes.

    don’t trust N+ with anything important.

    Really, I don’t trust any single app, or any single machine, with important data. I use version control software; I use backups. My motto for such things: “save early, save often”.

    If you want a little help from inside Notepad++, you might want to look into the backup settings, especially simple backup-on-save, which will make a .bak every time you hit save, so your most-recent-minus-one should always be saved alongside your most-recent. Since it should use the file-copy features, rather than npp/scintilla-save-buffer-to-disk process, it might not run across the same race-condition that appears to be happening with crashes (or OS-update-reboots).

    There’s also the Auto-Save plugin (available through Plugins > Plugins Admin), which might help you.



  • @PeterJones said:

    If you want a little help from inside Notepad++, you might want to look into the backup settings

    Wasn’t it suspected at one time that a backup setting turned on might increase the likelihood of the NUL problem occurring? If that was/is true, it might be considered a dangerous recommendation. ;)



  • @Alan-Kilborn said:

    Wasn’t it suspected at one time that a backup setting turned on might increase the likelihood of the NUL problem occurring?

    but then @pnedev did some digging and found the culprit and it got fixed.
    Not sure, think it was 7.5.9 or so.

    Update: yep it was 7.5.9



  • @Ekopalypse said:

    Not sure, think it was 7.5.9 or so.

    So I guess we suspect that @Maddock-Emerson is running an earlier version still? Hmmm…he didn’t say and we didn’t ask. How about it Maddock?



  • @Alan-Kilborn 7.7.1

    I got it a few months ago when I was considering the novel and wanted a free text app with more features and better appearance than Windows NP.



  • @Ekopalypse said:

    but then @pnedev did some digging and found the culprit and it got fixed…(in 7.5.9)

    I said:

    and we didn’t ask

    Peter, actually you did ask for version info!

    @Maddock-Emerson said:

    7.7.1

    Well, this thread sounds like some pretty good evidence that it is NOT fixed in the current 7.7.1, or at least not fixed for all circumstances which could cause it to occur. I’m sad. :(



  • @Alan-Kilborn said:

    good evidence that it is NOT fixed in the current 7.7.1

    Urgh. We had all hoped that problem was behind us.

    I’ve opened #6133 and @-mentioned @pnedev both there are here. Hopefully, since he provided the previous fix, he might know the right questions to ask to see what more can be done.

    In the mean time, @Maddock-Emerson , could you post your full ? > Debug Info > Copy debug info into clipboard. Also, if you haven’t changed your Settings > Preferences since the NUL-file incident, it might be good to share a screenshot of the Settings > Preferences > Backup (just in case, as @Alan-Kilborn suggested, it had to do with backup settings) – upload to a server like imgur, and embed using the syntax ![](http://i.imgur.com/QTHZysa.png) – making sure it’s the URL to the raw image file (with the .png or .gif or .jpg extension, usually found via clicking on the image and “get direct link”, or easier by putting ! in front of the “markdown link” if you’re logged in; if you’re posting anonymously, you’ll have to click on the image’s … > Get Share Links, then extract the URL from the BBCode instance, which is the only anonymous share-link that shows the underlying image URL). Maybe even make a copy of all of the %AppData%\Notepad++\*.xml config files, and be ready to share them if @pnedev thinks they will be useful.



  • @PeterJones
    Okay wait, what exactly do you need and how do I get it? I’m seeing a lot of technical terms and symbols thrown out in that comment and I’m not sure what it all is. I’m also tired and possibly drunk because I spent the last like 20 hours making chili with red wine, so if you could just explain it like I’m 5 yeahhhh that’d be great



  • @Maddock-Emerson said:

    red wine

    Notepad++ v7.7.1 (32-bit)
    Build time : Jun 16 2019 - 21:14:50
    Path : C:\Program Files\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS : Windows 7 (32-bit)
    Plugins : 3P.dll ColorPicker.dll Console_output.dll HexEditor.dll Hex_2_binary.dll JSMinNPP.dll mimeTools.dll NppConverter.dll NppExport.dll NppPluginDemo.dll Remove_dup_lines.dll



  • @Maddock-Emerson said:

    Okay wait, what exactly do you need and how do I get it

    By ? > Debug Info > Copy debug info into clipboard, I meant, "go to the ? menu in Notepad++, select the Debug Info menu entry, and then click on Copy debug info into clipboard, which will copy the kind of info that @gurikbal-singh pasted. You would then come over to your browser widow, reply to this post, and paste it in.

    By showing us the Settings > Preferences > Backup, you would go to the Settings menu, pick the Preferences entry, then in the far-left list of words, select Backup, which will take you to the backup settings for Notepad++. Use Alt+PrintScreen to grab a screenshot. Paste that screenshot into mspaint.exe, or your favorite simple graphics program, save the file to your computer. Then go to imgur.com or other similar image-sharing site, upload your image, find the URL for the picture (I already explained how in imgur’s interface). Then come to your reply, and embed the code ![](http://i.imgur.com/QTHZysa.png), where you replace the URL I supplied with the URL to your image. You’ll know you’ve done it right by looking in the PREVIEW window while you’re typing your reply, and you’ll be able to scroll around and see the image embedded.

    By “make a copy of all the %AppData%\Notepad++\*.xml config files”, I meant: open Windows Explorer, paste %AppData%\Notepad++\ into the explorer navigation field, then select all the *.xml files, and copy them to some other location, where you know where they are. If @pnedev asks for them, you’ll be able to zip them up, and figure out some location that you can share those files with @pnedev, if it will help him in his debug.



  • @PeterJones
    Notepad++ v7.7.1 (32-bit)
    Build time : Jun 16 2019 - 21:14:50
    Path : C:\Program Files (x86)\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS : Windows 10 (64-bit)
    Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll

    Okay, I think I’ve done everything right? I’m getting very close to 24 hours without sleep though so I’ll check back way later



  • @Maddock-Emerson said:

    Okay, I think I’ve done everything right?

    Yes, that’s what we were asking for. Thanks!

    Hopefully, @pnedev (or another developer) will be able to look into this.



  • Hello @Maddock-Emerson ,

    Thank you for reporting this and for the info. I’m really sorry for your data loss.

    Hello all,

    I did some fixes back then that could cause data loss when backup was enabled.
    However this issue is very difficult to reproduce thus it was not possible to verify it was completely fixed. Unfortunately now it is clear that’s not the case.
    I’ll look into this again to see if I’ll find something else.



  • @pnedev - I not convinced that this issue is anyhow related to what you’ve fixed in the past.

    I’ve researched the past incidents and I didn’t find a single report that mentioned the
    same behavior as this one.
    Neither the loss of themes nor that all files opened got corrupted.

    The weird thing here, beside the loss of the theme and the files opened in the past is
    the corruption of all files. How could this be? Npp opens the files, except for the
    initial reading, only if it needs to write something, aka the user saves the file,
    otherwise it would create a backup of that file. (given from the configuration from the OP)

    This incident here, from my point of view, is very different and unique.



  • @Ekopalypse said:

    The weird thing here…is the corruption of all files.

    Memory is weak, but from prior discussion of this issue I seem to recall that people complained of files that were changed during the current run of Notepad++ were the ones that got stuffed with NULs.

    For example, if your “remembered” session contains 5 files, and during the current session (the one with the thing that causes the NUL corruption) you’ve only worked on 3 of those files, only those 3 would be NULlified.

    So, it is conceivable that the OP on this thread here had worked on all of his files when the oddity manifested, trashing all of them. Just a supposition.



  • @Alan-Kilborn

    Memory is weak, but from prior discussion of this issue I seem to recall that people complained of files that were changed during the current run of Notepad++ were the ones that got stuffed with NULs.

    Or my research wasn’t good enough. If this was the case then, yes, …
    But I’m still don’t understand how this could happen.
    I understand if you haven’t saved it, that the “backups” might get corrupted but
    if a file on disk has been opened in npp it wouldn’t be affected by a defunct backups functionality wouldn’t it?
    My understand how this works is

    • initial read of the file if opened from filesystem

    • make changes in the editor but do not save

    • having the configs from OP results in backup files after 7 seconds

    • go on and make further changes - backups do get changed as well

    • save the file

    • npp opens the file for writing the changes and then deletes the backup file

    So how could all files, edited by Npp, from the filesystem get corrupted by this mechanism?
    Only if I would say save all open files and something prevents from closing it while
    shutting down the machine. Sounds very strange to me. Just to make sure, I do NOT
    say that OP is lying - I just don’t understand how this could happen.


Log in to reply