Bug 537829

Summary: Fastest mirror doesn't use cachedir, doesn't catch errors from unlink.
Product: [Fedora] Fedora Reporter: Filipe Rosset <rosset.filipe>
Component: yum-utilsAssignee: Seth Vidal <skvidal>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: a.aspden, agentbwoy007, allinux4, anim-eh, anto.trande, ayatoujou, baris, baymen, blagoy.chepelov, bloch, BobLfoot, brandon.gardner, bugzilla, ceyhanmolla, contacto, dan, dataeditama, dennisgdaniels, donkishoot, dwald34, dwayne, elgueromexicano, ericosaucedo, erinn.looneytriggs, ffesti, findingharrylime, florian.voudgaarden, fpedraza, froze14ph, Giga_Tarek, happyday19c, james.antill, livermob, ljn917, lmacken, markhuomian, matheus.cg, matthew, maxamillion, maximus0206, mbreitfe, mdmpsyd, me, mohamednasr2000, nikolas.moraitis, ntsurfer, ogro21, omarberroteranlkf, peter.taylor, pmatilai, qash, ray, renlei040766, rh, ryan, ryuslash, sanjay.ankur, shiyicanghai, simenheg, sweigand, tim.lauridsen, tonysk8, tpeplt, uckelman, wellspring3, xxleite, zmanji
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:c2157754
Fixed In Version: yum-utils-1.1.27-2.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-14 17:21:09 UTC Type: ---
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
File: backtrace
none
Patch to make fastestmirror to store timedhosts.txt inside user cache dirs none

Description Filipe Rosset 2009-11-16 13:58:28 UTC
abrt detected a crash.

Attached file: backtrace
cmdline: /usr/bin/python /usr/bin/yum clean all 
component: yum
executable: /usr/bin/yum
kernel: 2.6.31.5-127.fc12.x86_64
package: yum-3.2.25-1.fc12
uuid: c2157754

Comment 1 Filipe Rosset 2009-11-16 13:58:33 UTC
Created attachment 369698 [details]
File: backtrace

Comment 2 James Antill 2009-11-16 14:18:41 UTC
  File "/usr/lib/yum-plugins/fastestmirror.py", line 119, in clean_hook
    os.unlink(hostfilepath)
OSError: [Errno 13] Permisso negada: '/var/cache/yum/timedhosts.txt'

Comment 3 Filipe Rosset 2009-11-16 17:42:16 UTC
Hi James.
The best return should be something like

[rosset@rosset ~]$ yum update
Plugins carregados: fastestmirror, presto
VocĂȘ precisa ser root para executar este comando.
[rosset@rosset ~]$ 

rosset = normal user without privileges

Comment 4 seth vidal 2009-11-16 21:02:01 UTC
actually, if it uses the cachedir then there won't be a non-user-priveleges issue since the  timedhosts file will be in the user-owned cache dir /var/tmp/....

Comment 5 Baris Cicek 2010-03-05 19:09:01 UTC

Comment
-----
Can't it handle permission denied message without crashing?

Comment 6 Mohamed Nasr Ahmed 2010-03-11 10:10:04 UTC

How to reproduce
-----
1.open yakuak 
2. excute yum clean all
3. excute yum clean all

Comment 7 Daniel Scott 2010-03-12 17:20:30 UTC

How to reproduce
-----
1. run `yum clean all`
2.
3.

Comment 8 Simen 2010-03-27 12:33:12 UTC

