Closed Bug 1701720 Opened 1 month ago Closed 1 month ago

`mach web-platform-tests` crashes

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jimb, Unassigned)

References

(Blocks 1 open bug)

Details

When I run mach web-platform-tests, it crashes:

$ mach wpt
Error running mach:

    ['wpt']

The error occurred in mach itself. This is likely a bug in mach itself or a
fundamental problem with a loaded module.

You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file general| 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:

ImportError: No module named configparser

  File "/home/jimb/moz/central/python/mach/mach/main.py", line 374, in run
    return self._run(argv, sentry)
  File "/home/jimb/moz/central/python/mach/mach/main.py", line 431, in _run
    args = parser.parse_args(argv)
  File "/usr/lib64/python2.7/argparse.py", line 1705, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib64/python2.7/argparse.py", line 1737, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib64/python2.7/argparse.py", line 1946, in _parse_known_args
    stop_index = consume_positionals(start_index)
  File "/usr/lib64/python2.7/argparse.py", line 1902, in consume_positionals
    take_action(action, args)
  File "/usr/lib64/python2.7/argparse.py", line 1811, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/jimb/moz/central/python/mach/mach/dispatcher.py", line 200, in __call__
    if handler.parser:
  File "/home/jimb/moz/central/python/mach/mach/decorators.py", line 98, in parser
    self._parser = self._parser()
  File "/home/jimb/moz/central/testing/web-platform/mach_commands_base.py", line 9, in create_parser_wpt
    from wptrunner import wptcommandline
  File "/home/jimb/moz/central/build/mach_bootstrap.py", line 455, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/jimb/moz/central/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py", line 10, in <module>
    from . import config
  File "/home/jimb/moz/central/build/mach_bootstrap.py", line 455, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/jimb/moz/central/testing/web-platform/tests/tools/wptrunner/wptrunner/config.py", line 1, in <module>
    from configparser import ConfigParser
  File "/home/jimb/moz/central/build/mach_bootstrap.py", line 455, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)

Are you on central? If so, why is ./mach wpt running with Python 2? It should be using Python 3 🤔
Is there additional context that I'm missing?

Flags: needinfo?(jimb)

One other question: do you have multiple checkouts on your machine? If so, I'd guess that you have at least one of them on your $PATH, so when you run mach, it's grabbing the version of mach from that checkout.

I'd highly recommend running ./mach <command> instead, so that you use the version of mach associated with that checkout :)
Does that resolve the issue?

This was caused by my having an out-of-date copy of the mach script in my path. It's deleted, and all is well.

Status: NEW → RESOLVED
Closed: 1 month ago
Flags: needinfo?(jimb)
Resolution: --- → INVALID
Flags: needinfo?(sheenk323)
Flags: needinfo?(sheenk323)
Flags: needinfo?(mhentges)
Flags: needinfo?(mhentges)
You need to log in before you can comment on or make changes to this bug.