Closed Bug 1139331 Opened 9 years ago Closed 9 years ago

[nexus-5-l][FOTA] error while making partial/update.zip

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-b2g:2.5+, b2g-v2.2 fixed, b2g-master fixed)

RESOLVED FIXED
2.2 S11 (1may)
blocking-b2g 2.5+
Tracking Status
b2g-v2.2 --- fixed
b2g-master --- fixed

People

(Reporter: contact, Assigned: etsai)

References

Details

(Keywords: qablocker)

Attachments

(5 files, 6 obsolete files)

6.19 KB, text/plain
Details
56.14 KB, text/x-python
Details
49 bytes, text/x-github-pull-request
gsvelto
: review+
Details | Review
54 bytes, text/x-github-pull-request
gsvelto
: review+
Details | Review
43 bytes, text/x-github-pull-request
gsvelto
: review+
Details | Review
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20150224222119

Steps to reproduce:

BRANCH='master' ./config.sh 'nexus-5-l'
./build.sh &> build.txt
./build.sh gecko-update-fota &> fota.txt


Actual results:

mkdir -p `dirname out/target/product/hammerhead/fota/partial/update.zip` || true
Traceback (most recent call last):
  File "tools/update-tools/build-flash-fota.py", line 134, in <module>
    main()
  File "tools/update-tools/build-flash-fota.py", line 128, in main
    build_flash_fota(parser.parse_args())
  File "tools/update-tools/build-flash-fota.py", line 58, in build_flash_fota
    output_zip, update_bin)
  File "/srv/firefoxos/tests/source/tools/update-tools/update_tools.py", line 1036, in build_flash_fota
    flash_zip.write_recursive(system_dir, "system", filter=self.zip_filter)
  File "/srv/firefoxos/tests/source/tools/update-tools/update_tools.py", line 395, in write_recursive
    if not filter or filter(file_path, relpath):
  File "/srv/firefoxos/tests/source/tools/update-tools/update_tools.py", line 1016, in zip_filter
    Item.Get(relpath, dir=os.path.isdir(path))
AttributeError: class Item has no attribute 'Get'
make: *** [out/target/product/hammerhead/fota/partial/update.zip] Error 1


Expected results:

Generate out/target/product/hammerhead/fota/partial/update.zip

