User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5 Build Identifier: emerge crashes every time I try to use it I can't run emerge portage, emerge --websync etc. Reproducible: Always Steps to Reproduce: 1.emerge always crashes Actual Results: kaska@Ginkgo ~ $ sudo emerge --sync Performing Global Updates: /usr/portage/profiles/updates/2Q-2006 (Could take a couple of minutes if you have a lot of binary packages.) .='update pass' *='binary update' @='/var/db move' s='/var/db SLOT move' S='binary SLOT move' p='update /etc/portage/package.*' ........................................ pTraceback (most recent call last): File "/usr/bin/emerge", line 4049, in ? emerge_main() File "/usr/bin/emerge", line 3770, in emerge_main portage.global_updates(settings, trees, mtimedb["updates"]) File "/usr/lib/portage/pym/portage.py", line 6645, in global_updates myupd) File "/usr/lib/portage/pym/portage_update.py", line 198, in update_config_files write_atomic(updating_file, "".join(file_contents[x])) File "/usr/lib/portage/pym/portage_util.py", line 728, in write_atomic f.close() File "/usr/lib/portage/pym/portage_util.py", line 696, in close os.rename(self.name, self._real_name) OSError: [Errno 16] Device or resource busy Expected Results: emerge should work properly...
Created attachment 96536 [details] configuration
*** Bug 147009 has been marked as a duplicate of this bug. ***
(In reply to comment #0) > OSError: [Errno 16] Device or resource busy That appears to be some type of device/filesystem/kernel misbehavior. It happened while portage was attempting to apply package moves to one of the /etc/portage/package.* files.
Somebody reported the same error on the gentoo-user mailing list recently. Anyway, portage can't really guarantee much when something low level like that fails unexpectedly.
Same here, seems that to this fail start facing more people. Today emerge worked as always - correctly, till I synced a little while ago. No, I am not able to emerge enything, cant sync anymore, also emerge --info fails same way. As Zac reported that its some type of device/filesystem/kernel misbehavior. I am sorry, dont understand what it means. But would be nice, if somebody can help how to make portage working again. Thanks.
(In reply to comment #5) > As Zac reported that its some type of device/filesystem/kernel misbehavior. I > am sorry, dont understand what it means. But would be nice, if somebody can > help how to make portage working again. Thanks. You've got the operating system returning a "OSError: [Errno 16] Device or resource busy" error when portage is trying to rename a file in /etc/portage/. Things you should check: 1) Is the filesystem okay (is the reiser4 or some other experimental filesystem)? 2) Is the device and/or driver okay (maybe there's something interesting in the system log)? 3) Is the kernel okay (maybe there's a bug due to a bad patch or something)?
Well, maybe 4) Are you using NFS / and have those files open/used by something else?
Just tried to look at "tail -f /var/log/messages" while trying to use emerge command (which failed) and nothing was written to the log. # dmesg | grep hda ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:DMA, hdb:pio hda: ST320410A, ATA DISK drive hda: max request size: 128KiB hda: 39102336 sectors (20020 MB) w/2048KiB Cache, CHS=38792/16/63, UDMA(100) hda: cache flushes not supported hda: hda1 hda2 hda3 < hda5 hda6 hda7 hda8 > ReiserFS: hda7: found reiserfs format "3.6" with standard journal ReiserFS: hda7: using ordered data mode ReiserFS: hda7: journal params: device hda7, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 ReiserFS: hda7: checking transaction log (hda7) ReiserFS: hda7: Using r5 hash to sort names ReiserFS: hda6: found reiserfs format "3.6" with standard journal ReiserFS: hda6: using ordered data mode ReiserFS: hda6: journal params: device hda6, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 ReiserFS: hda6: checking transaction log (hda6) ReiserFS: hda6: Using r5 hash to sort names ReiserFS: hda2: found reiserfs format "3.6" with standard journal ReiserFS: hda2: using ordered data mode ReiserFS: hda2: journal params: device hda2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 ReiserFS: hda2: checking transaction log (hda2) ReiserFS: hda2: Using r5 hash to sort names ReiserFS: hda8: found reiserfs format "3.6" with standard journal ReiserFS: hda8: using ordered data mode ReiserFS: hda8: journal params: device hda8, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 ReiserFS: hda8: checking transaction log (hda8) ReiserFS: hda8: Using r5 hash to sort names Adding 546168k swap on /dev/hda5. Priority:-1 extents:1 across:546168k I dont see anything strangethere, same messages are in /var/log/messages. If looking there without grep, nothing interesting. I am using ck-sources, my last installation was done on August 27 and it was version 2.6.17_p1-r3. I tried right now manually (with krusader) rename all files in /etc/portage/ with succes. Same with renaming to original names that. Finally, when I havent idea, what NFS is good for, I am probably not using it.
(In reply to comment #7) > Well, maybe 4) Are you using NFS / and have those files open/used by something > else? It unlikely, considering that /etc/portage/ is generally under CONFIG_PROTECT. Portage creates a temporary file such as '/etc/portage/._cfg0000_package.use.8756' where .8756 represents the pid of the emerge process. After it's done writing the file, it tries to move it to '/etc/portage/._cfg0000_package.use' and recieves a "Device or resource busy" error. Generally, the new file has a unique name that didn't exist before, so there wouldn't be any reason for something to have an exclusive lock on it already. (In reply to comment #8) > I dont see anything strangethere, same messages are in /var/log/messages. If > looking there without grep, nothing interesting. Have you tried rebooting the system yet? That may resolve the problem, at least temporarily.
> (In reply to comment #8) > > I dont see anything strangethere, same messages are in /var/log/messages. If > > looking there without grep, nothing interesting. > > Have you tried rebooting the system yet? That may resolve the problem, at > least temporarily. Yes, I tried, but still portage is unusable > same error.
(In reply to comment #6) > 1) Is the filesystem okay (is the reiser4 or some other experimental > filesystem)? > 2) Is the device and/or driver okay (maybe there's something interesting in > the > system log)? > 3) Is the kernel okay (maybe there's a bug due to a bad patch or something)? > Ad.1 It's reiserfs 3.6 and it seems looking O.K. Ad.2 There are nothing interesting in system log. Ad.3 This is exacly the same kernel I used when emerge was working fine. > 4) Are you using NFS / and have those files open/used by something > else? No. emerge broke after emerge --sync I was following instructions in http://tinyurl.com/em7lr , but nothing works for me...
(In reply to comment #11) > Ad.1 It's reiserfs 3.6 and it seems looking O.K. Well, you both have reiserfs in common. Have you tried reiserfsck on the filesystem?
I suffer from this problem too, i use ext3. I have yet to seriously look into the problem, but i will report more once i have.
I just tried to reproduce this and surprisingly, I am able to! I'm going to see if I can create a test case and find out what's causing it.
Created attachment 96616 [details, diff] fix config file updates This patch fixes the problem. The errno 16 actually results from incorrect file names being passed into the rename call. If the patch is saved as /tmp/update_config.patch, then it can be applied as follows: cd /usr/lib/portage patch -p0 < /tmp/update_config.patch
This solved it for me (as far as i can see now), thanks for the fix.
It works for me too - thanks a lot.
(In reply to comment #15) > cd /usr/lib/portage > patch -p0 < /tmp/update_config.patch Great, thanks for solving my life. I was affraiding of playing with reiserfsck :-)
Works for me too. Is this patch upstream yet? I've got a box in the process of an emerge -uDN world as I type. (It's 1-2 days after this patch has been submitted and my laptop didn't get it yesterday before a sync & update.)
(In reply to comment #20) > Is this patch upstream yet? I've got a box in the process of an emerge -uDN > world as I type. Actually, I am upstream. It's not available in an official release yet, but it will be in the near future. > (It's 1-2 days after this patch has been submitted and my laptop didn't get it > yesterday before a sync & update.) The error is only triggered when one or more of /etc/portage/package.* files contain the old names of packages that have been recently moved. Therefore, the problem will be triggered infrequently for random users. For the time being, it's possible to work around the issue by adding CONFIG_PROTECT_MASK="/etc/portage" to make.conf. Generally, it's safe to mask config protection in /etc/portage since the only reason those config files will be updated is for package moves that are performed by portage itself.
This has been released in 2.1.2_pre1.
This has also been released in 2.1.1-r1.
*** Bug 151580 has been marked as a duplicate of this bug. ***
*** Bug 152626 has been marked as a duplicate of this bug. ***
*** Bug 153073 has been marked as a duplicate of this bug. ***
emerge -av nano Performing Global Updates: /usr/portage/profiles/updates/4Q-2006 (Could take a couple of minutes if you have a lot of binary packages.) .='update pass' *='binary update' @='/var/db move' s='/var/db SLOT move' S='binary SLOT move' p='update /etc/portage/package.*' ...... Traceback (most recent call last): File "/usr/bin/emerge", line 4503, in ? retval = emerge_main() File "/usr/bin/emerge", line 4214, in emerge_main portage.global_updates(settings, trees, mtimedb["updates"]) File "/usr/lib/portage/pym/portage.py", line 7128, in global_updates trees["/"]["bintree"].move_ent(update_cmd) File "/usr/lib/portage/pym/portage.py", line 5510, in move_ent self.populate() File "/usr/lib/portage/pym/portage.py", line 5755, in populate mycat = mytbz2.getfile("CATEGORY").strip() AttributeError: 'NoneType' object has no attribute 'strip'
the patch didn't worked for me
solved by: *download a portage tarball and remplace the old portage with the tarba;; *copy /usr/old-portage/local/layman/make.conf /usr/portage/local/layman/make.conf
What kind of patch? Upgrade your portage.
(In reply to comment #27) > File "/usr/lib/portage/pym/portage.py", line 5755, in populate > mycat = mytbz2.getfile("CATEGORY").strip() > AttributeError: 'NoneType' object has no attribute 'strip' That's a new bug, apparently triggered by a corrupt binary package. I've filed bug 153181 to track that one.
*** Bug 153248 has been marked as a duplicate of this bug. ***
*** Bug 159382 has been marked as a duplicate of this bug. ***
Just wanted to let everyone know, I have been emerging recently (just fine), I run emerge --sync every night, and I just got this same error today. Also waned to let you know that the patch fixed it perfectly!