Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 641088 - ERROR:root:Failed to copy file: _parsed_options=Namespace(group=-1, mode=420, owner=-1), source=b'.../distdir/glogo-small.png', dest_dir=b'.../image//usr/share/kinfocenter': OSError: [Errno 95] Operation not supported
Summary: ERROR:root:Failed to copy file: _parsed_options=Namespace(group=-1, mode=420,...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 635020 637452
  Show dependency tree
 
Reported: 2017-12-15 06:22 UTC by Sven Müller
Modified: 2019-01-02 21:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,7.00 KB, text/plain)
2017-12-15 06:23 UTC, Sven Müller
Details
kinfocenter: build.log (build.log_kinfocenter,377.74 KB, text/plain)
2017-12-15 06:26 UTC, Sven Müller
Details
wine-gecko: build.log (build.log_winegecko,2.39 KB, text/plain)
2017-12-15 06:26 UTC, Sven Müller
Details
strace.log zipped (same content of wgetpaste-link) (strace.log.zip,642.79 KB, application/zip)
2017-12-15 17:14 UTC, Sven Müller
Details
strace.log (short form) (strace.log,111.44 KB, text/x-log)
2017-12-15 17:20 UTC, Sven Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Müller 2017-12-15 06:22:08 UTC
With the last system-update I'm running in this error with several packages, e.g. kinfocenter-5.11.4 and wine-gecko-2.47-r1

The error occurs at the end of the install phase (kinfocenter-5.11.4): 

-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_energyinfo
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_energyinfo/contents
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_energyinfo/contents/ui
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_energyinfo/contents/ui/main.qml
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_energyinfo/contents/ui/Graph.qml
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_energyinfo/metadata.desktop
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_energyinfo/metadata.json
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kservices5/kcm_fileindexermonitor.desktop
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/lib64/qt5/plugins/kcms/kcm_fileindexermonitor.so
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_fileindexermonitor
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_fileindexermonitor/contents
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_fileindexermonitor/contents/ui
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_fileindexermonitor/contents/ui/main.qml
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_fileindexermonitor/contents/ui/constants.js
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_fileindexermonitor/metadata.desktop
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kpackage/kcms/kcm_fileindexermonitor/metadata.json
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/doc/HTML/en/kinfocenter/index.cache.bz2
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/doc/HTML/en/kinfocenter/index.docbook
-- Installing: /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/doc/HTML/en/kinfocenter/kinfocenter.png
ERROR:root:Failed to copy file: _parsed_options=Namespace(group=-1, mode=420, owner=-1), source=b'/var/tmp/portage/kde-plasma/kinfocenter-5.11.4/distdir/glogo-small.png', dest_dir=b'/var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image//usr/share/kinfocenter'
Traceback (most recent call last):
  File "/usr/lib/portage/python3.6/doins.py", line 184, in run
    copyfile(source, dest)
  File "/usr/lib64/python3.6/site-packages/portage/util/file_copy/__init__.py", line 30, in _optimized_copyfile
    _file_copy(src_file.fileno(), dst_file.fileno())
OSError: [Errno 95] Operation not supported
 * ERROR: kde-plasma/kinfocenter-5.11.4::gentoo failed (install phase):
 *   doins failed

The file to be copied is at the correct place and accessible. Also the copy procedure seems to be successful:

ls -al /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/distdir/glogo-small.png
glogo-small.png -> /var/portage/distfiles/glogo-small.png

ls -al /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kinfocenter/glogo-small.png
-rw-r--r-- 1 root root 0 14. Dez 07:07 /var/tmp/portage/kde-plasma/kinfocenter-5.11.4/image/usr/share/kinfocenter/glogo-small.png	

The destination directory (/var/tmp/portage) is located in a tmpfs.


In wine-gecko:

>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/wine-gecko-2.47-r1/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-emulation/wine-gecko-2.47-r1/work ...
>>> Source compiled.
>>> Test phase [not enabled]: app-emulation/wine-gecko-2.47-r1

>>> Install wine-gecko-2.47-r1 into /var/tmp/portage/app-emulation/wine-gecko-2.47-r1/image/ category app-emulation
ERROR:root:Failed to copy file: _parsed_options=Namespace(group=-1, mode=420, owner=-1), source=b'/var/tmp/portage/app-emulation/wine-gecko-2.47-r1/distdir/wine_gecko-2.47-x86.msi', dest_dir=b'/var/tmp/portage/app-emulation/wine-gecko-2.47-r1/image//usr/share/wine/gecko'
Traceback (most recent call last):
  File "/usr/lib/portage/python3.6/doins.py", line 184, in run
    copyfile(source, dest)
  File "/usr/lib64/python3.6/site-packages/portage/util/file_copy/__init__.py", line 30, in _optimized_copyfile
    _file_copy(src_file.fileno(), dst_file.fileno())
OSError: [Errno 95] Operation not supported
 * ERROR: app-emulation/wine-gecko-2.47-r1::gentoo failed (install phase):
 *   doins failed


To exclude Python3.6 I switched back to Python3.5 (eselect python). The error still occurs. 

Reproducible: Always
Comment 1 Sven Müller 2017-12-15 06:23:58 UTC
Created attachment 510076 [details]
emerge --info
Comment 2 Sven Müller 2017-12-15 06:26:18 UTC
Created attachment 510078 [details]
kinfocenter: build.log
Comment 3 Sven Müller 2017-12-15 06:26:45 UTC
Created attachment 510080 [details]
wine-gecko: build.log
Comment 4 Zac Medico gentoo-dev 2017-12-15 06:42:00 UTC
Please create an strace log like this:

