Can't open .txt files - "Session file is either corrupted or not valid"



  • I was messing with settings, and after a restart of the app my session files didn’t load and attempts to open .txt files are giving me “session file is either corrupted or not valid”. It does not happen for other file types. If I rename them (to anything), I can open them without trouble via Right-click > “Edit in Notepad++”

    Disconnecting my Dropbox cloud and switching backup to a Notepad++ directory seemed to be related. I’ve deleted the various XML config files, but no effect. I’m OK wiping all existing settings and preferences. The Windows association for .TXT is definitely Notepad++ fwiw.



  • $5 PayPal bounty for feedback that leads to solution

    I’m about to abandon Notepad++ :(



  • This is resolved. Previous attempts to reinstall the app did not fix it, but an explicit uninstall deleted whatever corrupt/invalid setting affecting my .text files (it asks if you want to delete your settings and preferences).

    Theory: “Smart Sync” one-way sync’ing with Dropbox was misleading me to believe I deleted the XML config files completely, but Notepad++ was still accessing them on the cloud directly (I enabled this option). My backup directory was specified as Dropbox originally, so perhaps some sequence of changing around these settings caused the snafu (e.g., perhaps severed the link to the config files moments after they were modified).



  • a late welcome to the notepad++ community, @Derek-Clark90

    i apologise that you didn’t get your request, about your corrupted session files, answered.
    i can’t explain, on how your request could have slipped through all eyes, as you wrote it in a clear and understandable manner, with enough information to give a response, and without any reason not to respond.

    but i’m glad that you didn’t give up on notepad++ (never give up, never surrender) and big thumbs up for taking the time to share your solution and details to your dropbox setup 👍👍👍



  • Thanks! I was optimistic that a post specific to an error message would help others in the future. I was by no means disgruntled; just a little desperate!



  • Solved

    I deleted this in config.xml:
    <PluginDlg pluginName="Notepad++::InternalFunction" id="0" curr="3" prev="-1" isVisible="yes" />

    Step-by-Step:

    Try this if on Windows:

    Method 1
    Quick

    1. Hold down the Windows key and press r for the Run dialog.
    2. Type (or preferably copy and paste this): notepad.exe %appdata%\Notepad++\config.xml
    3. Delete the PluginDlg line if present.

    Method 2
    A bit more descriptive

    1. In Explorer, at the top showing location, type %appdata% and hit [Enter].

    2. That’s simply a wildcard for … like this in my case: C:\Users\garyha\AppData\Roaming

    3. From there, a directory for Notepad++ should be visible. Double-click it.

    4. Open the file config.xml in Notepad++ if you can, or notepad.exe or other editor.

    5. Delete the PluginDlg line if present.

       <GUIConfig name="DockingManager" leftWidth="200" rightWidth="200" topHeight="200" bottomHeight="209">
           <PluginDlg pluginName="Notepad++::InternalFunction" id="0" curr="3" prev="-1" isVisible="yes" />
           <ActiveTabs cont="0" activeTab="-1" />
           <ActiveTabs cont="1" activeTab="-1" />
           <ActiveTabs cont="2" activeTab="-1" />
           <ActiveTabs cont="3" activeTab="-1" />
       </GUIConfig>
      

    Method 3
    Cause the entire config.xml file to be regenerated

    1. With Notepad++ closed, navigate to be able to see %appdata%\Notepad++\config.xml and rename it to something like config.xml.off
    2. Open Notepad++

    Method 4
    Scorched earth

    1. Rename the whole directory %appdata%\Notepad++ to something like %appdata%\Notepad++_off
    2. Open Notepad++

    That should recreate the entire directory structure with defaults. I presume settings, macros or any user changes will be lost.

    Notes
    There are quite a few pages describing this problem, I chose this one for providing the answer that worked for me because it was the top result in a google search for me right now.
    I was not able to open python files. .py. Fine now.
    Hopefully this will help toward a permanent fix so this won’t be afflicting people, since it would be tough for Notepad++ devs to address this unless they were hitting it (aside from having someone zip up their directory structure and supply it to them, recommendable for such problems by the way).
    How I found this:
    I started looking at session.xml but my changes there had no effect, instead only config.xml seems to affect this.
    Made a copy of the Notepad++ directory, opened Notepad++ to generate a virgin copy of it, swapped back to the broken version, opened the two session.xml files in CompareIt to see their differences, removed lines in the broken version one at a time or sometimes a group at a time, then the same for config.xml, basically. Once all done, essentially wound up with no changes except that one line removed.

    I greatly appreciate Notepad++, it has changed my life for the better, a lot.

    Couple things that would be appreciated:

    1. A response from Notepad++ thanking me for my efforts here, and that will encourage me to care in the future similarly.
    2. Notepad++ representative addressing whether this makes sense to them vis-a-vis that setting as the cause, or whether it may also have to do with other related settings to any degree of certainty, whether the problem can be confidently considered to be only in config.xml, and if there will be a fix, or has been a fix in ____ version, and most importantly, who done it? Or, how did that setting show up? Is it possible I really did something to cause that yesterday? Or is there a simpler fix people could use instead of deleting the entire line? Even better, could they fix their situation very very simply by merely activating the Plugin Dialog in some way to cause the line to be rewritten in some way? I thought about placing the bad line back in there and tinkering around, just kind of tuckered out.

    If anyone is curious, there’s some description regarding PluginDlg at http://docs.notepad-plus-plus.org/index.php/Editing_Configuration_Files

    Thanks.



  • Correction:

    < Made a copy of the Notepad++ directory ...
    > Renamed the Notepad++ directory ...
    


  • @Gary-Hawkins Thanks! I had to go all the way to Method 3. I had two PluginDlg lines, and deleting each one did not work. Removing config.xml did. Thanks!


Log in to reply