Comment 6 for bug 1250181

Revision history for this message
Barry Warsaw (barry) wrote : Re: download update from 16 to 20 failed on mako

I think I figured this out, but I'll need confirmation from Manuel. Here's my theory.

I flashed my manta to r15 on trusty-proposed, then initiated an update via -cli. The SignatureError is completely reproducible. I recreated the environment locally (on amd64 desktop) by copying over the client.ini and channel.ini and staged up the expected directories. I put a breakpoint right before the SignatureError and initiated an update locally, reproduced the SignatureError and hitting the breakpoint.

From the pdb prompt, I got a listing of the tar.xz and tar.xz.asc files that were failing the signature test and md5 checksummed them in their destination location. Then I got the source path on the server and wget'd them to a different location. Indeed the md5 checksums do *not* match. So clearly udm is somehow corrupting the files when it downloaded them.

There's more, and here's where it gets interesting. At the breakpoint I did a len(downloads) and got a count of 30. For some reason I then did len(set(downloads)) and got a count of 28. Well *that's* strange, but what it tells me is that there were 2 duplicate downloads in the udm group download request. Although I haven't verified (the paths in the index.json are quite difficult to read), I bet there is some image in the 15->20 upgrade path that names the same data file.

So my hypothesis is this: when udm gets a group download request which names a destination (i.e. local path) twice, it will dutifully download the second request right on top of the first. udm *doesn't* raise the duplicate-file exception because the file did not exist before the group download request.

If my theory is correct, then it should be fairly simple to filter out any duplicate downloads before the udm group download request. There may be some corner cases I need to worry about (e.g. what order do files in a duplicate download get applied in, but I think that will naturally play itself out).

I've added a udm bugtask so that Manuel can verify and add additional safeguards in udm.

Testing now...