Closed Bug 1444597 Opened 6 years ago Closed 6 years ago

TypeError: IOError(2, 'No such file or directory') is not JSON serializable after successful build on macOS

Categories

(Firefox Build System :: General, defect)

3 Branch
x86_64
macOS
defect
Not set
normal

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: ato, Assigned: chmanchester)

References

Details

Attachments

(2 files)

There appears to be some kind of compatibility problem with the
Python version that ships with macOS and some mach code logging
errors.  Apparently some file does not exist, and there is a problem
trying to serialise the IOError type to JSON:

> % ./mach build testing/geckodriver
>  0:00.94 /usr/bin/make -C /Users/ato/src/gecko/obj-x86_64-apple-darwin17.4.0 -j90 -s backend
>  0:01.19 /usr/bin/make -C testing/geckodriver -j90 -s
>  0:01.22 force-cargo-program-build
>  0:02.82 [m[m[32m[1m   Compiling[m geckodriver v0.19.1 (file:///Users/ato/src/gecko/testing/geckodriver)
>  0:12.92 [m[m[32m[1m    Finished[m release [optimized] target(s) in 10.10 secs
>  0:13.39 force-cargo-program-build
>  0:14.56 [m[m[32m[1m    Finished[m release [optimized] target(s) in 0.0 secs
> Traceback (most recent call last):
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit
>     msg = self.format(record)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format
>     return fmt.format(record)
>   File "/Users/ato/src/gecko/python/mach/mach/logging.py", line 50, in format
>     return json.dumps([record.created, action, params])
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 243, in dumps
>     return _default_encoder.encode(obj)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode
>     chunks = self.iterencode(o, _one_shot=True)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode
>     return _iterencode(o, 0)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
>     raise TypeError(repr(o) + " is not JSON serializable")
> TypeError: IOError(2, 'No such file or directory') is not JSON serializable
> Logged from file logging.py, line 54

I don’t see this on Linux at all.
Attached file Longer stack trace
I added a traceback.print_stack() call to see more of the stack.
At least in one case the error came from:
> [Errno 2] No such file or directory: u'/Users/matthew/mozilla-central/obj-fx-opt/dist/Nightly.app/Contents/Resources/browser/.purgecaches'
Assignee: nobody → cmanchester
Blocks: 1368699
Comment on attachment 8982399 [details]
Bug 1444597 - Stringify exception when logging harmless errors in post-build step to avoid confusing stacktrace.

https://reviewboard.mozilla.org/r/248340/#review254738

Thanks.  I saw this ages ago but never landed the fix.
Attachment #8982399 - Flags: review+
Attachment #8982399 - Flags: review?(core-build-config-reviews)
Pushed by nalexander@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7ce972f7d2d5
Stringify exception when logging harmless errors in post-build step to avoid confusing stacktrace. r=nalexander
https://hg.mozilla.org/mozilla-central/rev/7ce972f7d2d5
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: