Closed Bug 1437484 Opened 6 years ago Closed 6 years ago

Doc job permafails (test doc generation) after Sphinx got upgraded to 1.7.0: AttributeError: 'module' object has no attribute 'build_main'

Categories

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

defect

Tracking

(firefox-esr52 wontfix, firefox58 wontfix, firefox59 wontfix, firefox60 fixed)

RESOLVED FIXED
mozilla60
Tracking Status
firefox-esr52 --- wontfix
firefox58 --- wontfix
firefox59 --- wontfix
firefox60 --- fixed

People

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

References

Details

(Whiteboard: [stockwell infra])

Attachments

(1 file)

Filed by: dluca [at] mozilla.com

https://treeherder.mozilla.org/logviewer.html#?job_id=161674004&repo=mozilla-inbound

{"name":"builds-4h","url":"https://queue.taskcluster.net/v1/task/V610C6phRjCWNWWXoYG2Jw/runs/0/artifacts/public/logs/live_backing.log"}

Possible cause: 
Release notes of sphinx 1.7 1.7.0b1
 #3668: The arguments has changed of main functions for each command
Something seems to have upgraded Sphinx from 1.6.7 to 1.7.
https://pypi.python.org/pypi/Sphinx/1.7.0 got uploaded today.

https://pypi.python.org/pypi/sphinxcontrib-websupport contains:
[testenv]
deps=
...
    Sphinx

https://public-artifacts.taskcluster.net/dRsFcZWSROa8RUb9Drh7Ew/0/public/logs/live_backing.log

