2009-11-18

Preupgrade crash when resuming

UPDATE

Seth Vidal has a better solution. Rather than just catching the exception, you can prevent it by correcting the error in the code, as noted by Anonymous in the comments:

Patch from Seth Vidal:
https://bugzilla.redhat.com/show_bug.cgi?id=538118#c41

diff --git a/preupgrade/__init__.py b/preupgrade/__init__.py
index 2e82f1e..d79ec4b 100644
--- a/preupgrade/__init__.py
+++ b/preupgrade/__init__.py
@@ -325,7 +325,7 @@ class PreUpgrade(yum.YumBase):
rf = open(repofile,"w")
for repo in [self.instrepo] + self.repos.listEnabled():
# adapted from YumRepository.write()
- repo._grabfunc.opts.user_agent = __user_agent__
+ repo.grabfunc.opts.user_agent = __user_agent__
yc = yumConfigParser()
yc.add_section(repo.id)
for k,v in repo.iteritems():

So the problem is that it tried to use _grabfunc, which doesn't exist, instead of grabfunc. Yay.

I was trying to upgrade to Fedora 12 today via preupgrade but had to stop my upgrade session due to a network issue. When I tried to resume, as you're supposed to be able to do, it started getting the metadata again and then it suddenly crashed!

[root@localhost ~]# preupgrade
/usr/lib/python2.6/site-packages/yum/__init__.py:203: UserWarning: Use .preconf instead of passing args to _getConfig
  warnings.warn('Use .preconf instead of passing args to _getConfig')
Loaded plugins: blacklist, dellsysidplugin2, presto, refresh-packagekit,
              : whiteout
Detected in-progress upgrade to Fedora 12 (Constantine)
....
preupgrade-updates (mirrorlist) 
  url: https://mirrors.fedoraproject.org/metalink?repo=updates-released-f12&arch=i386
  now: https://mirrors.fedoraproject.org/metalink?repo=updates-released-f12&arch=i386
unknown metadata being downloaded: metalink
Traceback (most recent call last):
  File "/usr/share/preupgrade/preupgrade-gtk.py", line 764, in 
    widgets = PreUpgradeGtk()
  File "/usr/share/preupgrade/preupgrade-gtk.py", line 376, in __init__
    self._do_main()
  File "/usr/share/preupgrade/preupgrade-gtk.py", line 259, in _do_main
    self.main_preupgrade()
  File "/usr/share/preupgrade/preupgrade-gtk.py", line 436, in main_preupgrade
    download_progressbar=self.dnlProgress)
  File "/usr/lib/python2.6/site-packages/preupgrade/__init__.py", line 130, in setup
    self.complete_repo_setup()
  File "/usr/lib/python2.6/site-packages/preupgrade/__init__.py", line 328, in complete_repo_setup
    repo._grabfunc.opts.user_agent = __user_agent__
AttributeError: 'NoneType' object has no attribute 'opts'

That's obnoxious. I didn't want to restart it, as I'd already downloaded over a hundred MB of files. So, as root I looked at the file tripping the AttributeError, /usr/lib/python2.6/site-packages/preupgrade/__init__.py, and decided to catch the error:

    repo._grabfunc.opts.user_agent = __user_agent__            

became

try:                                                            
    repo._grabfunc.opts.user_agent = __user_agent__             
except AttributeError:                                          
    print "Can't set user_agent, repo._grabfunc = NoneType :( "

I then ran it again, and this caught two exceptions, but allowed me to proceed with seemingly no loss of functionality. I am now happily downloading still more amazing amounts of MB. Hurrah!

Now to file a relevant bug if it doesn't already exist. The oft duplicated, already existent RH bug is 538118.

Labels

#General #Microblog friends life #Technology gnome music google iaido guelph fedora vegan food bugs school technology linux #GNOME #School jodo gxml #Budo blogger #Photos nature web work happy vala art Flesherton anime firefox internet android stress travel home kendo kosmokaryote open source writing birthday dad science animals computers environment security canada cookies development future programming photos reading sick snow video winter GUADEC cell phones css fun language me people phone ta time christmas evolution german learning love movies picasaweb sleep vegetarianism Toronto gsoc society speech vlogbrothers #Vegan adventure ai birds dreams git google+ gseta happiness identity libgdata new zealand night skedge stars tea vancouver wind mobile Nintendo baking cake consumerism fedora 17 nlp photography quote responsibility tablet uoguelph Josh Ritter books communication design humanity javascript magic meaning memories money netflix organisation pidgin recipes speechdispatcher sushi weather Spain TAing animalia cat chocolate cold cycling death encryption facebook family film flight genderguesser halloween health knowledge liv mail memory new years nightmares politics productivity psychology rain swords the legend of zelda tv ubuntu web development xml xorg youtube Thanksgiving acer bc blogging bug busy conversation emusic fedora 18 galaxy nexus gay rights gitorious gmail japan languages libxml2 martial arts materialism nerdfighteria privacy rhythmbox software sound space university upgrade valentines video games wahoo walking Con-G Europe John Green Scott Pilgrim The Frames age animal welfare apple autumn bash brave breath of fire II calm camera change clothing comments confidence conservation cooking creativity culture dance dataloss djaqua e-mail emacs errors feminism gdom germany goals google reader gtk humour intelligence japanese laundry law light math morning nostalgia ottawa peterborough pets philosophy pie quality research sei do kai shopping spring style summer value village vday vonage water web design website x11 New York alone anime north anxiety argument blog brain budo buffy business cats computer science concert data loss diy duolingo duplicity eating economy energy english exercise failure fedora 19 file systems flowers freedom french games gdata greyhound habits heat history house html im information joy koryu laptop living lost microsoft moon moving mozilla muffins mystery news nz pain photo php physics pirates pizza play poverty preupgrade progress purple python reflection religion rss self serialisation sharing skating social sun synergy tachi uchi testing themes thesis thinking transit turtles veggie challenge velociraptors violin weekend weird zellers API Air Canada Empathy Hank Green Hugo Jane Austen Lord of the Rings Nexus One OCUS Sudbury Trick or Eat arboretum audible autonomous automobiles backup beauty bike blogs browsers camping canada day cancer canoeing celebration charity chrome colour community content copyright corporations crafts decay decor depression depth disaster drawing education emotion epic equality faery fest farmer's market fedora 12 fedora 16 fedora 20 fedora 22 fedup friend gender ghetto ghosts glib gnome blog gnome shell google talk green growth hair hobocore hungry icarus ice cream interest introspection java jobs last exile luks macbook mail-notification mario meat in vitro mind mom moon festival motivation mtp ninjas oh the humanity pagans pants papers past performance perl phones picnics pitivi plastic pride pumpkin pumpkin pie quiet thrill rae spoon reality receipts rogers rpm seminar sewing simple simplicity sleep deprivation smells soy milk speech dispatcher sports stories story telling strange streamlines swimming telephone temperature texting thoughts thrift stores time management tragedy truth understanding united states urban ecosystems usb veganism voice volunteering webschwerver wild wireless working world yojimbo yum zoology Avatar: The Last Airbender Blassreiter CIS*2750 CIS*6890 Czech Republic Diablo Dresden Codak Dunedin Dutch Blitz Electric Networked Vehicle Elliott Brood Ender's Game France Fringe GNOME 3 HTC Hayao Miyazaki Mario Kart Montréal Network Manager Newfoundland Ontario Ouran Host Club Richard SVC Samsung Samurai Champloo Santa Claus Studio Ghibli TCAF US academics adb aeroport algonquin amusing animal agriculture apartment automation awkward bad movies banana bats battery beard belladonna beta bicycle book branding breakfast brno bus buses buy nothing day cabin calgary candy cars catastrophe celebrate celtic chat cheap cheese childhood china chinese calendar cities clarity clean cleaning clock comics compassion compiler computer conspiracy theorists consumption context convention cookie cool cornerstone cosplay cottage country court creation cthulhu cupcakes curiosity cute dancing dark themes dbus definition democracy despair dinosaurs discomfort dns dodgeball dragon dress dust dystopia earth earth day efficiency eggs elections email enhanced history ethics evil exhausted expectations experience exploring ext3 ext4 fail fair trade fall fashion favourite feedly feelings ferry fireworks focus formal free fruit fudge full moon furniture gaelic game boards garden gardening gee genetics gimp gir gobject good google hangouts google wave government grading gratitude green roofs groups gsec guerilla gardening haircut hakama help homosexuality honesty howl hp human rights humanitarianism humility hypocrisy ice images imaqua instant messaging integration internet explorer jabber jazz jelly bean jokes kernel keyboard knife labs last exile: fam the silver wing laurena lazy letters library libxml livejournal lizzie bennet loneliness loss lovely lyrics maps maturity meditation melancholy metadata microbes microfinancing microwaves mood moon cake mother music concert muso jikiden eishin ryu myth namespaces nasa nerdfighter neural networks nintendo 3ds normal normality notes obsolescence oceans open open souce open standards panasonic paper parties patches peanut butter personal perspectives philanthropy plants pleasant politeness potluck preparation problems ptp pulseaudio quidditch racism recreate redundancy relationships relax repairs resizing richard's room roomba roses rsync running sad sadness salsa samurai sanity scary schwarting seasons self-esteem self-navigating car selinux semiformal senility sensitivity sentimental sheep ships silicon motion sleeping in sms software engineering solitude solutions songs soup speed ssh star wars strangers stupid success sunset surreality survival skills suspense sustainability sweet symphony tardigrades tasks teaching technical communication and research methods test tests thought thrift tim tams time and space time travel tired tools tracker tradition tranquillity transience trees tumblr twitter update usability utopia via vihart vlog waffles warmth waste waterloo wave web comic webkit wii wiki winter is coming wizard wonder woods xmpp yoga youth zoo #Life #Wishlist 1602 1984 2014 24fps 404 All My Children Andy Griffith Argentina Armstrong House Avatar: The Legend of Korra BarTab Boston Boston Summit Businesses C CIS*6050 Cambridge Christopher Plummer Claymore Creatures Darker than Black David Attenborough Dear Wendy Docking Station Dollhouse England Excalibur February Fergus Final Fantasy IX GError GSA Go Hunger Games I believe in a thing called love IRC Ikea Ireland JRR Tolkien King Arthur MIT Mac OS X Madrid March Massachusetts Matlock McGuinty Melodies of Life Merlin Michael Cera Mother Mother Mr. Tumnus Narnia Neil Gaiman New York Philharmonic Nick and Norah's Infinite Playlist Nintendorks Norns North Korea NotesFromNewYork Olympic OpenShot Orphen Orson Scott Card Oscars PEAP Pete Peterson Planet Fedora Porco Rosso Questionable Content R ROM Rent S SIM Wireless Sauble Beach Selenium Shakespeare Snakes and Lattes Star Trek Steve Grand ThanksLiving The Darkness The Devil is a Part-Timer The Fifth Estate The Guild The Hobbit The Stand Tianjin Tim Hortons Tolkien UK VPN Will Grayson Will Grayson Wolves in the Wall WordPerfect Xiki abrt abuse academia accessibility active activity addiction adreama adrift adulthood advertisement advertising air airport express airship ajax al gore alarm clock aldiko alice in wonderland alien alistair summerlee amateur amazon ambience ambition amy winfrey anaconda angle angry birds anhosting animation anon anonymity ant apache apology appearances appreciation aqualab arcade architecture arduino arrogance ask assassins assignments association analysis astrid asus eee top asynchronous ati attitude attribution aural abuse authentication authenticity automake automarker avatars awesome b43 backtrack3 backyard bounty bad bagel bandwidth banjo banks barbarians barefoot baseball bathroom beaches beautiful bed bees beetles being belief bellaqua benedict cumberbatch berlin bertrand russell bill gates biofabrication biology biometrics bit rot bitcoin black and white blame blockbuster bloomberg blue board games bohemian bold bon thé place bonds border boredom botany boxing day boy brain scoop brickworks broadcom broccoli browsing bubbles bubbly buildings bunnies burn bus stops butterflies buttons c# c++ cafe calendaring calligraphy camel camera obscura cameras canopy capitalism captivity cards careless caring cast causality cbc cedar row cello censorship certainty cgi chalk challenger changing locks chaos theory charm cherry blossoms chickadee chickens chivalry choir chopsticks chores christchurch christianity chudan church cijf cinnamon classes clif clorox clorox green works cloud cloud atlas clubs cname coca cola codeine codeviz coincidence coins color comfort commons communism competence competition competitive coughing completeness compliments conference configuration conflicted confusion consciousness consent conservatives conservativism console construction contagion contest contributing convenience corpses cough suppressants coughing coupons courageous crashes crates crayons crazy creative commons criminals crisps criticism crosscanada crowd crtc cry crying cryptic cryptozoology csh cult currency current tv curse customer service customisation cvs daily grind data data mining databases dating david bowie dconf debate debug symbols debugging delicious design patterns desktop desktop summit destiny detachment dftba diet difficult digimon digital receipts disabilities disappointment discordianism dispute dissection kit distraction diyode doctors documentation dokuwiki doubt doughnut dpkg drab drano drano prevention dream dreaming drinking drm drowning dryers dtwydt ducks dvds dying dynamic typing ease easter easy ebony jewelwing ebooks ecards economics editors eeetop el paso elder neglect electronic receipts elements elitism ellen page embarrassment emily graslie emptiness empty enchant end of enterprising environmental science symposium eog epiphany eplugin equipment essentialism ether euphoria evoaqua experiment experimenting expertise extensions extortion facades faith falafel familiarity fan fancy fantasy fascism faun favicon fears fedora 11 feed me feedback festival fibonacci fiction fiddler crab field guide field identification figment figures of speech file formats finances fire fish fitness fixing flac flash light flesherton fling flexibility flour flow flying fonts footprints forceps forgottotagit fork fortunate fortune found fragaria frameworks fraud fred penner free time freezing french fries fresh friday friend's wedding friendship frog fspot funding funerals funny fury fuse gargoyles gdb geek geeks generosity gf3 gi gifts gio gjs glass globalnewtgames glory gloves glue gluten gm gmo gnome keyring go ninja go go transit goat gods goodbye goodfella's google books google wallet gp2x gqe grad graffiti grammar graphing graphviz grass green beaver grey county groceries growing up gtest gtg guts gypsies habit hal halls hard hard drive hard drives hardship hardware harry potter hdtv heart heart break heaven 17 hemlock grove hewlett packard hijinx hiking hoaxes holidays homelessness homework honey badgers honour horatio hornblower horror hostels hosting hot house of cards hp lovecraft hugs humblebundle humbleness hunting hyperlinking hyrule i am a carpet ibm thinkpad x41 icalendar ice cream sandwich ice rain icthyology ignorant ill image image editing imagination impermanence inadequacy inaturalist inconvenience independence india individuals industry infinity ingrid michaelson inhumanity injuries ink innovation insects installation intel intellectual property interactivity interlocutor internet tv invertabrates io irish irony isolation it it is indigo james bond jedi jikiden joke journalism journey judgement julian assange julie thiel justice kata kayak keys ki-ai killme kim taylor kinder kirby kitchen kiva knights knots kodak koodo kung fu labels landau sacamoto late laundromat led legend lending lessons letstrace letter writing liberalism liberals libnotify libreoffice librpm lifehacker lilo limericks limits linksys liquid lists live wallpapers livecd liveusb loans local local food local install login london losher lots of hugs mac mini machine learning machine vision madness mae magic school bus magical maintainership majesty malaria malls mantis shrimp marine life marketing marking massages matrices maturation may seminar meat media medicine mel's diner memory leaks mental health meow metacity metaphor methodology mezzo forte micropayments mild mild weather military milk mindhacks minimalism misanthropy miscellany misery misfortune missed the boat missing mlp moisture mold molly parker monitors monologue morality more cats mosquitoes moss mother's day mounting mouse moxies muffin muffinfilms mundane murder museum mushishi mushroom soup mushrooms musicals mutual funds my slumbering heart mysql nameservers nanowrimo national treasure natural language processing naturalism nausicaa navigating necessity neighbours nervous netgear network new new users newspaper hat next year ninja turtles nodelist nointernet noise noisy nominate non-root norse noses not really dying notebooks notification-daemon novels november fair nuclear war numbers numix obama obligation obliviousness obscure ocz ogg oggenc olap olive omote open formats open music openness openoffice optimisation optimism orcas orchestra oreo oreos org-mode origami oscar otr overheat owen sound packing paint shedding pan pancakes panda parallelism paranoia passport patents patience pattern recognition pdo peace peaceful pen pence pender penguins penmanship perception perfection pet rocks physical piano pickman's model picnik pidgin plugins pikmin pintsize pipelight pirate festival pizza hut plagiarism planning plans playground playlists plumbing plushies podcast poem poetry points pokemon pomplamoose positions posse post posters postmodernism potatoes potlucks power ppc practise prejudice premier pressure pretty pride and prejudice priorities private processes professionalism projects promise protest proud purchases qt quarantine rad radeon railroad randall munroe raop rats reagan recursion recycling redhat reductionism refactoring refrigerators regret release renew renfrew repetition report resolutions resolve resumes reuse reuters reviews revolution rhino rhps ricola risk road trips roar robots rockwood rot rover rtm ruby day ryu safety sanctuary sand satisfaction savages scary movies scheduling schneier scholarships scooters scp screenshots script seals search secret world of arrietty secrets seitei self-interest self-respect self-sufficiency self-worth semesters senescence sessions setbuilder settlers of catan sftp shame sheepo pistachio sheila patek shell shells sherlock holmes shipping shogun shotwell shoulder bag sigh sim city simafort simpsons sincerity singing sjr skill skunks sky slackware slashdot sliver small smiling snails snowboarding soccer social dance social justice socis soft solemn someonesmotherwantstoadoptme song sony sophistication sorbet sorrow sparklers speed river spell spellchecking spelling spies spilt milk splendid splendor splinter spoilers sql squaresville sr ssd sshd stanley park starry night starving steampunk storage strawberries strength structured information struggle stuff stylus suburi sucks sugar super mario super mario land 3d superiority superstition surprise surreal sushi surrender swings sympathy systemd systems tabs tachi uchi no kurai tail coats tameshigiri tarot taxes tears technocracy teddy bears tedtalk term termcap terror the duke the fault in our stars the hulk the human league the irregular at magic high school the onion theatre theory thingsidon'twanttodo tim berners-lee tim mcgraw timber timbre timeliness tin tin toaster todo toilets tolerance tonight toomuch touch screen touchpack tour tourniquet toys trac trailer translation travel buddy treestyle view trex triumf triumph trivia trouble trust tweak tx2500 tx2617 typing ugly logos un dinaru underwold unemployment universe unlimited blade works updates upgrades uploading urban agriculture urban ecology urchins vagrancy vagrant vague but exciting valadoc values vampires vanilla ice variety vegetables velvet burger verb version control vi vinegar violence voip vpnc vulnerable waf wandering wanting war warm weapons web hosting webcomic webcomics webfonts werewolves whales what a wonderful town whatsbetter whic are also lazer powered white spot wifi wii u wikisource will williams wings wisdom wishes wizardry wolf wonderland wordplay words world cup world water day writing voice xenophobia xephyr xinput xkcd xpath yahoo yay yyz z-index

Blog Archive

About Me

My Photo

I am aeronautical, vanship-style.  I am olympic and mythical.  I rest on my laurels.