Preupgrade crash when resuming


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:

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()
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__
  File "/usr/share/preupgrade/preupgrade-gtk.py", line 259, in _do_main
  File "/usr/share/preupgrade/preupgrade-gtk.py", line 436, in main_preupgrade
  File "/usr/lib/python2.6/site-packages/preupgrade/__init__.py", line 130, in 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__            


    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.


#General #Microblog friends #Technology life gnome music google vegan guelph fedora iaido school #GNOME bugs food linux #School gxml technology blogger jodo nature web vala Flesherton art internet stress work android firefox happy anime birthday home travel #Budo dad kosmokaryote security #Photos computers cookies development kendo open source future reading sick snow writing GUADEC canada css environment ta video winter animals cell phones christmas evolution language love movies people sleep vegetarianism fun german gsoc me phone speech ai birds dreams git gseta learning new zealand picasaweb programming science skedge tea time vancouver vlogbrothers Toronto adventure fedora 17 night nlp society stars tablet wind mobile Josh Ritter books cake communication consumerism design google+ happiness identity javascript libgdata meaning photography photos pidgin quote responsibility speechdispatcher sushi Nintendo Spain TAing baking cat chocolate cold family film flight genderguesser halloween humanity liv magic memories memory netflix new years nightmares psychology recipes the legend of zelda tv ubuntu weather xorg youtube Thanksgiving acer animalia bc blogging bug conversation emusic fedora 18 galaxy nexus gitorious japan knowledge languages mail money nerdfighteria privacy productivity rain rhythmbox sound space uoguelph upgrade valentines video games web development xml Con-G Europe John Green Scott Pilgrim The Frames age apple autumn brave breath of fire II busy clothing comments creativity culture dance dataloss death djaqua encryption facebook gdom gmail google reader gtk health japanese laundry libxml2 materialism math morning organisation ottawa peterborough pets pie politics quality sei do kai shopping software spring style swords university vday vonage wahoo water web design x11 New York animal welfare anime north argument bash brain buffy business calm camera cats change computer science concert confidence conservation cooking duolingo duplicity e-mail emacs energy english errors fedora 19 feminism freedom french games gay rights gdata germany greyhound habits heat history house html information intelligence koryu laptop law light living martial arts mozilla nostalgia nz pain philosophy photo php physics pirates pizza play poverty preupgrade purple python religion research rss self serialisation sharing skating sun synergy tachi uchi themes transit turtles value village veggie challenge velociraptors violin walking zellers API Air Canada Empathy Hank Green Hugo Jane Austen Lord of the Rings Nexus One OCUS Sudbury Trick or Eat alone anxiety arboretum audible autonomous automobiles backup blog browsers camping canada day cancer celebration charity chrome colour community content corporations data loss decay decor depression disaster drawing eating emotion epic equality exercise faery fest failure farmer's market fedora 12 fedora 16 fedora 20 fedup flowers friend gender ghetto ghosts glib gnome blog gnome shell goals google talk green hair hobocore hungry icarus im interest introspection java joy last exile lost macbook mail-notification meat in vitro microsoft mind mom moon moon festival motivation moving mtp muffins mystery news ninjas oh the humanity pagans papers past pitivi progress pumpkin pumpkin pie quiet thrill rae spoon reality receipts reflection rogers rpm seminar simple sleep deprivation smells social soy milk speech dispatcher sports stories strange streamlines summer swimming telephone temperature testing texting thesis thinking thrift stores time management tragedy truth urban ecosystems volunteering webschwerver website weekend wild 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 Montréal Newfoundland Ouran Host Club Richard SVC Samsung Samurai Champloo Studio Ghibli TCAF US academics adb algonquin amusing apartment awkward bad movies banana bats battery beard belladonna beta bicycle bike blogs book branding breakfast brno bus buses buy nothing day cabin candy cars catastrophe celebrate celtic chat cheese childhood china chinese calendar cities clarity clean cleaning clock comics compassion compiler consumption context convention cookie cool copyright cornerstone cosplay cottage country court crafts creation cthulhu cupcakes cycling dark themes dbus definition democracy depth despair dinosaurs discomfort diy dns dodgeball dragon dress dust dystopia earth earth day education efficiency eggs elections email enhanced history evil exhausted expectations experience exploring fail fair trade fashion favourite feedly feelings ferry file systems fireworks focus formal free fruit fudge full moon furniture gaelic game boards gardening gee gimp gir gobject good google wave government gratitude green roofs groups growth gsec guerilla gardening haircut help homosexuality honesty howl hp humanitarianism humility hypocrisy ice ice cream images imaqua instant messaging integration internet explorer jabber jelly bean jokes kernel keyboard labs last exile: fam the silver wing laurena letters library livejournal lizzie bennet loneliness loss lovely lyrics maps maturity meditation melancholy metadata microbes microfinancing microwaves moon cake mother music concert muso jikiden eishin ryu myth namespaces nerdfighter neural networks nintendo 3ds normal normality notes obsolescence oceans open open souce open standards panasonic pants paper parties patches peanut butter performance perl personal perspectives philanthropy phones picnics plastic pleasant politeness potluck preparation ptp pulseaudio quidditch redundancy richard's room roses rsync running sad sadness salsa samurai schwarting seasons self-navigating car selinux semiformal senility sensitivity sentimental sewing sheep ships silicon motion simplicity sleeping in sms solitude solutions songs soup ssh star wars story telling strangers stupid surreality survival skills sustainability sweet symphony tardigrades tasks teaching technical communication and research methods test thoughts thrift tim tams time and space time travel tired tools tracker tradition tranquillity transience trees tumblr understanding united states update usability usb utopia via vihart vlog voice waffles warmth waste waterloo wave web comic webkit weird wiki winter is coming wireless wizard wonder woods xmpp yoga youth zoo #Life #Wishlist 1602 1984 24fps 404 All My Children Andy Griffith Argentina Armstrong House Avatar: The Legend of Korra BarTab Boston Boston Summit Businesses 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 Network Manager New York Philharmonic Nick and Norah's Infinite Playlist Nintendorks Norns North Korea NotesFromNewYork Olympic Ontario OpenShot Orphen Orson Scott Card Oscars PEAP Pete Peterson Planet Fedora Porco Rosso Questionable Content R ROM Rent S SIM Wireless Santa Claus Sauble Beach Shakespeare Snakes and Lattes Star Trek Steve Grand ThanksLiving The Darkness The Fifth Estate The Guild The Hobbit The Stand Tianjin Tim Hortons Tolkien UK Will Grayson Will Grayson Wolves in the Wall WordPerfect Xiki abrt abuse accessibility addiction adrift advertisement advertising aeroport air airport express airship ajax al gore alarm clock aldiko alice in wonderland alien amateur amazon ambience ambition amy winfrey anaconda angry birds anhosting animation anon anonymity ant apache apology appearances appreciation aqualab arcade arduino arrogance ask assassins assignments association analysis astrid asus eee top asynchronous ati attribution aural abuse authentication automake automarker avatars awesome backtrack3 backyard bounty bad bagel bandwidth banks barbarians barefoot baseball bathroom beaches beautiful beauty bed bees beetles being belief bellaqua benedict cumberbatch berlin bertrand russell bill gates biofabrication biology biometrics black and white blame blockbuster bloomberg blue board games bohemian bold bon thé place bonds border boredom boxing day boy brain scoop brickworks broccoli bubbles bubbly budo burn bus stops butterflies buttons c# c++ cafe calendaring calligraphy camel camera obscura cameras canoeing canopy cards careless caring cast causality cbc cedar row cello censorship certainty cgi chalk challenger changing locks chaos theory charm cheap 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 conflicted confusion consciousness consent console conspiracy theorists 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 current tv curse customer service customisation cute cvs daily grind dancing data data mining databases david bowie dconf debate debug symbols debugging 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 dreaming drm drowning dryers dtwydt dvds dying dynamic typing easter easy ebony jewelwing ebooks ecards economy editors eeetop el paso elder neglect electronic receipts elements ellen page embarrassment emily graslie emptiness empty enchant end of enterprising environmental science symposium eog epiphany eplugin equipment essentialism ether ethics euphoria evoaqua experiment expertise ext3 ext4 extensions extortion facades faith falafel fall 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 fire fish fixing flac flexibility flour flow flying fonts footprints forceps forgottotagit fork fortunate fortune frameworks fraud fred penner free time freezing french fries fresh friday friend's wedding frog fspot funding funerals funny fury fuse garden gargoyles gdb geek geeks genetics gf3 gi gifts gio gjs glass globalnewtgames glory gloves glue gluten gm gnome keyring go ninja go go transit goat gods goodbye goodfella's google books google hangouts google wallet gp2x gqe grad graffiti grammar graphing graphviz grass green beaver grey county groceries gtest gtg guts gypsies habit hakama hal halls hard hardship hardware harry potter hdtv heart heart break hemlock grove hewlett packard hijinx hiking holidays homelessness homework honey badgers honour horatio hornblower horror hostels hosting hot house of cards hp lovecraft hugs human rights humblebundle humbleness humour 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 india individuals industry infinity ingrid michaelson inhumanity ink innovation insects installation intel interactivity interlocutor internet tv invertabrates io irish irony isolation it it is indigo james bond jazz jedi jikiden jobs journalism journey judgement julian assange julie thiel justice kayak keys ki-ai killme kinder kirby kitchen kiva knife knights knots kodak koodo kung fu labels landau sacamoto late legend lending lessons letstrace letter writing libnotify librpm libxml lifehacker lilo limericks limits linksys liquid live wallpapers loans local local food local install login london losher lots of hugs luks mac mini machine learning machine vision madness mae magical maintainership majesty malaria malls mantis shrimp marine life mario marketing marking massages matrices may seminar meat media medicine mel's diner 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 mood morality more cats mosquitoes moss mother's day mouse moxies muffin muffinfilms mundane murder museum mushishi mushroom soup mushrooms musicals my slumbering heart mysql nameservers nanowrimo nasa national treasure natural language processing naturalism nausicaa navigating necessity neighbours 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 optimism orcas orchestra oreo oreos org-mode origami oscar otr overheat owen sound packing paint shedding pan pancakes panda parallelism passport patience pattern recognition pdo peace peaceful pen pence pender penguins penmanship perception perfection pet rocks piano pickman's model picnik pidgin plugins pikmin pintsize pipelight pirate festival pizza hut plagiarism planning plans plants 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 pride and prejudice private problems processes projects promise protest proud purchases qt quarantine racism rad radeon railroad randall munroe raop rats reagan recreate recursion redhat reductionism refactoring refrigerators regret relax release renew renfrew report resizing resolutions resolve resumes reuters reviews revolution rhino rhps ricola road trips roar robots rockwood roomba rot rtm ruby day ryu sanctuary sand sanity savages scary scary movies scheduling schneier scholarships scooters scp script seals search secret world of arrietty secrets seitei self-interest 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 sincerity singing sjr skill skunks sky slackware slashdot sliver small smiling snails snowboarding social dance socis soft software engineering solemn someonesmotherwantstoadoptme song sony sophistication sorrow sparklers speed speed river spell spellchecking spelling spies spilt milk splendid splinter spoilers squaresville sr sshd stanley park starry night starving steampunk storage strength structured information struggle stuff stylus success sucks sugar sunset super mario super mario land 3d superiority superstition surprise surreal sushi surrender suspense swings sympathy systems tabs tachi uchi no kurai tail coats tameshigiri tarot taxes tears technocracy teddy bears tedtalk term termcap terror tests the duke the fault in our stars the hulk the onion theatre theory thingsidon'twanttodo thought tim berners-lee tim mcgraw timber timbre timeliness tin tin todo toilets tolerance tonight toomuch touch screen touchpack tour tourniquet toys trac trailer translation travel buddy treestyle view trex triumph trivia trouble tweak twitter tx2500 tx2617 ugly logos un dinaru underwold unemployment universe unlimited blade works updates upgrades uploading urban agriculture urban ecology urchins vagrancy vagrant vague but exciting valadoc vampires vanilla ice variety veganism vegetables velvet burger verb version control vi vinegar violence voip waf wandering wanting war warm weapons web hosting webcomic webcomics webfonts werewolves what a wonderful town whatsbetter whic are also lazer powered white spot wifi wii wikisource will williams wings wisdom wishes wizardry wolf wonderland wordplay words world water day writing voice xenophobia xephyr xinput xkcd xpath yahoo yay z-index

Blog Archive

About Me

My Photo

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