| View previous topic :: View next topic |
| Author |
Message |
thomasvk Guru

Joined: 19 Mar 2005 Posts: 599
|
Posted: Thu Nov 09, 2006 2:36 pm Post subject: emerge: "IOError: [Errno 13] Permission denied" |
|
|
| Code: | # emerge portage
Calculating dependencies... done!
>>> Emerging (1 of 1) sys-apps/portage-2.1.2_rc1-r5 to /
Adjusting permissions recursively: '/mnt/data/portage/distfiles/'
* portage-2.1.2_rc1.tar.bz2 MD5 ;-) ... [ ok ]
* portage-2.1.2_rc1.tar.bz2 RMD160 ;-) ... [ ok ]
* portage-2.1.2_rc1.tar.bz2 SHA1 ;-) ... [ ok ]
* portage-2.1.2_rc1.tar.bz2 SHA256 ;-) ... [ ok ]
* portage-2.1.2_rc1.tar.bz2 size ;-) ... [ ok ]
Traceback (most recent call last):
File "/usr/bin/emerge", line 4528, in ?
retval = emerge_main()
File "/usr/bin/emerge", line 4523, in emerge_main
myopts, myaction, myfiles, spinner)
File "/usr/bin/emerge", line 4022, in action_build
retval = mergetask.merge(pkglist, favorites, mtimedb)
File "/usr/bin/emerge", line 2433, in merge
prev_mtimes=ldpath_mtimes)
File "/usr/lib/portage/pym/portage.py", line 3062, in doebuild
if need_distfiles and not fetch(
File "/usr/lib/portage/pym/portage.py", line 2387, in fetch
portage_locks.unlockfile(file_lock)
File "/usr/lib/portage/pym/portage_locks.py", line 145, in unlockfile
locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 13] Permission denied |
I get this with whatever I emerge. /mnt/data/ is on a cifs network share and when I umount it works. I have always had the "Adjusting permissions recursively: '/mnt/data/portage/distfiles/'" messages so that's not it. Also it just worked like a charm yesterday. What I have done? I don't even know anymore... maybe it was pressing CTRL+C when emerge was calculating something and I thought I needed to add another USE-flag. Maybe the server's gone crazy. Maybe it's the phase of the moon. Any hints on how to fix this would be helpful, thanks. |
|
| Back to top |
|
 |
hielvc Advocate

Joined: 19 Apr 2002 Posts: 2776 Location: Oceanside, Ca
|
Posted: Thu Nov 09, 2006 3:42 pm Post subject: |
|
|
What are your permissions on /mnt/data/portage/distfiles/ ? What does df -h show ? What does "date" return on both boxins ? If the affore mentioned look good can you "touch /mnt/data/portage/distfiles/test.file" and "touch /var/tmp/portage/test.file" _________________ An A-Z Index of the Linux BASH command line |
|
| Back to top |
|
 |
thomasvk Guru

Joined: 19 Mar 2005 Posts: 599
|
Posted: Fri Nov 10, 2006 3:11 pm Post subject: |
|
|
| Owner t0maz:portage (portage group for portage and t0maz because I cifs-mount it as t0maz) with permissions 0755. df -h says 6GB available, date is about the same on both (a few seconds difference). I can touch both files. I don't think that's the kind of problems to look at because as I said: it worked, I probably screwed something up by pressing some wrong keys and then it stopped working. |
|
| Back to top |
|
 |
Genone Retired Dev


Joined: 14 Mar 2003 Posts: 8690 Location: beyond the rim
|
Posted: Fri Nov 10, 2006 3:18 pm Post subject: |
|
|
| Check permissions of $DISTDIR/.locks and files in it. If that doesn't help you might need to set FEATURES="-distlocks" in make.conf (or if you have userfetch enabled disable it). |
|
| Back to top |
|
 |
thomasvk Guru

Joined: 19 Mar 2005 Posts: 599
|
Posted: Fri Nov 10, 2006 5:56 pm Post subject: |
|
|
| Genone wrote: | | Check permissions of $DISTDIR/.locks and files in it. If that doesn't help you might need to set FEATURES="-distlocks" in make.conf (or if you have userfetch enabled disable it). |
I have removed all files in .locks, removed the dir, reset permissions to 777 on the dir in a crazy attempt, etc. I will try the distlocks tho, thanks for the suggestion. I find this breakage rather annoying and,... random. |
|
| Back to top |
|
 |
thomasvk Guru

Joined: 19 Mar 2005 Posts: 599
|
Posted: Sat Nov 11, 2006 8:19 am Post subject: |
|
|
| With that option it works. What do you suggest to fix this permanently? |
|
| Back to top |
|
 |
thomasvk Guru

