Closed Bug 1734075 Opened 3 years ago Closed 3 years ago

`mach doctor` fails with TypeError: 'NoneType' object is not iterable

Categories

(Firefox Build System :: Mach Core, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glob, Assigned: sheehan)

Details

Attachments

(2 files)

dev/mozilla-central$ hg id
19fe4f009214+ tip
dev/mozilla-central$ ./mach doctor
Error running mach:

    ['doctor']

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 doctor| 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: 'NoneType' object is not iterable

  File "/Users/byron/dev/mozilla-central/python/mozbuild/mozbuild/mach_commands.py", line 211, in doctor
    return run_doctor(
  File "/Users/byron/dev/mozilla-central/python/mozbuild/mozbuild/doctor.py", line 459, in run_doctor
    for result in results:

This is a problem with the ssh check: if ssh hg.mozilla.org's output doesn't contain has privileges to access Mercurial over or Permission denied the function falls through returning None instead of a DoctorCheck object.

In my case my account is disabled due it inactivity, so there's two problems to fix here:

  • add a check for Mercurial access is currently disabled on your account
  • add a fallback result if the output of hg wasn't handled elsewhere
Priority: -- → P2

Before this change, if ssh hg.mozilla.org did not contain any of the
expected output lines, mach doctor would fail entirely as a check is
always assumed to return a DoctorCheck object. This commit adds a
fallback return as a warning, saying ssh hg.mozilla.org returned
something unexpected.

Assignee: nobody → sheehan
Status: NEW → ASSIGNED

When a user has been granted access to push to hgmo but does not make
use of their access for 6 months, their access is automatically revoked
via a cronjob in LDAP. This commit adds a check to the ssh mach doctor
check to find this condition and notify the user about how to proceed.

Depends on D128205

Pushed by cosheehan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/752518a18c98
add a fallback result when `ssh hg.mozilla.org` output is unexpected r=mhentges
https://hg.mozilla.org/integration/autoland/rev/6e70490f9932
expand `ssh` check to cover users with revoked hg access due to inactivity r=mhentges
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: