<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5686</bug_id>
          
          <creation_ts>2013-12-25 07:22:06 +0000</creation_ts>
          <short_desc>fetch2: error when upstream failed but MIRROR succeeded</short_desc>
          <delta_ts>2014-01-20 08:37:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>1.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.6 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>39588</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-12-25 07:22:06 +0000</bug_when>
    <thetext>The fetcher will try:

1) PREMIRROR
2) Upstream
3) MIRROR

If it fails to download from the Upstream, but succeed to download from the MIRROR, then we will get the error &quot;Unable to fetch URL from any source&quot;, this is incorrect, it should not show the error since it succeeds. (e.g.: xf86-video-omapfb)

ERROR: Fetcher failure: Fetch command failed with exit code 128, output:
Cloning into bare repository &apos;/buildarea/lyang1/yocto/testfec/../share/downloads/git2/git.pingu.fi.xf86-video-omapfb&apos;...

fatal: repository &apos;http://git.pingu.fi/xf86-video-omapfb/&apos; not found

ERROR: Function failed: Fetcher failure for URL: &apos;git://git.pingu.fi/xf86-video-omapfb;protocol=http&apos;. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /buildarea/lyang1/yocto/testfec/tmp/work/i586-poky-linux/xf86-video-omapfb/2_0.1.1+gitrAUTOINC+28c006c94e-r21.7/temp/log.do_fetch.28024
ERROR: Task 0 (/buildarea/lyang1/yocto/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb, do_fetch) failed with exit code &apos;1&apos;

The following patch will fix the problem:

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 8fdf59c..f93668f 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -810,7 +810,7 @@ def try_mirror_url(origud, ud, ld, check = False):
                 origud.method.download(origud, ld)
                 if hasattr(ud.method,&quot;build_mirror_data&quot;):
                     origud.method.build_mirror_data(origud, ld)
-            return None
+            return ud.localpath
         # Otherwise the result is a local file:// and we symlink to it
         if not os.path.exists(origud.localpath):
             if os.path.islink(origud.localpath):</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39925</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-01-20 08:37:16 +0000</bug_when>
    <thetext>Merged into master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6dcc4e7ded0910916e145e548045734ae2675639</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>