[task 2018-02-12T10:34:41.172Z] Collecting sphinxcontrib-websupport (from Sphinx<2.0->sphinx-js==2.1)
[task 2018-02-12T10:34:41.183Z]   Downloading sphinxcontrib_websupport-1.0.1-py2.py3-none-any.whl
[task 2018-02-12T10:34:41.213Z] Collecting pyparsing (from packaging->Sphinx<2.0->sphinx-js==2.1)
[task 2018-02-12T10:34:41.286Z]   Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
[task 2018-02-12T10:34:41.319Z] Collecting pytz>=0a (from babel!=2.0,>=1.3->Sphinx<2.0->sphinx-js==2.1)
[task 2018-02-12T10:34:41.531Z]   Downloading pytz-2018.3-py2.py3-none-any.whl (509kB)
[task 2018-02-12T10:34:41.655Z] Building wheels for collected packages: sphinx-js, parsimonious, MarkupSafe
[task 2018-02-12T10:34:41.656Z]   Running setup.py bdist_wheel for sphinx-js: started
[task 2018-02-12T10:34:41.953Z]   Running setup.py bdist_wheel for sphinx-js: finished with status 'done'
[task 2018-02-12T10:34:41.954Z]   Stored in directory: /builds/worker/.cache/pip/wheels/66/b0/4f/35a81e64cd31049e6a42e3ce5727f9b94b6d63c3be8d3b28b8
[task 2018-02-12T10:34:41.962Z]   Running setup.py bdist_wheel for parsimonious: started
[task 2018-02-12T10:34:42.209Z]   Running setup.py bdist_wheel for parsimonious: finished with status 'done'
[task 2018-02-12T10:34:42.210Z]   Stored in directory: /builds/worker/.cache/pip/wheels/c9/55/03/a7ed8a018b911f5193bdc08919bb02bb6d6dbfc7554371fd8e
[task 2018-02-12T10:34:42.217Z]   Running setup.py bdist_wheel for MarkupSafe: started
[task 2018-02-12T10:34:42.590Z]   Running setup.py bdist_wheel for MarkupSafe: finished with status 'done'
[task 2018-02-12T10:34:42.591Z]   Stored in directory: /builds/worker/.cache/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
[task 2018-02-12T10:34:42.596Z] Successfully built sphinx-js parsimonious MarkupSafe
[task 2018-02-12T10:34:42.597Z] Installing collected packages: docutils, MarkupSafe, Jinja2, six, parsimonious, alabaster, snowballstemmer, pyparsing, packaging, pytz, babel, imagesize, Pygments, typing, sphinxcontrib-websupport, Sphinx, sphinx-js
[task 2018-02-12T10:34:44.667Z] Successfully installed Jinja2-2.10 MarkupSafe-1.0 Pygments-2.2.0 Sphinx-1.7.0 alabaster-0.7.10 babel-2.5.3 docutils-0.14 imagesize-0.7.1 packaging-16.8 parsimonious-0.7.0 pyparsing-2.2.0 pytz-2018.3 six-1.11.0 snowballstemmer-1.2.1 sphinx-js-2.1 sphinxcontrib-websupport-1.0.1 typing-3.6.4
[task 2018-02-12T10:34:44.928Z] You are using pip version 8.1.2, however version 9.0.1 is available.
[task 2018-02-12T10:34:44.928Z] You should consider upgrading via the 'pip install --upgrade pip' command.
[task 2018-02-12T10:34:45.377Z] Collecting recommonmark==0.4.0
[task 2018-02-12T10:34:45.420Z]   Downloading recommonmark-0.4.0-py2.py3-none-any.whl
[task 2018-02-12T10:34:45.449Z] Collecting commonmark<=0.5.4 (from recommonmark==0.4.0)
[task 2018-02-12T10:34:45.469Z]   Downloading CommonMark-0.5.4.tar.gz (120kB)
[task 2018-02-12T10:34:45.788Z] Requirement already satisfied (use --upgrade to upgrade): docutils>=0.11 in ./obj-x86_64-pc-linux-gnu/_virtualenv/lib/python2.7/site-packages (from recommonmark==0.4.0)
[task 2018-02-12T10:34:45.789Z] Building wheels for collected packages: commonmark
[task 2018-02-12T10:34:45.790Z]   Running setup.py bdist_wheel for commonmark: started
[task 2018-02-12T10:34:46.037Z]   Running setup.py bdist_wheel for commonmark: finished with status 'done'
[task 2018-02-12T10:34:46.038Z]   Stored in directory: /builds/worker/.cache/pip/wheels/fd/3a/ea/9ead7944d8ba3771888487ca4f6ef39bcde9fd4e986c32f442
[task 2018-02-12T10:34:46.047Z] Successfully built commonmark
[task 2018-02-12T10:34:46.047Z] Installing collected packages: commonmark, recommonmark
[task 2018-02-12T10:34:46.176Z] Successfully installed commonmark-0.5.4 recommonmark-0.4.0
[task 2018-02-12T10:34:46.354Z] You are using pip version 8.1.2, however version 9.0.1 is available.
[task 2018-02-12T10:34:46.354Z] You should consider upgrading via the 'pip install --upgrade pip' command.
[task 2018-02-12T10:34:46.603Z] Error running mach:
[task 2018-02-12T10:34:46.603Z] 
[task 2018-02-12T10:34:46.603Z]     ['doc', '--outdir', 'docs-out', '--no-open', '--archive']
[task 2018-02-12T10:34:46.603Z] 
[task 2018-02-12T10:34:46.603Z] The error occurred in the implementation of the invoked mach command.
[task 2018-02-12T10:34:46.603Z] 
[task 2018-02-12T10:34:46.604Z] This should never occur and is likely a bug in the implementation of that
[task 2018-02-12T10:34:46.604Z] command. Consider filing a bug for this issue.
[task 2018-02-12T10:34:46.604Z] 
[task 2018-02-12T10:34:46.604Z] If filing a bug, please include the full output of mach, including this error
[task 2018-02-12T10:34:46.604Z] message.
[task 2018-02-12T10:34:46.604Z] 
[task 2018-02-12T10:34:46.604Z] The details of the failure are as follows:
[task 2018-02-12T10:34:46.604Z] 
[task 2018-02-12T10:34:46.604Z] AttributeError: 'module' object has no attribute 'build_main'
[task 2018-02-12T10:34:46.604Z] 
[task 2018-02-12T10:34:46.604Z]   File "/builds/worker/checkouts/gecko/tools/docs/mach_commands.py", line 87, in build_docs
[task 2018-02-12T10:34:46.604Z]     result = sphinx.build_main(args)
[taskcluster 2018-02-12 10:34:46.904Z] === Task Finished ===
Severity: normal → blocker
Flags: needinfo?(ahalberstadt)
Summary: AttributeError: 'module' object has no attribute 'build_main' → Doc job permafails (test doc generation) after Sphinx got upgraded to 1.7.0: AttributeError: 'module' object has no attribute 'build_main'
Wow, why aren't we collecting packages from http://pypi.pub.build.mozilla.org/pub/ for our jobs? Directly using PyPI.org without any strict requirements sounds insane. :/
Using pypi is fine as this is a tier 2 task and if it temporarily breaks once in awhile it's not a big deal. But yeah, we should definitely be pinning the version of sphinx somewhere. I'm not the owner of these jobs (I think gps is?) though I don't mind taking a quick look.
Component: Buildduty → Build Config
Priority: P5 → P1
Product: Release Engineering → Core
QA Contact: jlund
As far as I can tell we don't explicitly install sphinx anywhere, but sphinx-js depends on sphinx < 2.0:
https://dxr.mozilla.org/mozilla-central/source/tools/docs/mach_commands.py?q=sphinx-js&redirect_type=single#54

