Closed Bug 1687710 Opened 4 years ago Closed 4 years ago

Errors running `mach doc`

Categories

(Developer Infrastructure :: Source Documentation, defect)

Unspecified
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jonco, Unassigned)

Details

I'm trying to generate the documentation but running into a series of problems.

Running mach doc tells me I need to install JSDoc:

~/work/central$ ./mach doc js/src
./mach: JSDoc==3.5.5 is required to build the docs but was not found on your system.
Please install it globally by running:

    $ mach npm install -g jsdoc@3.5.5

Bug 1498604 tracks bootstrapping jsdoc properly.
Bug 1556460 tracks supporting newer versions of jsdoc.

Running the suggested command as-is fails with errors about permissions:

~/work/central$ ./mach npm install -g jsdoc@3.5.5
./mach npm install -g jsdoc@3.5.5
npm WARN checkPermissions Missing write access to /usr/lib
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/lib'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/lib']
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/lib\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

Running again via sudo fails with an error about virtualenvs:

~/work/central$ sudo ./mach npm install -g jsdoc@3.5.5
This mach command requires /root/.mozbuild/_virtualenvs/mach/bin/python, which wasn't found on the system!
Consider running 'mach bootstrap' or 'mach create-mach-environment' to create the mach virtualenvs, or set MACH_USE_SYSTEM_PYTHON to use the system Python installation over a virtualenv.

Finally, running with MACH_USE_SYSTEM_PYTHON fails with a different error:

~/work/central$ sudo MACH_USE_SYSTEM_PYTHON=1 ./mach npm install -g jsdoc@3.5.5
Error running mach:

    ['npm', 'install', '-g', 'jsdoc@3.5.5']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file npm| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

TypeError: sequence item 0: expected str instance, NoneType found

  File "/home/jon/work/central/tools/mach_commands.py", line 481, in npm
    return self.run_process(
  File "/home/jon/work/central/python/mach/mach/mixin/process.py", line 101, in run_process
    self.log(logging.INFO, "new_process", {"args": " ".join(args)}, "{args}")

I tried running mach bootstrap but that didn't help.

This is on Ubuntu 20.04.1.

I am not on Linux Machine but it seems like a permission issue to me, may be this will be helpful https://stackoverflow.com/questions/48910876/error-eacces-permission-denied-access-usr-local-lib-node-modules

Edit , which python version you are using Jon?

(In reply to Shivam Singhal [ :championshuttler ] from comment #1)

~$ python --version
Python 2.7.18
~$ python3 --version
Python 3.8.5

Jonco, do you still have this problem?

I cannot reproduce the issue.

Severity: -- → S3

(In reply to Sylvestre Ledru [:Sylvestre] from comment #3)

Jonco, do you still have this problem?

No this all works nicely now!

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.