How to reproduce
-----
1. Clean the yum cache with BleachBit (http://bleachbit.sourceforge.net/).

Comment
-----
The error occurs whenever BleachBit is run with options 'yum -> clean all' turned on. Reproducable every time.

Comment 9 Mohammed Arafa 2010-03-28 12:13:59 UTC

How to reproduce
-----
1.run yum clean all as non root user
2.
3.

Comment 10 maximus0206 2010-03-31 07:35:02 UTC

How to reproduce
-----
1. yum clean all
2.
3.

Comment 11 Szymon 2010-04-08 14:41:25 UTC

Comment
-----
run command yum clean all via user (not root)

Comment 12 Jonathan 2010-04-11 20:12:51 UTC

How to reproduce
-----
1. ran "yum clean all" as non-root user
2.
3.

Comment 13 Baris Cicek 2010-04-11 22:42:47 UTC
Created attachment 405863 [details]
Patch to make fastestmirror to store timedhosts.txt inside user cache dirs

This patch make fastestmirror to use cachedirs inside /var/tmp/. Also puts unlink inside try block in case it could not still remove timedhosts.txt file. 

fastestmirror.conf file should also be changed (ie. cachedir option should be removed since it only uses /var/tmp cachedir on default). 

I'm not quite sure if importing misc is a good idea in order to get user cachedir, but I could not think out any other way than this. And I'm not a python/yum hacker so maybe there's another alternative without importing.

Anyways, I'm kind of bored getting CC-add notices for this trivial bug, so I hope it's fixed now.

Comment 14 James Antill 2010-04-12 14:35:14 UTC
 I didn't catch unlink (Eg. use unlink_f from misc), but that shouldn't be needed after the other fix:

http://yum.baseurl.org/gitweb?p=yum-utils.git;a=commitdiff;h=b4c9ab9ecf7e602f78836ba34b1fc3994904e533

Comment 15 Kaloyan Petrov 2010-04-14 07:21:37 UTC

How to reproduce
-----
1.yum clean all
2.
3.


Comment
-----
I tried to do 'yum clean all' as a normal user.
I wasnt able to reproduce it. I cleaned the yum data as root, then issue 'yum clean all' as the normal user again, and it worked.

Comment 16 happyday19c 2010-04-18 02:24:13 UTC
Package: yum-3.2.27-2.fc13
Architecture: i686
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. when run yum with no root previlleges, this traceback appears
2.
3.

Comment 17 ryuslash 2010-04-20 17:34:09 UTC

How to reproduce
-----
1. yum clean all

Comment
-----
I just tried a 'yum clean all' without having root privileges

Comment 18 Mark Harig 2010-04-25 00:12:45 UTC
Package: yum-3.2.27-2.fc12
Architecture: x86_64
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1. Enter the command 'yum clean plugins' at a bash shell prompt.  Do this as a non-root user.
2. This triggered 'abrt' and generated the backtrace, above.
3. I repeated the command using 'sudo' and the command completed with no errors.

Comment 19 Dwayne Bailey 2010-05-05 09:19:46 UTC
Package: yum-3.2.27-3.fc12
Architecture: i686
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1. As non-root user
2. yum clean all


Comment
-----
We should fail gracefully as we do with yum install when the user is not root.

Comment 20 Tim Lauridsen 2010-05-05 14:30:07 UTC
I have fixed it upstream

http://yum.baseurl.org/gitweb?p=yum-utils.git;a=commitdiff;h=cc7b91218b7828ccb949b53401c66895a7fadf9d

yum clean plugins

and 

yum list updates

now work as non root, with the plugin installed.

Comment 21 James Antill 2010-05-11 14:20:32 UTC
*** Bug 591054 has been marked as a duplicate of this bug. ***

Comment 22 pleabargain 2010-05-12 07:54:54 UTC
Package: yum-3.2.27-3.fc12
Architecture: i686
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1.trying to work around rpmfusion not working
2.deleted rpmfusion repos
3.ran yum clean all
4.error

Comment 23 pleabargain 2010-05-12 08:07:15 UTC
Package: yum-3.2.27-3.fc12
Architecture: i686
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1.installing rpmfusion
2.all kinds of errors saying no transaction
3.had to delete them and reinstall
yum still unhappy


Comment
-----
1.installing rpmfusion
2.all kinds of errors saying no transaction
3.had to delete them and reinstall
yum still unhappy

Comment 24 Ankur Sinha (FranciscoD) 2010-05-15 12:09:09 UTC
Package: yum-3.2.27-4.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. i tried yum history as a non root user
2. 
3.


Comment
-----
it shouldn't crash, give an error saying "you need to be root" as it does for other commands?

Comment 25 Joel Uckelman 2010-05-18 18:52:09 UTC
Package: yum-3.2.27-3.fc12
Architecture: x86_64
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----



Comment
-----
Ran 'sudo yum update'.

Comment 26 Adam Huffman 2010-05-19 10:09:26 UTC
Package: yum-3.2.27-3.fc12
Architecture: x86_64
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1. Mistakenly tried yum command as a normal user
2.
3.

Comment 27 Davide Repetto 2010-05-19 23:32:47 UTC
Package: yum-3.2.27-3.fc12
Architecture: i686
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1. do a "yum clean all" as user 
2.
3.


Comment
-----
It should fail more gracefully.

Comment 28 Tim Lauridsen 2010-05-26 04:31:18 UTC
*** Bug 595908 has been marked as a duplicate of this bug. ***

Comment 29 Robert Lightfoot 2010-05-29 03:01:37 UTC
Package: yum-3.2.27-1.fc12
Architecture: x86_64
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1.yum clean all
2.
3.

Comment 30 Mohammed Arafa 2010-05-31 13:14:31 UTC
Package: yum-3.2.27-4.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1.yum clean all as a normal user

Comment
-----
ran "yum clean all" as a normal user 

yum should respond with something along the lines of "you are not root - quitting"

Comment 31 Erinn Looney-Triggs 2010-06-06 05:40:49 UTC
Package: yum-3.2.27-4.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. Run yum clean all with fastestmirror installed without root privileges
2.
3.


Comment
-----
Probably shouldn't crash just because it can't get access to a file.

-Erinn

Comment 32 Fedora Update System 2010-06-06 13:44:35 UTC
yum-utils-1.1.27-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/yum-utils-1.1.27-1.fc13

Comment 33 Fedora Update System 2010-06-08 19:35:04 UTC
yum-utils-1.1.27-2.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-utils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/yum-utils-1.1.27-2.fc13

Comment 34 Aymen 2010-06-11 08:07:24 UTC
Package: yum-3.2.27-3.fc12
Architecture: x86_64
OS Release: Fedora release 12 (Constantine)


How to reproduce
-----
1.when i do yum clean all and i am not a suoer user
2.
3.

Comment 35 Fedora Update System 2010-06-14 17:19:59 UTC
yum-utils-1.1.27-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.