strace python -c 'from portage.util.file_copy import copyfile; copyfile("/var/tmp/portage/app-emulation/wine-gecko-2.47-r1/distdir/wine_gecko-2.47-x86.msi", "/var/tmp/portage/app-emulation/wine-gecko-2.47-r1/image/usr/share/wine/gecko/wine_gecko-2.47-x86.msi")' &> /strace.log
Comment 5 Zac Medico gentoo-dev 2017-12-15 17:03:38 UTC
Also, what filesystem type is the source directory (/var/portage/distfiles).
Comment 6 Sven Müller 2017-12-15 17:13:12 UTC
(strace emerge -1 wine-gecko 2>&1 ) > strace.log

https://paste.pound-python.org/show/33rNBJ5zgcKjPRWZZEqw/

filesystem of /var/portage/distfiles:

nas:/portage on /var/portage type nfs4 (rw,noatime,nodiratime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.109.20,local_lock=none,addr=192.168.109.11,_netdev)


filesystem of /var/tmp/portage:

tmpfs on /var/tmp/portage type tmpfs (rw,relatime,size=13631488k)
Comment 7 Sven Müller 2017-12-15 17:14:01 UTC
Created attachment 510192 [details]
strace.log zipped (same content of wgetpaste-link)
Comment 8 Sven Müller 2017-12-15 17:20:01 UTC
Created attachment 510194 [details]
strace.log (short form)

strace python -c 'from portage.util.file_copy import copyfile; copyfile("/var/tmp/portage/app-emulation/wine-gecko-2.47-r1/distdir/wine_gecko-2.47-x86.msi", "/var/tmp/portage/app-emulation/wine-gecko-2.47-r1/image/usr/share/wine/gecko/wine_gecko-2.47-x86.msi")' &> /strace.log
Comment 9 Zac Medico gentoo-dev 2017-12-15 19:13:55 UTC
(In reply to Sven Müller from comment #6)
> (strace emerge -1 wine-gecko 2>&1 ) > strace.log
> 
> https://paste.pound-python.org/show/33rNBJ5zgcKjPRWZZEqw/
> 
> filesystem of /var/portage/distfiles:
> 
> nas:/portage on /var/portage type nfs4
> (rw,noatime,nodiratime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,
> proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.109.20,
> local_lock=none,addr=192.168.109.11,_netdev)

The "Operation not supported" error comes from the lseek SEEK_DATA call on nfs:

> openat(AT_FDCWD, "/var/tmp/portage/app-emulation/wine-gecko-2.47-r1/image/usr/share/wine/gecko/wine_gecko-2.47-x86.msi", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4
> fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> ioctl(4, TCGETS, 0x7ffd67a72eb0)        = -1 ENOTTY (Inappropriate ioctl for device)
> lseek(3, 0, SEEK_DATA)                  = -1 EOPNOTSUPP (Operation not supported)

It's really not supposed to do that. According to the lseek man page:

> In the simplest implementation, a filesystem can support the
> operations by making SEEK_HOLE always return the offset of
> the end of the file, and making SEEK_DATA always return offset
> (i.e., even if the location referred to by  offset is a hole,
> it can be considered to consist of data that is a sequence
> of zeros).

The EOPNOTSUPP error might be a peculiarity of your nfs server.
Comment 10 Zac Medico gentoo-dev 2017-12-15 19:45:20 UTC
I do see some references to ENOTSUPP and EOPNOTSUPP in relation to lseek inside the fs/nfs directory of the linux source code, so we should probably handle it.
Comment 11 Zac Medico gentoo-dev 2017-12-15 21:09:24 UTC
We can handle this exactly the same way as the lseek EINVAL error.
Comment 12 Larry the Git Cow gentoo-dev 2017-12-15 21:17:14 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=58d44d3f4549a45eac1ec9cc99d497bb104438c3

commit 58d44d3f4549a45eac1ec9cc99d497bb104438c3
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-12-15 21:16:05 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-12-15 21:16:16 +0000

    file_copy: handle EOPNOTSUPP from lseek SEEK_DATA (bug 641088)
    
    NFS can set the errno to EOPNOTSUPP for lseek SEEK_DATA.
    
    Bug: https://bugs.gentoo.org/641088

 src/portage_util_file_copy_reflink_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)}
Comment 13 Larry the Git Cow gentoo-dev 2017-12-16 00:38:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=dad9cce8a1e2360e8483e0f78e29e20bd5fdce49

commit dad9cce8a1e2360e8483e0f78e29e20bd5fdce49
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-12-16 00:37:40 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-12-16 00:38:18 +0000

    file_copy: handle EOPNOTSUPP from copy_file_range (bug 641088)
    
    NFS can set the errno to EOPNOTSUPP for copy_file_range.
    
    Bug: https://bugs.gentoo.org/641088

 src/portage_util_file_copy_reflink_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)}
Comment 14 Larry the Git Cow gentoo-dev 2017-12-16 00:59:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a131e603a3a56e7f0d996e5390d48eb2243ace0

commit 7a131e603a3a56e7f0d996e5390d48eb2243ace0
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-12-16 00:50:43 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-12-16 00:58:58 +0000

    sys-apps/portage: version bump to 2.3.19
    
      #640934 - doins: fix PYTHONPATH setting
      #641088 - file_copy: handle EOPNOTSUPP for NFS
    
    Closes: https://bugs.gentoo.org/640934
    Closes: https://bugs.gentoo.org/641088
    Package-Manager: Portage-2.3.18, Repoman-2.3.6

 sys-apps/portage/Manifest                                         | 2 +-
 sys-apps/portage/{portage-2.3.18.ebuild => portage-2.3.19.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)