Closed Bug 900438 Opened 7 years ago Closed 6 years ago

AttributeError: 'module' object has no attribute 'find_and_update_from_json'

Categories

(Testing :: Mochitest, defect)

x86_64
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1008648

People

(Reporter: msucan, Unassigned)

References

Details

(Keywords: regression)

When I try to run make mochitest-browser-chrome I get the following error:

  File "_tests/testing/mochitest/runtests.py", line 177, in __init__
    mozinfo.find_and_update_from_json(SCRIPT_DIR)
AttributeError: 'module' object has no attribute 'find_and_update_from_json'

Full paste: http://pastebin.mozilla.org/2757539

I did try a full clobber, as was suggested in bug 898725 comment 8. No luck.

This is a regression caused by bug 865349. I am using Ubuntu 12.04, Python 2.7.3.

I tried mach and it works but there is a very long delay (5-10 seconds) every time I run a mach mochitest-browser/mochitest-chrome command. It just sits there waiting, no messages, doing nothing obvious, then it runs the tests. This is really concerning...

Any help is much appreciated.
As a sanity check, you're running "make" in the same objdir that mach is running tests in, right?

The only thing I can think is that somehow you're picking up an outdated copy of the mozinfo module, but I don't know where you'd be getting it from.
(In reply to Ted Mielczarek [:ted.mielczarek] (post-vacation backlog) from comment #1)
> As a sanity check, you're running "make" in the same objdir that mach is
> running tests in, right?

I'm running mach and make in the same srcdir (in the root). I point both mach and make to the same objdir. I point make to the objdir using the -C argument as you see in the pastebin. I point mach to the objdir in my mozconfig, and with export MOZ_OBJDIR.

> The only thing I can think is that somehow you're picking up an outdated
> copy of the mozinfo module, but I don't know where you'd be getting it from.

Yes, but from where? I clobbered my objdir. Anything I should check?
That error definitely means your mozinfo is out of date. It's possible that mozinfo got installed into your global package index somehow. Try running 'pip install --upgrade mozinfo'. Alternatively you could create a virtualenv (https://pypi.python.org/pypi/virtualenv) and install mozbase into there.

The reason mach works is because it uses the in-tree virtualenv which has testing/mozbase installed into it. As for why mach is slow, I have no idea. We should file a separate bug.
(In reply to Andrew Halberstadt [:ahal] from comment #3)
> That error definitely means your mozinfo is out of date. It's possible that
> mozinfo got installed into your global package index somehow. Try running
> 'pip install --upgrade mozinfo'. Alternatively you could create a virtualenv
> (https://pypi.python.org/pypi/virtualenv) and install mozbase into there.

I do not have mozinfo/mozbase in my global packages index. pip freeze does not list anything like mozinfo/mozbase. Anything else I can check?


> The reason mach works is because it uses the in-tree virtualenv which has
> testing/mozbase installed into it. As for why mach is slow, I have no idea.
> We should file a separate bug.

I already filed it, see bug 900444.
(In reply to Mihai Sucan [:msucan] from comment #4)
> I do not have mozinfo/mozbase in my global packages index. pip freeze does
> not list anything like mozinfo/mozbase. Anything else I can check?

Odd, I'm finishing up a build. I'll try running the make targets and try to figure out what's up. Though fwiw mach will be the recommended way to run mochitests going forward.

On a related note.. Ted, is there any reason we allow system packages when creating the in-tree virtualenv? Seems like it could just be another source of problems.

http://mxr.mozilla.org/mozilla-central/source/build/virtualenv/populate_virtualenv.py#116
Flags: needinfo?(ted)
The make target works for me (running your exact command line).

What's the output of ". $MOZ_OBJDIR/_virtualenv/bin/activate && pip freeze"? More specifically what version is mozinfo?
(In reply to Andrew Halberstadt [:ahal] from comment #6)
> The make target works for me (running your exact command line).
> 
> What's the output of ". $MOZ_OBJDIR/_virtualenv/bin/activate && pip freeze"?
> More specifically what version is mozinfo?

http://pastebin.mozilla.org/2758873

mozinfo is not in the list.
ahal: that was changed in bug 758739. Not something I'm wild about, but it broke something we claimed to support.
Flags: needinfo?(ted)
To be clear, this is an issue with environment. I don't believe there is anything actionable to be done on the automation side, other than helping people who run into this debug their python environment.

Mihai, is this still a problem? If so have you pulled tip and clobbered recently? What branch are you trying to run against?
Flags: needinfo?(mihai.sucan)
I tried to run mochitest on b2g-desktop master build. Followed the instruction -
 https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Mochitests
and get the same error:
 'module' object has no attribute 'find_and_update_from_json'

System Env.
# version: Ubuntu 12.10
# os: linux
# bits: 64
# python: 2.7.3

The issue is that I get a old version of mozinfo(0.5), but 
  `pip install --upgrade mozinfo`
failed to setup version 0.6 with the following info:

 ~$ pip install --upgrade mozinfo
 Requirement already up-to-date: mozinfo in /usr/local/lib/python2.7/dist-packages/mozinfo- 0.5-py2.7.egg
 Requirement already up-to-date: mozfile>=0.6 in /usr/local/lib/python2.7/dist-packages/mozfile-0.9-py2.7.egg (from mozinfo)
 Cleaning up...
I'm assuming that space between mozinfo- 0.5 is a copy/paste error and not your actual environment?

I have no idea why doing upgrade wouldn't work.. but running "rm -rf /usr/local/lib/python2.7/dist-packages/mozinfo*" should do the trick. Also consider looking into virtualenv (https://pypi.python.org/pypi/virtualenv) to avoid running into these kinds of problems in the future. Fwiw, I'm currently working on mach targets for B2G and B2G desktop to make all this stuff easier.

Also note that b2g desktop mochitest is broken for another reason, but there is a patch in bug 903034 that should be landing soon to fix it.
(In reply to Andrew Halberstadt [:ahal] from comment #11)
> I'm assuming that space between mozinfo- 0.5 is a copy/paste error and not
> your actual environment?
Yes, there should be no space.

> I have no idea why doing upgrade wouldn't work.. but running "rm -rf
> /usr/local/lib/python2.7/dist-packages/mozinfo*" should do the trick. Also
> consider looking into virtualenv (https://pypi.python.org/pypi/virtualenv)
> to avoid running into these kinds of problems in the future. Fwiw, I'm
> currently working on mach targets for B2G and B2G desktop to make all this
> stuff easier.
> 
> Also note that b2g desktop mochitest is broken for another reason, but there
> is a patch in bug 903034 that should be landing soon to fix it.
Thank you. mach is really an amazing tool and I'm looking forward to it.
(In reply to Andrew Halberstadt [:ahal] from comment #9)
> To be clear, this is an issue with environment. I don't believe there is
> anything actionable to be done on the automation side, other than helping
> people who run into this debug their python environment.
> 
> Mihai, is this still a problem? If so have you pulled tip and clobbered
> recently? What branch are you trying to run against?

This is still a problem. I have pulled the fx-team repo tip and I try to run the tests on that repo. I have auto-clobber enabled, I also tried manual clobber.

I have since switched to use only mach and it runs fine now - after some bugs have been fixed and I updated my local scripts. This bug is no longer blocking me, still I'd like to know what's broken on my system.

Thank you!
Flags: needinfo?(mihai.sucan)
We figured this out in another bug. See https://bugzilla.mozilla.org/show_bug.cgi?id=1008648#c6 for the resolution.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1008648
You need to log in before you can comment on or make changes to this bug.