Open Bug 1251239 Opened 8 years ago Updated 2 years ago

"AttributeError: 'list' object has no attribute 'read_count'" at the end of a Windows build

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: ehsan.akhgari, Unassigned)

Details

I got this error:

23:28.61 We know it took a while, but your build finally finished successfully!
To view resource usage of the build, run |mach resource-usage|.
Error running mach:

    ['build']

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 should consider filing a bug for this issue.

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

The details of the failure are as follows:

AttributeError: 'list' object has no attribute 'read_count'

  File "c:\Users\ehsan\moz\src\python/mozbuild/mozbuild/mach_commands.py", line 499, in build
    telemetry_data = monitor.record_resource_usage()
  File "c:\Users\ehsan\moz\src\python/mozbuild\mozbuild\controller\building.py", line 369, in record_resource_usage
    self.end_time - self.start_time, cpu_percent, cpu_times, io)
  File "c:\Users\ehsan\moz\src\python/mozbuild\mozbuild\controller\building.py", line 457, in _log_resource_usage
    io_reads=io.read_count,

This was a full clobber build on Windows.
This is a new one.

The underlying issue is in resourcemonitor.py:

def get_disk_io_counters():
    try:
        io_counters = psutil.disk_io_counters()
    except RuntimeError:
        io_counters = []

    return io_counters

We return a list instead of a proper type. That's a bug.

Another bug is that apparently psutil is busted on your machine. Run the following:

  $ mach python
  >>> import psutil
  >>> psutil.disk_io_counters()

I reckon that will raise an exception.

The workaround for that is to nuke the VCS ignored files in python/psutil and rebuild psutil. I reckon your psutil install is a bit busted.

FTR, compiling psutil in the source dir is a known problem. We talked about fixing that this week.
Component: mach → Build Config
Flags: needinfo?(ehsan)
(In reply to Gregory Szorc [:gps] from comment #1)
> Another bug is that apparently psutil is busted on your machine. Run the
> following:
> 
>   $ mach python
>   >>> import psutil
>   >>> psutil.disk_io_counters()
> 
> I reckon that will raise an exception.

Yep:

ehsan@Megatron ~/moz/src
$ ./mach python
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.disk_io_counters()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Users\ehsan\moz\src\python\psutil\psutil\__init__.py", line 1675, in disk_io_counters
    raise RuntimeError("couldn't find any physical disk")
RuntimeError: couldn't find any physical disk

> The workaround for that is to nuke the VCS ignored files in python/psutil
> and rebuild psutil. I reckon your psutil install is a bit busted.

I deleted python/psutil/build, python/psutil/psutil/*.pyc and python/psutil/psutil/*.pyd and now I can't run import psutil any more because the _psutil_windows module can't be found any more.

How should I rebuild this?  ./mach build-backend doesn't seem to help...

Thanks!
Flags: needinfo?(ehsan)
psutil will be built at the beginning of configure.

I've never seen "RuntimeError: couldn't find any physical disk" before. My theory about your psutil install being busted may not be correct.

Out of curiosity, is there anything special about your environment that might be causing this to fail? VM? RAM disk? etc?
Hmm, not anything that I can think of.  I have built on this machine many times before, AFAIK nothing has changed about its configuration.
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.