With : [ BRANCH='master' ./config.sh 'nexus-5' ], update.zip is generated correctly.
[Blocking Requested - why for this release]:
blocking-b2g: --- → 3.0?
OS: All → Linux
Hardware: All → x86_64
I reproduce this error running ./build.sh gecko-update-fota on nexus-5-l on aurora and nightly branch.
These builds worked before on nexus-5 without problem.
I have no idea wh
I have no idea why this fails. You will have to debug it on your own :(

Marshall wrote this some times ago, maybe he has an idea
Flags: needinfo?(marshall)
May also interest Gabriele.
Flags: needinfo?(gsvelto)
I tried with this patch https://github.com/mozilla-b2g/B2G/commit/1d9d6f20db55e9405053072a9353d82d18bffdbc thanks to gerard-majax, I had this error building fota for aurora branch: http://pastebin.com/WRBgX33U
Right, maybe the bits from bug 1130288 weren't landed on all the branches used by the Nexus 5 build?
Flags: needinfo?(gsvelto)
It's been a while since I maintained this code, and I've never tried to build for the Nexus 5.. unsure I can be of immediate help here. 

Maybe the API we import from releasetools has changed somehow? You can check the python code in $B2G/build/tools/releasetools/ota_from_target_files to see if Item.Get actually exists there..
Flags: needinfo?(marshall)
Attached file ota_from_target_files
(In reply to Marshall Culpepper [:marshall_law] from comment #8)
> It's been a while since I maintained this code, and I've never tried to
> build for the Nexus 5.. unsure I can be of immediate help here. 
> 
> Maybe the API we import from releasetools has changed somehow? You can check
> the python code in $B2G/build/tools/releasetools/ota_from_target_files to
> see if Item.Get actually exists there..

There is no "Item.Get" in $B2G/build/tools/releasetools/ota_from_target_files.
Hrm.  It looks like ItemSet has the get; the class Item doesn't have a get.  This affects N5-L for master and v2.2
Status: UNCONFIRMED → NEW
Ever confirmed: true
This blocks creating FOTA and FOTA testing.
Keywords: qablocker
Flags: needinfo?(marshall)
Hi Keven,

Please help on this.

Brian
Flags: needinfo?(kkuo)
Seinlin, please update status here.
Flags: needinfo?(kli)
Flags: needinfo?(kkuo)
I'm also hitting this on Flame KK while hacking bug 1136638
Blocks: 1136638
(In reply to Alexandre LISSY :gerard-majax from comment #15)
> I'm also hitting this on Flame KK while hacking bug 1136638

Or not ..., I did a mistake.
No longer blocks: 1136638
I can found similar error.
---
  File "/home/workspace/B2G/tools/update-tools/update_tools.py", line 1016, in zip_filter
    Item.Get(relpath, dir=os.path.isdir(path))
AttributeError: class Item has no attribute 'Get


I notice that in B2G/tools/releasetools/ota_from_target_files, Class Item is re-factored and ItemSet is added. 

So I think update_tools.py need to be updated accordingly.
Flags: needinfo?(kli)
(In reply to Kai-Zhen Li [:kli][:seinlin] from comment #17)
> So I think update_tools.py need to be updated accordingly.

Sounds about right; I didn't realize we had two pieces of code doing the same thing.
Removing NI, as I'm not maintaining this code
Flags: needinfo?(marshall)
blocking-b2g: 3.0? → 3.0+
(In reply to Kai-Zhen Li [:kli][:seinlin] from comment #17)
> I can found similar error.
> ---
>   File "/home/workspace/B2G/tools/update-tools/update_tools.py", line 1016,
> in zip_filter
>     Item.Get(relpath, dir=os.path.isdir(path))
> AttributeError: class Item has no attribute 'Get
> 
> 
> I notice that in B2G/tools/releasetools/ota_from_target_files, Class Item is
> re-factored and ItemSet is added. 
> 
> So I think update_tools.py need to be updated accordingly.

:kli, can you help with resolving this?
Flags: needinfo?(kli)
Bhavana, I can take this but my bandwidth is occupied. I am not sure if I can looking into it before mid April. If someone who familiar with python script can help, please feel free to take this.
Assignee: nobody → kli
Flags: needinfo?(kli)
(In reply to Gabriele Svelto [:gsvelto] [on PTO until the 7th of April] from comment #18)
> 
> Sounds about right; I didn't realize we had two pieces of code doing the
> same thing.

I think it is not two pieces of code doing the same thing. It is more likely, the APIs (object/functions) in platform_build are changed, the caller in update_tools need to be updated accordingly.
Hi Kai-Zhen, Any update on this? Thanks.
Flags: needinfo?(kli)
There is some progress by Eric Tsai, I think we can get a solution in next week.
Flags: needinfo?(kli)
(In reply to Eric Tsai from comment #27)
> Created attachment 8590688 [details] [review]
> build-flash-fota patch and update_tools_l.py

Copy/pasting update_tools and having to maintain a L-specific version ? I'm not very sure this is the best we can do :(
Attachment #8590684 - Attachment is obsolete: true
Attachment #8590708 - Attachment description: Fix Android.mk to wrong pull request → Fix Android.mk, add PLATFORM_SDK_VERSION
Eric, You already get some progress. Could you take this bug? Thanks!
I've made another patch, PLATFORM_SDK_VERSION detection in update_tools.py only. No modification in build-flash-fota.py and extra update_tools_l.py.
Attachment #8590688 - Attachment is obsolete: true
Assignee: kli → etsai
Comment on attachment 8591512 [details] [review]
update_tools.py with PLATFORM_SDK_VERSION detection

:gsvelto, I made some changes to update_tools.py for making nexus-5-l update.zip. Could you help to review it?
Attachment #8591512 - Flags: review?(gsvelto)
Attachment #8590679 - Attachment is obsolete: true
Attachment #8590708 - Attachment is obsolete: true
Modify ota_from_target_files for nexus-5-l
Attachment #8592686 - Flags: review?(gsvelto)
Attachment #8592602 - Flags: review?(gsvelto)
Comment on attachment 8592686 [details] [review]
ota_from_target_files for l

LGTM.
Attachment #8592686 - Flags: review?(gsvelto) → review+
Comment on attachment 8592602 [details] [review]
gonk-misc/Android.mk, add PLATFORM_SDK_VERSION

LGTM.
Attachment #8592602 - Flags: review?(gsvelto) → review+
Comment on attachment 8591512 [details] [review]
update_tools.py with PLATFORM_SDK_VERSION detection

This is OK too in principle but the code duplication really hurts my eyes. Couldn't you replace all the checks with a single helper that returns the right object and call the relevant methods on that instead?

Something like:

def GetItemOrSet(obj)
    if int(os.environ['PLATFORM_SDK_VERSION']) >= 21:
        return obj.itemset;
    else:
        return Item;

Then use it:

GetItemOrSet(self).GetMetadata(...)
GetItemOrSet(self).Get(...)
...
Attachment #8591512 - Flags: review?(gsvelto)
Comment on attachment 8594671 [details] [review]
update_tools.py with PLATFORM_SDK_VERSION detection and global helper function

LGTM, just one nit: since GetItemOrItemset() is used only in the FlashFotaBuilder class you can make it a member of that class and get rid of the obj parameter using self directly instead. I hadn't realized that immediately in my previous review otherwise I would have recommended it right away.
Attachment #8594671 - Flags: review?(gsvelto) → review+
:gsvelto If make GetItemOrItemset as a member function, I would like to create itemset after import_releasetools called in FlashFotaBuilder.__init__ , reduce the if statement for hasattr in GetItemOrItemset.
By :gsvelto 's comment, move the helper function to member function
Attachment #8594671 - Attachment is obsolete: true
Attachment #8595157 - Flags: review?(gsvelto)
Comment on attachment 8595157 [details] [review]
update_tools.py with PLATFORM_SDK_VERSION detection in member helper function

LGTM, thanks!
Attachment #8595157 - Flags: review?(gsvelto) → review+
I guess I shouldn't say that they block.  the bugs are related.  removing the bugs from the blocking.
No longer blocks: 1130288, 1136638
Comment on attachment 8592602 [details] [review]
gonk-misc/Android.mk, add PLATFORM_SDK_VERSION

gonk-misc/Android.mk PR for branch v2.2

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): this bug, 1139331
User impact if declined: Developer is unable to build update package for branch < master
Testing completed: Locally verified on master branch, successfully generate update package
Risk to taking this patch (and alternatives if risky): Low, easy to backout
String or UUID changes made by this patch: none
Attachment #8592602 - Flags: approval-mozilla-b2g37?
Attachment #8592602 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
Hi Ben,
Since this bug is fixed, I try to perform OTA, but it's failed.
According to the logs, there is no build returned from xml.
This might need you to fix.

I/Gecko   (  195): *** AUS:SVC Checker:checkForUpdates - sending request to: https://aus4.mozilla.org/update/3/B2G/37.0/20150419162502/hammerhead/en-US/nightly-b2g37/Boot2Gecko%202.2.0.0-prerelease%20(SDK%2022)/default/default/update.xml?force=1
I/GeckoConsole(  195): AUS:SVC Checker:checkForUpdates - sending request to: https://aus4.mozilla.org/update/3/B2G/37.0/20150419162502/hammerhead/en-US/nightly-b2g37/Boot2Gecko%202.2.0.0-prerelease%20(SDK%2022)/default/default/update.xml?force=1
I/Gecko   (  195): *** AUS:SVC Checker:onLoad - request completed downloading document
I/GeckoConsole(  195): AUS:SVC Checker:onLoad - request completed downloading document
I/Gecko   (  195): *** AUS:SVC Checker:onLoad - number of updates available: 0
I/GeckoConsole(  195): AUS:SVC Checker:onLoad - number of updates available: 0
Flags: needinfo?(bhearsum)
I don't see any metadata on the update server for "hammerhead", so I'm not surprised. I've never heard of these builds, and my team doesn't do b2g builds anymore...whomever is doing these builds needs to be uploading metadata to the update server.

Eric/Kai-Zhen, it seems like these are builds that you folks are doing. Do you need a hand figuring out how to get updates working?
Flags: needinfo?(kli)
Flags: needinfo?(etsai)
Flags: needinfo?(bhearsum)
Ben build of hammerhead (neux-5) is created in bug 1111890. In build config, in this build 'releng-private-updates.py' is used [1]. In releng-private-updates.py, default actions include submit-to-balrog [2]. But I didn't upload build to aus4, and I have no idea what's wrong with this. Could you give me some suggestion, how can we upload the build to aus4 correctly? I'll try to submit a patch to fix this. Thanks!

[1] http://hg.mozilla.org/build/buildbot-configs/file/2bd0fd3b12e3/mozilla/b2g_config.py#l651
[2] http://hg.mozilla.org/build/mozharness/file/c3114f35e5ec/configs/b2g/releng-private-updates.py#l16
Flags: needinfo?(kli) → needinfo?(bhearsum)
(In reply to Kai-Zhen Li [:kli][:seinlin] from comment #55)
> Ben build of hammerhead (neux-5) is created in bug 1111890. In build config,
> in this build 'releng-private-updates.py' is used [1]. In
> releng-private-updates.py, default actions include submit-to-balrog [2]. But
> I didn't upload build to aus4, and I have no idea what's wrong with this.
> Could you give me some suggestion, how can we upload the build to aus4
> correctly? I'll try to submit a patch to fix this. Thanks!
> 
> [1]
> http://hg.mozilla.org/build/buildbot-configs/file/2bd0fd3b12e3/mozilla/
> b2g_config.py#l651
> [2]
> http://hg.mozilla.org/build/mozharness/file/c3114f35e5ec/configs/b2g/releng-
> private-updates.py#l16

I don't think we've ever got you set-up with the access you need to submit updates to that server, so I'm not surprised that this isn't working. You probably need credentials, netflows, and maybe some tweaks to your mozharness configs.
Flags: needinfo?(bhearsum)
Chris, Per comment 55, do you have any idea why nexus5-l build is not uploaded to aus4.mozilla.org? Do you have any suggestion? May be we can file a new bug to finish this. Thanks!
Flags: needinfo?(catlee)
Flags: needinfo?(etsai)
Hi Gerry, Could we test this locally, just to make sure the 2.2->2.2 update channel is working fine, thank you.
Flags: needinfo?(gchang)
I create a local OTA package in my local OTA server and use below build to upgrade to my package.
The upgrade works well.

Build ID               20150419162502
Gaia Revision          c15a2b6d3a783813959c2b3bffd2a131f4270b9e
Gaia Date              2015-04-17 17:49:32
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/cc02ee38b252
Gecko Version          37.0
Device Name            hammerhead
Firmware(Release)      5.1

local build information:
Build ID               20150430112012
Gaia Revision          1b7aa7e60788668ed09abf76022dfa231dbe88d4
Gaia Date              2015-04-28 19:36:06
Gecko Revision         99c413dedbdc943230dad88e7da48d6081fd8d13
Gecko Version          37.0
Device Name            hammerhead
Firmware(Release)      5.1

Also put some logs here for reference:

I/GeckoConsole(  202): AUS:SVC Checker:getUpdateURL - update URL: http://10.247.28.216/OTA/nexus-ota.xml?force=1
I/Gecko   (  202): *** AUS:SVC Checker:onLoad - number of updates available: 1
I/GeckoConsole(  202): AUS:SVC Checker:onLoad - number of updates available: 1
I/Gecko   (  202): *** AUS:SVC Creating UpdateService
...

I/Gecko   (  202): *** AUS:SVC Downloader:downloadUpdate - downloading from http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50 to /storage/emulated/legacy/updates/0/update.mar
I/GeckoConsole(  202): AUS:SVC Downloader:downloadUpdate - downloading from http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50 to /storage/emulated/legacy/updates/0/update.mar
I/Gecko   (  202): *** AUS:SVC Downloader:onStartRequest - original URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50, final URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50
I/GeckoConsole(  202): AUS:SVC Downloader:onStartRequest - original URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50, final URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50
I/Gecko   (  202): *** AUS:SVC Downloader:onProgress - progress: 512/95031425
I/GeckoConsole(  202): AUS:SVC Downloader:onProgress - progress: 512/95031425
I/Gecko   (  202): *** AUS:SVC Downloader:onProgress - progress: 1324643/95031425
...

I/Gecko   (  202): *** AUS:SVC Downloader:onStopRequest - original URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50, final URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50, status: 0
I/GeckoConsole(  202): AUS:SVC Downloader:onStopRequest - original URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50, final URI spec: http://10.247.28.216/OTA/img/b2g-hammerhead-gecko-update.mar?build_id=20160708160201&version=50, status: 0
I/Gecko   (  202): *** AUS:SVC Downloader:onStopRequest - status: 0, current fail: 0, max fail: 20, retryTimeout: 30000
I/GeckoConsole(  202): AUS:SVC Downloader:onStopRequest - status: 0, current fail: 0, max fail: 20, retryTimeout: 30000
I/Gecko   (  202): *** AUS:SVC Downloader:_verifyDownload called
I/GeckoConsole(  202): AUS:SVC Downloader:_verifyDownload called
I/Gecko   (  202): *** AUS:SVC Downloader:_verifyDownload downloaded size == expected size.
I/GeckoConsole(  202): AUS:SVC Downloader:_verifyDownload downloaded size == expected size.
I/Gecko   (  202): *** AUS:SVC Downloader:_verifyDownload hashes match.
I/GeckoConsole(  202): AUS:SVC Downloader:_verifyDownload hashes match.
I/Gecko   (  202): *** AUS:SVC getCanStageUpdates - able to stage updates because we'll use the service
I/GeckoConsole(  202): AUS:SVC getCanStageUpdates - able to stage updates because we'll use the service
I/Gecko   (  202): *** AUS:SVC Downloader:onStopRequest - setting state to: pending
I/GeckoConsole(  202): AUS:SVC Downloader:onStopRequest - setting state to: pending
I/Gecko   (  202): *** AUS:SVC getCanStageUpdates - able to stage updates because we'll use the service
I/GeckoConsole(  202): AUS:SVC getCanStageUpdates - able to stage updates because we'll use the service
I/Gecko   (  202): *** AUS:SVC Downloader:onStopRequest - attempting to stage update: Firefox 50
I/GeckoConsole(  202): AUS:SVC Downloader:onStopRequest - attempting to stage update: Firefox 50
I/Gecko   (  202): *** AUS:SVC readStatusFile - status: applied, path: /data/local/updates/0/update.status
I/GeckoConsole(  202): AUS:SVC readStatusFile - status: applied, path: /data/local/updates/0/update.status
I/Gecko   (  202): *** AUS:SVC UpdateManager:refreshUpdateStatus - Notifying observers that the update was staged. state: applied, status: applied
Flags: needinfo?(gchang)
QA Whiteboard: [COM=OTA]
I think this should be reworked: SDK version is already an argument that we are passing to the scripts (--sdk-version). So there is no need to rely on environment variable.
Flags: needinfo?(md.tsai)
Flags: needinfo?(gsvelto)
Flags: needinfo?(etsai)
Depends on: 1165417
Hi Gerry?  Was that suppose to be FOTA or OTA?  I think we need FOTA in order to update the gecko.  We should be able to do full image flash now for kk, via : 
B2G_UPDATER=1 ./build.sh gecko-update-fota-fullimg

Can you test this please if you have not?
Flags: needinfo?(gchang)
(In reply to Alexandre LISSY :gerard-majax from comment #60)
> I think this should be reworked: SDK version is already an argument that we
> are passing to the scripts (--sdk-version). So there is no need to rely on
> environment variable.

I'm ok with the rework.
Flags: needinfo?(md.tsai)
Flags: needinfo?(etsai)
Hi Naoki,
In comment #59, I use OTA to test.

So far, FOTA doesn't work on nexus 5. I've submitted another bug 1163956 for this.
Flags: needinfo?(gchang)
Already r+'d the relevant change in the other bug so clearing the NI :)
Flags: needinfo?(gsvelto)
Flags: needinfo?(catlee)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: