Bug 1477665

Summary: Running file on /dev/agpgart raises an error
Product: [Community] Virtualization Tools Reporter: mathieu.tarral
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: mathieu.tarral, ptoscano, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-03 07:55:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Dockerfile to reproduce environment none

Description mathieu.tarral 2017-08-02 15:11:53 UTC
Created attachment 1308294 [details]
Dockerfile to reproduce environment

Description of problem:

I'm trying to run the file utility on every file of the filesystem, through libguestfs.

I'm walking through the filesystem using guestfs.ls(), and then calling guestfs.file()

I found a special device that is reported present on the filesystem, but absent when asking for file to identify it.


Version-Release number of selected component (if applicable):


How reproducible:
Always


Steps to Reproduce:
1. Mount a Linux filesystem in libguestfs
2. Run Python API guestfs.file('/dev/agpgart')
3. A RuntimeError is raised

Actual results:
A RuntimeError is raised:

In [8]: g.file('/dev/agpgart')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/root/test_guestfs.py in <module>()
----> 1 g.file('/dev/agpgart')

/usr/lib/python3/dist-packages/guestfs.py in file(self, path)
   2569         """
   2570         self._check_not_closed ()
-> 2571         r = libguestfsmod.file (self._o, path)
   2572         return r
   2573 

RuntimeError: file: file_stub: /dev/agpgart: No such file or directory



Expected results:
file output for /dev/agpgart


Additional info:

I created a Dockerfile to reproduce the issue.

https://gist.github.com/Wenzel/09b222f3572fa34ec01b50f69c5a556e

Look at https://bugzilla.redhat.com/show_bug.cgi?id=1477623 for how to use it.

Thanks !

Comment 1 Richard W.M. Jones 2017-08-02 15:26:07 UTC
What does
  g.ll ('/dev/agpgart')
return?

Comment 2 Richard W.M. Jones 2017-08-02 15:30:38 UTC
Forget that.  The reproducer is:

$ virt-builder fedora-26
$ guestfish -a fedora-26.img -i
><fs> mknod-c 0777 10 175 /dev/agpgart
><fs> file /dev/agpgart 
libguestfs: error: file: file_stub: /dev/agpgart: No such file or directory

This is reproducible with libguestfs from git.

Comment 3 mathieu.tarral 2017-08-02 20:23:58 UTC
Hi,

thanks for checking it.
If you still wanted the output:


In [1]: g.ll('/dev/agpgart')
Out[1]: 'crw-rw---- 1 0 44 10, 175 Jul 21 14:35 /sysroot/dev/agpgart\n'

Thanks :)

Comment 4 Richard W.M. Jones 2017-08-03 07:55:20 UTC

*** This bug has been marked as a duplicate of bug 1477623 ***