Bug 1424492 - IOException during "File.WriteAllText" to the file under NFS on Linux
Summary: IOException during "File.WriteAllText" to the file under NFS on Linux
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: dotNET
Classification: Red Hat
Component: rh-dotnetcore10
Version: 1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ga
: 1.0
Assignee: Omair Majid
QA Contact: jiri vanek
Les Williams
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-17 17:18 UTC by Rick Wagner
Modified: 2020-05-14 15:39 UTC (History)
6 users (show)

Fixed In Version: rh-dotnetcore10-dotnetcore-1.0.4-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-15 08:37:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2934711 0 None None None 2017-02-22 01:52:38 UTC
Red Hat Product Errata RHBA-2017:0519 0 normal SHIPPED_LIVE Update to .NET Core 1.0.4 2017-03-15 12:37:22 UTC

Description Rick Wagner 2017-02-17 17:18:57 UTC
Description of problem:
As described in the dotnet community tracker at [1], file writes to an NSF drive fail.  

[1] https://github.com/dotnet/corefx/issues/16256

Comment 1 Omair Majid 2017-02-21 14:30:40 UTC
GSS confirmed the corefx patch indeed fixes the problem:

https://github.com/dotnet/corefx/commit/60d1b3d22eca28ca3dfe375d0cefd2bd16059261

Comment 3 jiri vanek 2017-03-14 12:50:38 UTC
[tester@rhel7-x64 hello-world2]$ cat Program.cs  || [tester@rhel7-x64 hello-world]$ cat Program.cs 

using System;
using System.IO;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
File.WriteAllText(@"/mnt/nfs_share/tetest.txt", "TextToWrite");
            Console.WriteLine("Hello World!");
        }
    }
}


[tester@rhel7-x64 hello-world2]$ rpm -qa | grep dotnet
rh-dotnetcore10-dotnetcore-1.0.3-3.el7.x86_64
rh-dotnetcore10-runtime-1.0-4.el7.x86_64
rh-dotnetcore10-libuv-1.9.0-1.el7.x86_64
rh-dotnetcore10-1.0-4.el7.x86_64
rh-dotnetcore10-libcurl-7.47.1-4.el7.x86_64

[tester@rhel7-x64 hello-world2]$ scl enable rh-dotnetcore10 -- dotnet run
Project hello-world2 (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling hello-world2 for .NETCoreApp,Version=v1.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:00.8768346
 

Hello World!

Unhandled Exception: System.UnauthorizedAccessException: Access to the path '/mnt/nfs_share/tetest.txt' is denied. ---> System.IO.IOException: Bad file descriptor
   --- End of inner exception stack trace ---
   at System.IO.UnixFileStream.CheckFileCall(Int64 result, Boolean ignoreNotSupported)
   at System.IO.UnixFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
   at System.IO.UnixFileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding)
   at System.IO.File.WriteAllText(String path, String contents)
   at ConsoleApplication.Program.Main(String[] args)




[tester@rhel7-x64 ~]$ rpm -qa | grep dotnet
rh-dotnetcore10-1.0-4.el7.x86_64
rh-dotnetcore10-libuv-1.9.0-1.el7.x86_64
rh-dotnetcore10-dotnetcore-1.0.4-1.el7.x86_64
rh-dotnetcore10-runtime-1.0-4.el7.x86_64
rh-dotnetcore10-libcurl-7.47.1-4.el7.x86_64
[tester@rhel7-x64 ~]$ scl enable rh-dotnetcore10 -- dotnet --version
1.0.0-preview2-003157


[tester@rhel7-x64 hello-world]$ scl enable rh-dotnetcore10 -- dotnet run
Project hello-world (.NETCoreApp,Version=v1.0) will be compiled because inputs were modified
Compiling hello-world for .NETCoreApp,Version=v1.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:00.8816610
 

Hello World!
Hello World!





Where /mnt/nfs_share/ is:

[tester@rhel7-x64 hello-world2]$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
tmpfs                  1.0G  4.0K  1.0G   1% /mnt/export
localhost:/mnt/export  1.0G     0  1.0G   0% /mnt/nfs_share

[tester@rhel7-x64 hello-world2]$ cat /etc/exports
/mnt/export *(fsid=25,rw,sync)

and mnt/export is mount --bind ramdisk at /mnt/rmadisk2  accessible as 777:

-rw-rw-r-- 1 tester tester 5 Mar 14 12:32 aaa
-rwxrw-r-- 1 tester tester 0 Mar 14 12:42 tetest.txt
[tester@rhel7-x64 hello-world2]$ ll /mnt/nfs_share/
total 4
-rw-rw-r-- 1 tester tester 5 Mar 14 12:32 aaa
-rwxrw-r-- 1 tester tester 0 Mar 14 12:42 tetest.txt
[tester@rhel7-x64 hello-world2]$ ll /mnt/ramdisk2/
total 4
-rw-rw-r-- 1 tester tester 5 Mar 14 12:32 aaa
-rwxrw-r-- 1 tester tester 0 Mar 14 12:42 tetest.txt


[tester@rhel7-x64 hello-world2]$ ll /mnt
total 0
drwxrwxrwt 2 root   root  80 Mar 14 12:42 export
drwxrwxrwt 2 root   root  80 Mar 14 12:42 nfs_share
drwxrwxrwt 2 root   root  80 Mar 14 12:42 ramdisk2

Comment 5 errata-xmlrpc 2017-03-15 08:37:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0519.html


Note You need to log in before you can comment on or make changes to this bug.