Windows service cannot access UNC path

I have a Windows service written in C # that runs on Windows Server 2012. The service runs as a domain user with local machine permissions and NTFS permissions for network shares in Isilon SAN. I can access shared files and directories in Windows Explorer at login as this user in the following format:

\\isilon\path\to\dir\ 

However challenges

 System.IO.Directory.Exists() 

always returns false. At first I thought it was like this: http://support.microsoft.com/kb/827421 However, when implementing a workaround, you can use

 System.IO.Directory.GetDirectories() 

to just access directories (without checking first if they exist). It just throws

 System.IO.IOException: An unexpected network error occurred. 

The same service code works when running on a different server (Windows 2008) on the same network.

What is really crazy is that if I restart the server, the file system calls will succeed first. Then, after some time or after accessing the same file path from this computer, program calls will fail and will never be successful again. Rebooting the server fixes the problem in a very short time.

I am completely blocked, since there is almost no need to restart the Windows server instance. I do not know what may affect file permissions or accessibility. Maybe this is due to the new implementation of SMB 3.0 on a Windows 2012 server?

Edit: OK. Turns out I'm not crazy. The version of OneFS (a file system running on SIS Isilon) was not explicitly compatible with the Windows 2012 server. Although it claimed to be compatible with SMB. Upgrading from OneFS version 6.5.5.14 to 6.5.5.20 immediately fixed the problem and has been stable since then.

+6
source share

Source: https://habr.com/ru/post/944931/


All Articles