We should put all those into a requirements.txt with hashes and add an explicit sphinx version. I'll see if the 1.7 is easy to fix and we can update to it at the same time.
Flags: needinfo?(ahalberstadt)
FWIW, we don't explicitly install sphinx, we install sphinx-js and sphinx just gets pulled in as a dep, I guess:
https://dxr.mozilla.org/mozilla-central/rev/2b7d42d527af582a465e49187fe387442d524a7c/tools/docs/mach_commands.py#54
Blocks: 1437526
There are a few backwards incompatible changes in 1.7 that our in-tree doc infrastructure hits. Doesn't look hard to fix, but I'm going to leave it for a follow-up. Pinning sphinx to 1.6.7 works for me locally. Here's a try run:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9cc9a50bf14009784a7dc94c28c44a49f925253b
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
(In reply to Sebastian Hengst [:aryx][:archaeopteryx] (needinfo on intermittent or backout) from comment #6)
> The job is tier 1:
> https://hg.mozilla.org/mozilla-central/file/
> 2b7d42d527af582a465e49187fe387442d524a7c/taskcluster/ci/source-test/doc.
> yml#l7

Ah! Maybe we should turn it back into tier 2 then, I don't think we'd want busted doc generation to close the trees. Though as it doesn't run on every push maybe it's fine to just leave it.
Try run failed, looks like I need to explicitly add the whole dependency graph. Not sure why that worked for me locally.
See Also: → 1437593
Comment on attachment 8950285 [details]
Bug 1437484 - Pin and hash all requirements for |mach doc|,

https://reviewboard.mozilla.org/r/219542/#review225332
Attachment #8950285 - Flags: review?(gps) → review+
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/391bc7cd19b9
Pin and hash all requirements for |mach doc|, r=gps
https://hg.mozilla.org/mozilla-central/rev/391bc7cd19b9
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Please request uplifts.
Flags: needinfo?(ahalberstadt)
Talked to Aryx on irc, I think we can do test-only for this one.

Though thinking about it, I'm not sure why this even needs to run on older branches. Do we upload docs somewhere for older branches? Or is this something we could turn off.
Flags: needinfo?(ahalberstadt)
(In reply to Andrew Halberstadt [:ahal] from comment #18)
> Talked to Aryx on irc, I think we can do test-only for this one.
> 
> Though thinking about it, I'm not sure why this even needs to run on older
> branches. Do we upload docs somewhere for older branches? Or is this
> something we could turn off.

We shouldn't currently be uploading docs outside of mozilla-central. I think there is a bug somewhere to support per-version/repo upload. But that's outside the scope of this bug.

Since we don't upload outside of m-c, IMO we don't need to run the docs build tasks on non-trunk repos either. We can fix that by adding a "run-on-projects: ['trunk', 'try']" to the tasks defined in taskcluster/ci/source-test/doc.yml.
Product: Core → Firefox Build System
Whiteboard: [stockwell infra]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: