{"id":548,"date":"2012-10-20T21:44:27","date_gmt":"2012-10-20T19:44:27","guid":{"rendered":"https:\/\/www.npcglib.org\/~stathis\/blog\/?p=548"},"modified":"2013-09-18T04:56:34","modified_gmt":"2013-09-18T02:56:34","slug":"bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource","status":"publish","type":"post","link":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/","title":{"rendered":"bug: buildbot dies with &#8220;exceptions.ImportError: cannot import name NoResource&#8221;"},"content":{"rendered":"<p>When trying to start Buildbot&#8217;s master 0.8.6 I encountered this &#8220;exceptions.ImportError: cannot import name NoResource&#8221; error. The full transcript from the buildbot&#8217;s log is shown below:<\/p>\n<pre style=\"font-size:80%;\">\r\n2012-10-20 21:06:15+0300 [-]  \r\n2012-10-20 21:06:15+0300 [-] Unhandled Error\r\n\tTraceback (most recent call last):\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/twisted\/internet\/defer.py\", line 551, in _runCallbacks\r\n\t\tcurrent.result = callback(current.result, *args, **kw)\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/twisted\/internet\/defer.py\", line 916, in gotResult\r\n\t\t_deferGenerator(g, deferred)\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/twisted\/internet\/defer.py\", line 891, in _deferGenerator\r\n\t\tresult = g.next()\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/buildbot\/master.py\", line 166, in startService\r\n\t\tself.configFileName)\r\n\t--- <exception caught here> ---\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/buildbot\/config.py\", line 144, in loadConfig\r\n\t\texec f in localDict\r\n\t  File \"\/home\/buildbot\/master\/master.cfg\", line 307, in <module>\r\n\t\tfrom buildbot.status.html import WebStatus\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/buildbot\/status\/html.py\", line 20, in <module>\r\n\t\tfrom buildbot.status.web.baseweb import WebStatus\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/buildbot\/status\/web\/baseweb.py\", line 35, in <module>\r\n\t\tfrom buildbot.status.web.changes import ChangesResource\r\n\t  File \"\/usr\/lib64\/python2.7\/site-packages\/buildbot\/status\/web\/changes.py\", line 19, in <module>\r\n\t\tfrom twisted.web.error import NoResource\r\n\t\r\n\r\n2012-10-20 21:06:15+0300 [-] Configuration Errors:\r\n2012-10-20 21:06:15+0300 [-]   error while parsing config file: cannot import name NoResource (traceback in logfile)\r\n2012-10-20 21:06:15+0300 [-] Halting master.\r\n2012-10-20 21:06:15+0300 [-] Main loop terminated.\r\n2012-10-20 21:06:15+0300 [-] Server Shut Down.\r\n<\/pre>\n<p>This has been fixed in 0.8.7, but if you can&#8217;t upgrade to 0.8.7 for whatever reason, see <a href=\"https:\/\/github.com\/buildbot\/buildbot\/pull\/509\" target=\"_blank\">https:\/\/github.com\/buildbot\/buildbot\/pull\/509<\/a> for the explanation and patch. First locate where your python site-packages are (mine as shown below is in <code>\/usr\/lib64\/python2.7\/site-packages<\/code>. You figure this out by executing:<\/p>\n<pre>\r\n# python -m site\r\n\r\nsys.path = [\r\n    '\/home\/buildbot\/master',\r\n    '\/usr\/lib64\/python27.zip',\r\n    '\/usr\/lib64\/python2.7',\r\n    '\/usr\/lib64\/python2.7\/plat-linux2',\r\n    '\/usr\/lib64\/python2.7\/lib-tk',\r\n    '\/usr\/lib64\/python2.7\/lib-old',\r\n    '\/usr\/lib64\/python2.7\/lib-dynload',\r\n    <font style=\"color:red;\">'\/usr\/lib64\/python2.7\/site-packages'<\/font>,\r\n    '\/usr\/lib64\/python2.7\/site-packages\/gtk-2.0',\r\n    '\/usr\/lib64\/portage\/pym',\r\n]\r\nUSER_BASE: '\/root\/.local' (exists)\r\nUSER_SITE: '\/root\/.local\/lib64\/python2.7\/site-packages' (doesn't exist)\r\nENABLE_USER_SITE: True\r\n<\/pre>\n<p>Then, all you have to do is replace:<\/p>\n<pre>\r\nfrom twisted.web.error import NoResource\r\n<\/pre>\n<p>with<\/p>\n<pre>\r\ntry:\r\n    from twisted.web.error import NoResource\r\nexcept ImportError:\r\n    from twisted.web.error import Error as NoResource\r\n<\/pre>\n<p>in 3 files:<\/p>\n<pre>\r\n\/usr\/lib64\/python2.7\/site-packages\/buildbot\/status\/web\/changes.py\r\n\/usr\/lib64\/python2.7\/site-packages\/buildbot\/status\/web\/logs.py\r\n\/usr\/lib64\/python2.7\/site-packages\/buildbot\/status\/web\/slaves.py\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When trying to start Buildbot&#8217;s master 0.8.6 I encountered this &#8220;exceptions.ImportError: cannot import name NoResource&#8221; error. The full transcript from the buildbot&#8217;s log is shown below: 2012-10-20 21:06:15+0300 [-] 2012-10-20 21:06:15+0300 [-] Unhandled Error Traceback (most recent call last): File &#8220;\/usr\/lib64\/python2.7\/site-packages\/twisted\/internet\/defer.py&#8221;, line 551, in _runCallbacks current.result = callback(current.result, *args, **kw) File &#8220;\/usr\/lib64\/python2.7\/site-packages\/twisted\/internet\/defer.py&#8221;, line 916, in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[27,6,28,62],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"solution for buildbot error: exceptions.ImportError: cannot import name NoResource\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"stathis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#website\",\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/\",\"name\":\"sigmoid\",\"description\":\"..oo..oo..oo..oo..oo..oo..\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/#webpage\",\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/\",\"name\":\"bug: buildbot dies with \\\"exceptions.ImportError: cannot import name NoResource\\\" - sigmoid\",\"isPartOf\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#website\"},\"datePublished\":\"2012-10-20T19:44:27+00:00\",\"dateModified\":\"2013-09-18T02:56:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41\"},\"description\":\"solution for buildbot error: exceptions.ImportError: cannot import name NoResource\",\"breadcrumb\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"bug: buildbot dies with &#8220;exceptions.ImportError: cannot import name NoResource&#8221;\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41\",\"name\":\"stathis\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g\",\"caption\":\"stathis\"},\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/author\/stathis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"description":"solution for buildbot error: exceptions.ImportError: cannot import name NoResource","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/","twitter_misc":{"Written by":"stathis","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#website","url":"https:\/\/www.npcglib.org\/~stathis\/blog\/","name":"sigmoid","description":"..oo..oo..oo..oo..oo..oo..","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.npcglib.org\/~stathis\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/#webpage","url":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/","name":"bug: buildbot dies with \"exceptions.ImportError: cannot import name NoResource\" - sigmoid","isPartOf":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#website"},"datePublished":"2012-10-20T19:44:27+00:00","dateModified":"2013-09-18T02:56:34+00:00","author":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41"},"description":"solution for buildbot error: exceptions.ImportError: cannot import name NoResource","breadcrumb":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/10\/20\/bug-buildbot-dies-with-exceptions-importerror-cannot-import-name-noresource\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.npcglib.org\/~stathis\/blog\/"},{"@type":"ListItem","position":2,"name":"bug: buildbot dies with &#8220;exceptions.ImportError: cannot import name NoResource&#8221;"}]},{"@type":"Person","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41","name":"stathis","image":{"@type":"ImageObject","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#personlogo","inLanguage":"en-US","url":"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g","caption":"stathis"},"url":"https:\/\/www.npcglib.org\/~stathis\/blog\/author\/stathis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/548"}],"collection":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/comments?post=548"}],"version-history":[{"count":8,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":768,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/548\/revisions\/768"}],"wp:attachment":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/media?parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/categories?post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/tags?post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}