Bug 1477665 - Running file on /dev/agpgart raises an error
Running file on /dev/agpgart raises an error
Status: CLOSED DUPLICATE of bug 1477623
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Linux
unspecified Severity low
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-02 11:11 EDT by mathieu.tarral
Modified: 2017-08-03 03:55 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-03 03:55:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Dockerfile to reproduce environment (658 bytes, text/plain)
2017-08-02 11:11 EDT, mathieu.tarral
no flags Details

  None (edit)
Description mathieu.tarral 2017-08-02 11:11:53 EDT
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 11:26:07 EDT
What does
  g.ll ('/dev/agpgart')
return?
Comment 2 Richard W.M. Jones 2017-08-02 11:30:38 EDT
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 16:23:58 EDT
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 03:55:20 EDT

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

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