Bug 2258

Summary: Fallback mirrors are not defaulted to if SRC_URI uses an existing mirror in it already
Product: [Build System, Metadata & Runtime] BitBake Reporter: Khem Raj <raj.khem>
Component: bitbakeAssignee: Saul Wold <sgw>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher, sgw
Version: unspecified   
Target Milestone: 1.2 M4   
Hardware: All   
OS: Multiple   
Whiteboard: (1.2) Needs Triage
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Khem Raj 2012-04-06 22:20:40 UTC
I ran into this issue when I cleaned up apt tars from DL_DIR and upstream has removed the tars from debian mirror Note I am using OE-Core/distroless so things might be different with Poky since it might be using different mirror groking policy

SRC_URI for apt is like this

SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/apt_${PV}.tar.gz 

and recipe we have is for 0.7.14 and apt_0.7.14.tar.gz has been deleted from debian mirror

even though OE-Core uses downloads.yoctoproject.org as fallback mirror
fetcher really does not fall back to it in this case.

If I remove ${DEBIAN_MIRROR} above and use a hard coded location then it does
the expected where it goes there and finds the tar is missing and falls back
to yp.org location.

I think this could be a problem for large set of recipes which use some sort
of mirrors in SRC_URI as we maintain a branch for longer time this problem
could arise on those long term branches more and more since the recipes wont
be upgraded on the maintenance branches
Comment 1 Saul Wold 2012-04-10 22:53:00 UTC
I just attempted do duplicate this with oe-core and bitbake master (bare, not poky), and the fetch succeeded.

Here's the output from bitbake apt -c fetch, note I did add in a warning to show the url rewrite.

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing RunQueue Tasks
NOTE: Running task 1 of 1 (ID: 0, /intel/poky/oe-core/meta/recipes-devtools/apt/apt_0.7.14.bb, do_fetch)
NOTE: package apt-0.7.14-r11: task do_fetch: Started
WARNING: Failed to fetch URL ftp://ftp.debian.org/debian/pool/main/a/apt/apt_0.7.14.tar.gz
WARNING: OrigUd: <bb.fetch2.FetchData object at 0x81535d0> Newuri: http://snapshot.debian.net/archive/pool/a/apt/apt_0.7.14.tar.gz
NOTE: package apt-0.7.14-r11: task do_fetch: Succeeded
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.

Summary: There were 2 WARNING messages shown.

If you can give me any additional information on how to reproduce this, that would be great.
Comment 2 Khem Raj 2012-04-10 23:16:36 UTC
(In reply to comment #1)
> I just attempted do duplicate this with oe-core and bitbake master (bare, not
> poky), and the fetch succeeded.
> 
> Here's the output from bitbake apt -c fetch, note I did add in a warning to
> show the url rewrite.
> 
> NOTE: Resolving any missing task queue dependencies
> NOTE: Preparing runqueue
> NOTE: Executing RunQueue Tasks
> NOTE: Running task 1 of 1 (ID: 0,
> /intel/poky/oe-core/meta/recipes-devtools/apt/apt_0.7.14.bb, do_fetch)
> NOTE: package apt-0.7.14-r11: task do_fetch: Started
> WARNING: Failed to fetch URL
> ftp://ftp.debian.org/debian/pool/main/a/apt/apt_0.7.14.tar.gz
> WARNING: OrigUd: <bb.fetch2.FetchData object at 0x81535d0> Newuri:
> http://snapshot.debian.net/archive/pool/a/apt/apt_0.7.14.tar.gz
> NOTE: package apt-0.7.14-r11: task do_fetch: Succeeded
> NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and
> all succeeded.
> 
> Summary: There were 2 WARNING messages shown.
> 
> If you can give me any additional information on how to reproduce this, that
> would be great.

interesting. I have this
DL_DIR ?= "${TOPDIR}/../../downloads"

in local.conf which is not normal otherwise all seems usual suspects in local.conf. Let me see if I can reproduce it again tomorrow. I am pretty sure
it never fetched it unless I removed ${DEBIAN_MIRROR} it bailed out without
falling back to yp.org
in your case its finding it on http://snapshot.debian.net/archive/pool/a/apt/apt_0.7.14.tar.gz 

may be when I ran into the issue the tar was in flux where it disappeared from main mirrors but took sometime to appear on snapshot debian mirror.
Comment 3 Saul Wold 2012-04-10 23:33:32 UTC
I just changed my DL_DIR to match your and it worked also, please re-test when you get a chance and report any further issues or if we should close this.
Comment 4 Khem Raj 2012-04-11 16:29:16 UTC
(In reply to comment #3)
> I just changed my DL_DIR to match your and it worked also, please re-test when
> you get a chance and report any further issues or if we should close this.

OK now it works as expected. So reason might have been what I stated

NOTE: package apt-0.7.14-r11: task do_fetch: Started
WARNING: Failed to fetch URL ftp://ftp.debian.org/debian/pool/main/a/apt/apt_0.7.14.tar.gz
NOTE: package apt-0.7.14-r11: task do_fetch: Succeeded