Joined: 19 Mar 2005 Posts: 599
|
Posted: Tue Nov 14, 2006 11:02 am Post subject: |
|
|
| t0maz wrote: | | With that option it works. What do you suggest to fix this permanently? |
*Bump*  |
|
| Back to top |
|
 |
hielvc Advocate

Joined: 19 Apr 2002 Posts: 2776 Location: Oceanside, Ca
|
Posted: Tue Nov 14, 2006 4:18 pm Post subject: |
|
|
I suspect that it was a stale lock file. "lock" files are mechcanisms that help progarms keep track of what the left and right hands are doing. Most people are running mutipule makes, -j3. So when make1 starts compiling line1 it sets a lock file that makeMaster can use to keep the next make2 from building the same line1 and instead tells to it to build line2. When make1 is done its suppose to remove its lock file, get a new line an make another lock file. Some times the earth moves and that first lock file doesnt get removed. Portage also uses lock files and for some reason it didnt get removed. If you can figure out how to prevent randome glitchs like this on computers Billy Bob Gates would like to talk to you.  _________________ An A-Z Index of the Linux BASH command line |
|
| Back to top |
|
 |
Genone Retired Dev


Joined: 14 Mar 2003 Posts: 8690 Location: beyond the rim
|
Posted: Tue Nov 14, 2006 10:41 pm Post subject: |
|
|
| Sorry, don't know the internals of the locking subsystem, probably best to file a bug so Zac can take a look. |
|
| Back to top |
|
 |
thomasvk Guru

Joined: 19 Mar 2005 Posts: 599
|
Posted: Wed Nov 15, 2006 2:20 pm Post subject: |
|
|
hielvc, I understand how it works but I didn't mean 'permanently' as to get rid of general problems with lockfiles but still this specific case. Now I have -distlocks still in my FEATURES and I'd like to know a way so I can remove that and use portage 'normally' again. I have already tried removing lockfiles in the $DISTFILES/.locks directory but are there any other lockfiles I could try to remove to fix this?
Genone: I would fix a bugreport... IF I would know how to reproduce this... |
|
| Back to top |
|
 |
Mickael Advocate


Joined: 05 Sep 2005 Posts: 2345 Location: ~Paris! - France - EU
|
Posted: Wed Nov 15, 2006 2:35 pm Post subject: |
|
|
Hi,
if you use reiser filesystem, try this :
take a live CD and :
| Quote: |
# reiserfsck --check /dev/sdaX
then
# reiserfsck --rebuild-tree /dev/sdaX
|
then reboot.
http://forums.gentoo.org/viewtopic-t-516233.html _________________ À LIRE : COMMENT POSTER ET OBTENIR DE L'AIDE ?
Qui suis-je ? Bon j'ai relu, comme d'habitude, je suis bon a rien le vendredi
Qui suis-je ? Je ne serai jamais modo
Last edited by Mickael on Wed Nov 15, 2006 3:16 pm; edited 1 time in total |
|
| Back to top |
|
 |
Genone Retired Dev


Joined: 14 Mar 2003 Posts: 8690 Location: beyond the rim
|
Posted: Wed Nov 15, 2006 2:42 pm Post subject: |
|
|
| MickTux wrote: | Hi,
if you use XFS, try this :
take a live CD and :
| Quote: |
# reiserfsck --check /dev/sdaX
then
# reiserfsck --rebuild-tree /dev/sdaX
|
then reboot.
|
*Sigh*, if you already don't care to read the post itself at least your suggestion should make *some* sense (hint: suggesting to run reiserfsck on a xfs filesystem doesn't make sense in itself, even more if the OP said that he uses a CIFS share).
Don't take this personal, but I've seen quite a number of posts recently that give me the impression that some people really don't care to read the original post (that's not the same as just scanning the topic and maybe the error message in the post) anymore before posting a (useless and nonsense) reply, makes me wonder if this is a new postcount addiction or so. |
|
| Back to top |
|
 |
Mickael Advocate


