[DOCS-11909] giza: UnboundLocalError: local variable 'task_result' referenced before assignment Created: 23/Jul/18  Updated: 27/Oct/23  Resolved: 17/Feb/23

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Oleg Pudeyev (Inactive) Assignee: Andrew Aldridge
Resolution: Gone away Votes: 0
Labels: docs-tools
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 50 weeks, 5 days ago
Story Points: 0.1

 Description   

----------------------------

Original Description

Trying to build ruby driver documentation:

speed% git clone https://github.com/mongodb/docs-ruby
Cloning into 'docs-ruby'...
remote: Counting objects: 687, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 687 (delta 6), reused 8 (delta 3), pack-reused 671
Receiving objects: 100% (687/687), 231.38 KiB | 8.26 MiB/s, done.
Resolving deltas: 100% (382/382), done.
speed% cd docs-ruby 
speed% 
speed% make html
giza generate assets
INFO:giza.content.assets:cloned master branch from repo https://github.com/mongodb/bson-ruby.git
INFO:giza.content.assets:cloned master branch from repo https://github.com/mongodb/docs-tools.git
INFO:giza.content.assets:cloned master branch from repo https://github.com/mongodb/mongo-ruby-driver.git
Making target source directory -- doing this explicitly instead of via cp
if [ -d source-master ]; then rm -rf source-master ; fi;
mkdir source-master
Copying over ruby-driver docs files
cp -R build/ruby-driver-master/docs/* source-master
Copying over bson  docs files
cp -R build/bson-ruby/docs/* source-master
giza make html
INFO:giza.operations.make:running sphinx build operation, equivalent to: giza sphinx --builder html
INFO:giza.content.assets:updated /home/w/tmp/docs-ruby/build/docs-tools repository
INFO:giza.content.assets:updated /home/w/tmp/docs-ruby/build/bson-ruby repository
INFO:giza.content.assets:updated /home/w/tmp/docs-ruby/build/ruby-driver-master repository
INFO:giza.content.source:created directory for sphinx build: /home/w/tmp/docs-ruby/build/master/source-master
INFO:giza.content.source:prepared and migrated source for sphinx build in /home/w/tmp/docs-ruby/build/master/source-master
INFO:giza.operations.sphinx:adding builder job for html (None, None)
INFO:giza.content.sphinx:Starting sphinx build: sphinx-build -t website -t web -t html -q -b html -c /home/w/tmp/docs-ruby -d /home/w/tmp/docs-ruby/build/master/doctrees-html /home/w/tmp/docs-ruby/build/master/source-master /home/w/tmp/docs-ruby/build/master/html
**ERROR:giza.pool:caught error "[Errno 2] No such file or directory", waiting for other tasks to finish**
Traceback (most recent call last):
  File "/home/w/bin/giza", line 11, in <module>
    sys.exit(main())
  File "/home/w/.local/lib/python2.7/site-packages/giza/cmdline.py", line 163, in main
    argh.dispatch(parser, namespace=args)
  File "/home/w/.local/lib/python2.7/site-packages/argh/dispatching.py", line 174, in dispatch
    for line in lines:
  File "/home/w/.local/lib/python2.7/site-packages/argh/dispatching.py", line 277, in _execute_command
    for line in result:
  File "/home/w/.local/lib/python2.7/site-packages/argh/dispatching.py", line 231, in _call
    result = function(namespace_obj)
  File "/home/w/.local/lib/python2.7/site-packages/giza/operations/make.py", line 140, in main
    run_make_operations(targets, conf)
  File "/home/w/.local/lib/python2.7/site-packages/giza/operations/make.py", line 235, in run_make_operations
    sphinx_publication(conf, app)
  File "/home/w/.local/lib/python2.7/site-packages/giza/operations/sphinx_cmds.py", line 113, in sphinx_publication
    return sphinx_builder_tasks(app, conf)
  File "/home/w/.local/lib/python2.7/site-packages/giza/operations/sphinx_cmds.py", line 125, in sphinx_builder_tasks
    app.run()
  File "/home/w/.local/lib/python2.7/site-packages/giza/libgiza/app.py", line 421, in run
    self.results.extend(self.pool.runner(self.queue))
  File "/home/w/.local/lib/python2.7/site-packages/giza/libgiza/pool.py", line 79, in runner
    return self.get_results(self.async_runner(jobs))
  File "/home/w/.local/lib/python2.7/site-packages/giza/libgiza/pool.py", line 160, in get_results
    retval.append((idx, task_result))
UnboundLocalError: local variable 'task_result' referenced before assignment
make: *** [Makefile:27: html] Error 1

The highlighted line says a file was not found but does not say which file, making this error impossible to diagnose and repair.
----------------------------

Description

Scope of changes (files that need work and how much)

Impact to other docs outside of this product

MVP (work and date?)

Resources (e.g. Scope Docs, Invision)



 Comments   
Comment by Emet Ozar [ 17/Feb/23 ]

Closing per convo with allison.moore@mongodb.com 

Comment by Andrew Feierabend (Inactive) [ 16/Oct/20 ]

Hi Team! Sorry for this post to such an antiquated ticket, but:

I was troubleshooting a strange failure-to-build issue on Melissa's macOS 10.15 box today, and ran into this exact error message (in Oleg's description above). A bunch of testing later, it looks like her installation of `sphinx` did not include the `sphinx-build` file. I copied mine to her system, and everything magically started working. I'll put together some diagnostics next week (this and related issues seem to be affecting new builds, so I gather there will be a need for this).

Wanted to get potential fix for this issue up where others could see. Hope this helps!

Comment by Oleg Pudeyev (Inactive) [ 23/Jul/18 ]

That was indeed the issue, I added appropriate notes to docs repos.

Now that I know that this was the issue, the previous line in the output does mention `sphinx-build`. Perhaps if the UnboundLocalError is fixed (and output past the error reduced correspondingly) it would be easier to figure this out.

Comment by Andrew Aldridge [ 23/Jul/18 ]

Hello oleg.pudeyev!

Unfortunately giza's error reporting is quite poor, as you've discovered. But this error is most probably caused by a problem launching sphinx-build.

Make sure that sphinx-build is in your PATH and is installed with Python 2:

head -n1 `which sphinx-build`

Running giza with the -s flag to build in serial mode will provide a better backtrace:

giza -s make html

Generated at Thu Feb 08 08:03:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.