Bug 5686 - fetch2: error when upstream failed but MIRROR succeeded
Summary: fetch2: error when upstream failed but MIRROR succeeded
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.6 M2
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-12-25 07:22 UTC by Robert Yang
Modified: 2014-01-20 08:37 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Yang 2013-12-25 07:22:06 UTC
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 "Unable to fetch URL from any source", 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 '/buildarea/lyang1/yocto/testfec/../share/downloads/git2/git.pingu.fi.xf86-video-omapfb'...

fatal: repository 'http://git.pingu.fi/xf86-video-omapfb/' not found

ERROR: Function failed: Fetcher failure for URL: 'git://git.pingu.fi/xf86-video-omapfb;protocol=http'. 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 '1'

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,"build_mirror_data"):
                     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):