Joined: 05 Sep 2005 Posts: 2345 Location: ~Paris! - France - EU
|
Posted: Wed Nov 15, 2006 3:15 pm Post subject: |
|
|
| Genone wrote: | | MickTux wrote: | Hi,
if you use XFS, try this :
take a live CD and :
| Quote: |
# reiserfsck --check /dev/sdaX
then
# reiserfsck --rebuild-tree /dev/sdaX
|
then reboot.
|
*Sigh*, if you already don't care to read the post itself at least your suggestion should make *some* sense (hint: suggesting to run reiserfsck on a xfs filesystem doesn't make sense in itself, even more if the OP said that he uses a CIFS share).
|
Excuse me. XFS filesystem with some reiserfs tools is a big error, i will be more attentive the next time. I m confused.
even more if the OP said that he uses a CIFS share : I had not noticed it.
OK : it was just here : I get this with whatever I emerge. /mnt/data/ is on a cifs network share and when I umount it works
| Genone wrote: |
Don't take this personal, but I've seen quite a number of posts recently that give me the impression that some people really don't care to read the original post (that's not the same as just scanning the topic and maybe the error message in the post) anymore before posting a (useless and nonsense) reply, makes me wonder if this is a new postcount addiction or so. |
maybe. _________________ À LIRE : COMMENT POSTER ET OBTENIR DE L'AIDE ?
Qui suis-je ? Bon j'ai relu, comme d'habitude, je suis bon a rien le vendredi
Qui suis-je ? Je ne serai jamais modo |
|
| Back to top |
|
 |
thomasvk Guru

Joined: 19 Mar 2005 Posts: 599
|
Posted: Sun Nov 19, 2006 5:40 pm Post subject: |
|
|
Well now I get this on my laptop too... while yesterday it still worked perfectly and I didn't change anything since then. Not even a portage upgrade or anything.
Any ideas on how to fix this? |
|
| Back to top |
|
 |
TinheadNed Guru


Joined: 05 Apr 2003 Posts: 337 Location: Farnborough, UK
|
Posted: Fri Dec 22, 2006 2:41 pm Post subject: |
|
|
I've started getting this, but with a different backtrace
| Code: | File "/usr/bin/emerge", line 5053, in ?
retval = emerge_main()
File "/usr/bin/emerge", line 5048, in emerge_main
myopts, myaction, myfiles, spinner)
File "/usr/bin/emerge", line 4521, in action_build
retval = mergetask.merge(pkglist, favorites, mtimedb)
File "/usr/bin/emerge", line 2810, in merge
prev_mtimes=ldpath_mtimes)
File "/usr/lib/portage/pym/portage.py", line 3265, in doebuild
(mydo not in ["digest","fetch","unpack"] and \
File "/usr/lib/portage/pym/portage.py", line 2613, in digestcheck
mf.checkFileHashes(mf.findFile(f), f)
File "/usr/lib/portage/pym/portage_manifest.py", line 506, in checkFileHashes
ok,reason = verify_all(self._getAbsname(ftype, fname), self.fhashdict[ftype][fname])
File "/usr/lib/portage/pym/portage_checksum.py", line 120, in verify_all
myhash = perform_checksum(filename, x, calc_prelink=calc_prelink)[0]
File "/usr/lib/portage/pym/portage_checksum.py", line 182, in perform_checksum
myhash, mysize = hashfunc_map[hashname](myfilename)
File "/usr/lib/portage/pym/portage_checksum.py", line 30, in md5hash
return fchksum.fmd5t(filename)
|
This is different to the ones shown before and not fixable with the posted workarounds. Why the hell do hashes fail? Is it just the newer portage version (portage-2.1.2_rc3-r6) ? |
|
| Back to top |
|
 |
casso Tux's lil' helper


Joined: 12 Mar 2006 Posts: 107 Location: Newcastle, NSW, Australia
|
Posted: Thu Mar 06, 2008 10:24 pm Post subject: STill happening on portage-2.1.4.4 |
|
|
I am still finding that this issue is occurring on portage-2.1.4.4. I have looked through some of the code to see exactly what is going on. I can't say that I have it perfectly down, but I believe this is what happens. I assume that userfetch is listed in your FEATURES variable. The code in question is in the file /usr/lib/portage/pym/portage_locks.py
1. If a lock file does not exist, then create the file with mode 0660 as portage:portage. With the file handle now created for the file, attempt to lock the file:
fcntl.lockf(myfd,fcntl.LOCK_EX|fcntl.LOCK_NB) or similar
2. If a lock file does exist, then simply gain a file handle to it and attempt to lock the current file in the same manner. There are a few exceptions that are checked in case the lock does not succeed. One of these is NOT our IOError 13: Permission Denied error from what I can gather.
I have checked my Samba server to see if it is causing permission problems. At the start of this exercise it was, but I have since resolved that and found that the same conditions still exist. I know the original error in this post was pointed at trouble unlocking the file, which could be an inode issue (use serverino mount option), but the issue has spread to when two instances of portage attempt to work with lock files. Of interest is the fact that the Samba server has no problems with the lock files when a CIFS client has locked a file before the server gets to it.
I do believe that this is a genuine bug, but wanted some feedback before I decide to submit a bug report. _________________ Need assistance with any of the following? Just PM me and I will see what I can do
LDAP, Kerberos , SSH, Samba, PPP, DHCP, NTP, autofs, CUPS |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|