Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error of saving session XML File and Saving session error with Roaming profiles #15138

Open
1 task done
junk430 opened this issue May 14, 2024 · 6 comments
Open
1 task done
Assignees

Comments

@junk430
Copy link

junk430 commented May 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

We are using Notepad++ in a Microsoft Terminal Server Citrix install. We have folder redirection set to a network share. When users close Notepad++ they receive the following errors in a row.
Error of saving session XML file
then
Saving session error- restore backup

The paths and files listed in the errors look correct and are accessible by the user. The user had full control of files and directories in their path.
I've included screen shots.
I believe this started happening after upgrading the terminal servers from Windows Server 2012R2 to 2019.
Please see attached screen shots.
notepaderror1
notepaderror2

Steps To Reproduce

  1. open notepad++ from a Citrix or Terminal server connection
  2. Close notepad++

Current Behavior

When closing Notepad++ errors are displayed

Expected Behavior

There should be no errors while closing Notepad++

Debug Information

Notepad++ v8.5.6   (64-bit)
Build time : Aug 15 2023 - 15:29:28
Path : D:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows Server 2022 Datacenter (64-bit)
OS Version : 21H2
OS Build : 20348.2402
Current ANSI codepage : 1252
Plugins : 
    ComparePlugin (2.0.2)
    mimeTools (2.9)
    NppConverter (4.5)
    NppExport (0.4)

Anything else?

No response

@donho donho self-assigned this May 14, 2024
@donho
Copy link
Member

donho commented May 14, 2024

@junk430
Could you check if %APPDATA%\notepad++\session.xml is read-only for your users?

@junk430
Copy link
Author

junk430 commented Jun 3, 2024

The file was created by the user when Notepad++ was run. session.xml is owned by the user and has full control on the file.

@xomx
Copy link
Contributor

xomx commented Jun 3, 2024

@junk430
I have an idea how we could detect what is happening there.
There is already a debugging code for the relevant file output opening CreateFileW WINAPI call but currently it is activated only during the Windows OS shutdown/reboot/logoff phase:

if (_hFile != INVALID_HANDLE_VALUE)
{
msg += " is opened.";
}
else
{
msg += " failed to open, CreateFileW ErrorCode: ";
msg += std::to_string(::GetLastError());
}

So you can try to:

  • ensure that your installation of N++ has the nppLogNulContentCorruptionIssue.xml zero-sized logging-trigger file in the same dir, where the main notepad++.exe file is (yours seems to be "D:\Program Files\Notepad++\")
  • launch single instance of the N++ (there is no need to have any files opened in it, but as you like)
  • while the N++ is still running, initiate the Windows restart (or shutdown or logoff, as you like)
  • after getting back to a Windows session, check for the %APPDATA%\Notepad++\nppLogNulContentCorruptionIssue.log file and post its content here, if working ok it should look like:
2024-06-03 17:16:27  WM_QUERYENDSESSION (lParam: 1 - ENDSESSION_CLOSEAPP) =====================================
2024-06-03 17:16:27  WM_ENDSESSION (wParam: TRUE, lParam: 1 - ENDSESSION_CLOSEAPP)
2024-06-03 17:16:27  C:\Users\USERNAME\AppData\Roaming\Notepad++\config.xml is opened.
2024-06-03 17:16:27  C:\Users\USERNAME\AppData\Roaming\Notepad++\config.xml  8898/8898 bytes are written.
2024-06-03 17:16:27  C:\Users\USERNAME\AppData\Roaming\Notepad++\config.xml is closed.
2024-06-03 17:16:27  C:\Users\USERNAME\AppData\Roaming\Notepad++\session.xml is opened.
2024-06-03 17:16:27  C:\Users\USERNAME\AppData\Roaming\Notepad++\session.xml  824/824 bytes are written.
2024-06-03 17:16:27  C:\Users\USERNAME\AppData\Roaming\Notepad++\session.xml is closed.
2024-06-03 17:16:27  WM_DESTROY (isEndSessionStarted == true)

One more thing - as you stated, your problem just have recently started. You connected it to a Windows upgrade. But for surety - do you by any chance having also the Dell Support Assistant SW installed on your computers (check if you have the C:\Program Files\Dell\SupportAssistAgent\SRE\SRE.exe on your disk)?

From approx. January, we have started to receive user complaints about missing N++ session.xml. It turns out that around this time this Dell SW was upgraded to a version that actively deletes also this N++ file, more on that e.g. here.

@junk430
Copy link
Author

junk430 commented Jun 5, 2024

Thanks for the reply!
I'll work on getting this ASAP.
This does seem related to upgrading the Citrix servers from 2012R2 to 2019. We also have CIS security policy mandated. So it's possible something in there could be causing this.. but N++ is initially creating this file correct so it has R/W..
We do not use Dell servers.

@donho
Copy link
Member

donho commented Jun 5, 2024

@junk430

We do not use Dell servers.

It's not about Dell Server but Dell's laptop/computer.
If your company use Dell's computers/laptops, SupportAssist could be installed by default in your users laptops/computer, and it causes the session saving problem.

@xomx
Copy link
Contributor

xomx commented Jun 5, 2024

@donho
If I understand it correctly, they are using Citrix terminal server with N++ installed only there (this is a bliss from the SW maintenance POV...). So the users' computers are just dumb terminals there, all their programs are installed and run on the terminal server side. And if the server is not from Dell, the Support Assistant should not be there either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants