Closed Bug 1407163 Opened 2 years ago Closed 2 years ago

Intermittent UnboundLocalError: local variable 'data' referenced before assignment

Categories

(Firefox Build System :: General, defect, P5)

defect

Tracking

(firefox58 fixed, firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox58 --- fixed
firefox59 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: dustin)

References

Details

(Keywords: intermittent-failure, Whiteboard: [stockwell infra])

Attachments

(1 file)

Filed by: archaeopteryx [at] coole-files.de

https://treeherder.mozilla.org/logviewer.html#?job_id=135787239&repo=autoland

https://queue.taskcluster.net/v1/task/ZL9FBRaYTyebKj8XK0pL4w/runs/0/artifacts/public/logs/live_backing.log

[task 2017-10-09T21:03:26.066Z] 21:03:26     INFO -  Error running mach:
[task 2017-10-09T21:03:26.066Z] 21:03:26     INFO -      ['artifact', 'toolchain', '-v', '--retry', '4', '--artifact-manifest', '/builds/worker/workspace/build/src/toolchains.json', '--tooltool-manifest', '/builds/worker/workspace/build/src/browser/config/tooltool-manifests/linux32/releng.manifest', '--tooltool-url', 'http://relengapi/tooltool/', '--cache-dir', '/builds/worker/tooltool-cache', 'public/build/clang.tar.xz@culjIHHTT_WvK-FbIT6TOg', 'public/build/gcc.tar.xz@LpvNtYnpSTilxVv0BcwGkg', 'public/build/rustc.tar.xz@Ro_Bs6k6TNeYJvfOyijFLA', 'public/build/sccache2.tar.xz@CJ37XVd7T9SsE5uz4vdAEA']
[task 2017-10-09T21:03:26.066Z] 21:03:26     INFO -  The error occurred in the implementation of the invoked mach command.
[task 2017-10-09T21:03:26.067Z] 21:03:26     INFO -  This should never occur and is likely a bug in the implementation of that
[task 2017-10-09T21:03:26.067Z] 21:03:26     INFO -  command. Consider filing a bug for this issue.
[task 2017-10-09T21:03:26.067Z] 21:03:26     INFO -  If filing a bug, please include the full output of mach, including this error
[task 2017-10-09T21:03:26.067Z] 21:03:26     INFO -  message.
[task 2017-10-09T21:03:26.067Z] 21:03:26     INFO -  The details of the failure are as follows:
[task 2017-10-09T21:03:26.068Z] 21:03:26     INFO -  UnboundLocalError: local variable 'data' referenced before assignment
[task 2017-10-09T21:03:26.068Z] 21:03:26     INFO -    File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/mach_commands.py", line 1956, in artifact_toolchain
[task 2017-10-09T21:03:26.068Z] 21:03:26     INFO -      record = ArtifactRecord(task_id, name)
[task 2017-10-09T21:03:26.068Z] 21:03:26     INFO -    File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/mach_commands.py", line 1861, in __init__
[task 2017-10-09T21:03:26.068Z] 21:03:26     INFO -      for algorithm, digest in (data.get('artifacts', {})
[task 2017-10-09T21:03:26.082Z] 21:03:26    ERROR - Return code: 1
[task 2017-10-09T21:03:26.083Z] 21:03:26    ERROR - 1 not in success codes: [0]
Two things:

nalexander rightly pointed out that moving the data = {} line above the if block would help avoid the UnboundLocalError: http://searchfox.org/mozilla-central/rev/1c4da216e00ac95b38a3f236e010b31cdfaae03b/python/mozbuild/mozbuild/mach_commands.py#1853

It appears that downloading taskcluster artifacts (logs + cot artifacts at least) are intermittently throwing errors. This is probably the underlying issue. #taskcluster is investigating.
(In reply to Aki Sasaki [:aki] from comment #3)
> Two things:
> 
> nalexander rightly pointed out that moving the data = {} line above the if
> block would help avoid the UnboundLocalError:
> http://searchfox.org/mozilla-central/rev/
> 1c4da216e00ac95b38a3f236e010b31cdfaae03b/python/mozbuild/mozbuild/
> mach_commands.py#1853

I started looking at this patch, but if data = {} due to CoT non-200, we'll just fail a little later, 'cuz there won't be a digest or algorithm.

glandium, gps: y'all implemented and reviewed https://bugzilla.mozilla.org/show_bug.cgi?id=1391114, which landed this.  What's supposed to happen if CoT isn't available?  Are we supposed to backoff and retry?  Fail more gracefully?  Fake out the CoT entirely?
Flags: needinfo?(mh+mozilla)
Flags: needinfo?(gps)
See Also: → 1410499
I'd say retry if we got a --retry on the command line.
Flags: needinfo?(mh+mozilla)
I think glandium answered.
Flags: needinfo?(gps)
Whiteboard: [stockwell infra]
Flags: needinfo?(catlee)
Comment on attachment 8942249 [details]
Bug 1407163: raise exceptions with HTTP error info;

https://reviewboard.mozilla.org/r/212528/#review218306
Attachment #8942249 - Flags: review?(mh+mozilla) → review+
Pushed by dmitchell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d40da09bed64
raise exceptions with HTTP error info; r=glandium
https://hg.mozilla.org/mozilla-central/rev/d40da09bed64
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Assignee: nobody → dustin
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.