Closed Bug 1048270 Opened 7 years ago Closed 3 years ago

Blobber exception: "UnboundLocalError: local variable 'blob_url' referenced before assignment"


(Release Engineering :: General, defect)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: emorley, Unassigned)




(2 files)
b2g_emulator_vm mozilla-central opt test mochitest-3 on 2014-08-04 05:00:29 PDT for push e6614d8d85f9

slave: tst-linux64-spot-085

06:22:00     INFO -  (blobuploader) - INFO - Uploading /builds/slave/test/build/blobber_upload_dir/emulator-5554.log ...
06:22:01     INFO -  (blobuploader) - INFO - Using
06:22:01     INFO -  (blobuploader) - INFO - Uploading, attempt #1.
06:22:01     INFO -  (blobuploader) - CRITICAL - Unexpected error in client: Traceback (most recent call last):
06:22:01     INFO -    File "/builds/slave/test/build/venv/bin/", line 165, in upload_file
06:22:01     INFO -      blobhash, compress)
06:22:01     INFO -    File "/builds/slave/test/build/venv/bin/", line 236, in post_file
06:22:01     INFO -      verify=cert.where())
06:22:01     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/requests/", line 88, in post
06:22:01     INFO -      return request('post', url, data=data, **kwargs)
06:22:01     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/requests/", line 44, in request
06:22:01     INFO -      return session.request(method=method, url=url, **kwargs)
06:22:01     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/requests/", line 335, in request
06:22:01     INFO -      resp = self.send(prep, **send_kwargs)
06:22:01     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/requests/", line 438, in send
06:22:01     INFO -      r = adapter.send(request, **kwargs)
06:22:01     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/requests/", line 327, in send
06:22:01     INFO -      raise ConnectionError(e)
06:22:01     INFO -  ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /blobs/sha512/b01f4eab7c88fe7789b11649ad6a9df09e4196b02c1211cebcaa33d116d14a685d6c74dc923caa9449806d26294f71f917b6f7fcd6dfd3e97014738f5d874e75 (Caused by <class 'socket.error'>: [Errno 32] Broken pipe)
06:22:01     INFO -  (blobuploader) - INFO - Done attempting.
06:22:01     INFO -  Traceback (most recent call last):
06:22:01     INFO -    File "/builds/slave/test/build/venv/bin/", line 273, in <module>
06:22:01     INFO -      main()
06:22:01     INFO -    File "/builds/slave/test/build/venv/bin/", line 265, in main
06:22:01     INFO -      manifest_url_file=manifest_url_file)
06:22:01     INFO -    File "/builds/slave/test/build/venv/bin/", line 94, in upload_dir
06:22:01     INFO -      allowed=allowed_to_send(filename, filetype_whitelist))
06:22:01     INFO -    File "/builds/slave/test/build/venv/bin/", line 185, in upload_file
06:22:01     INFO -      return blob_url
06:22:01     INFO -  UnboundLocalError: local variable 'blob_url' referenced before assignment
06:22:01    ERROR - Return code: 1
06:22:01     INFO - rmtree: /builds/slave/test/build/blobber_manifest.txt
06:22:01     INFO - retry: Calling <built-in function remove> with args: ('/builds/slave/test/build/blobber_manifest.txt',), kwargs: {}, attempt #1
06:22:01     INFO - Copying logs to upload dir...
06:22:01     INFO - mkdir: /builds/slave/test/build/upload/logs
program finished with exit code 0
========= Finished '/tools/buildbot/bin/python scripts/scripts/ ...' (results: 0, elapsed: 1 hrs, 21 mins, 17 secs) (at 2014-08-04 06:22:07.623896) =========
Flags: needinfo?(tabara.mihai)
Will look into this as soon as I get near my computer, I'm out of town for two days.
Flags: needinfo?(tabara.mihai)
pinging armen just in case this has something to do with it:
'Bug 986112 - Make blobber uploads discoverable'

particularly the blob_url refs in this patch:
Flags: needinfo?(armenzg)
It seems that both ret and blob_url are initialized within a try block.
That means if there is an exception (which it happened) is as if they had never been initialized.

I haven't tested this. Would you be able to look into this? I can help if you can't.
Attachment #8468431 - Flags: feedback?(tabara.mihai)
Flags: needinfo?(armenzg)
Could one of you please review this pull request?

Flags: needinfo?(tabara.mihai)
Flags: needinfo?(catlee)
lgtm, but I don't have write permissions on that repo to merge it in!
Flags: needinfo?(catlee)
Merged and pushed 1.2.2 version -
I'll deploy it on puppet tomorrow as I once again have LDAP credentials :-)
Flags: needinfo?(tabara.mihai)
Attachment #8468431 - Flags: feedback?(tabara.mihai) → feedback+
Thank you Mihai.
We can close this bug after it gets deployed.

Just to be explicit, the error "(Caused by <class 'socket.error'>: [Errno 32] Broken pipe)" should not go away with this fix. I assume this bug was not about it with the title of the bug.
First things first: added armenzg, catlee and rail as collaborators to In the near future this should get somewhere in moz repo base, but until then, it's good to have people to backup different tasks around blobuploader.
Merged and deployed 1.2.2. version.
Pushed into into our repos
Mozharness change needed, see the one-liner patch.
Attachment #8473027 - Flags: feedback?(rail)
Attachment #8473027 - Flags: feedback?(rail) → review+
Component: Tools → General
Mass-closing old bugs I filed that have not had recent activity/no longer affect me.
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.