zerosleeps

Since 2010

I ordered a Thinkpad

A refurbished one, but still…

Previously on zerosleeps.com: first post in what has become a series, second post, and third post.

Shortly before starting this post my MacBook had been up for 9 hours and 8 minutes. Activity Monitor reports that mediaanalysisd has used 6 hours 22 minutes of CPU time (whatever that means in today’s multi-core multi-threaded world) and has read 38.69 GB of data from storage.

log stats --process mediaanalysisd --last 9h reports 1.8 million errors, 93% of which are “Embedding version: 0 not supported, skip embedding publishing”. That’s an average of 55 errors a second when you divide one thing by the other.

And all of this is with “Images” and “Movies” disabled in System Settings → Spotlight, by the way. At the weekend, I moved my Apple Photos library off my Mac just to see if that had some gremlin but it made no difference. (Again, the files mediaanalysisd errors on are never in my Photos library, but I’m trying anything I think of.)

And what would I gain even if it wasn’t behaving like this? Buggered if I know. I’m not playing with Spotlight exceptions any more - whenever I add an exclusion the thing just gets fixated on another location, so I’ve disabled my entire drive from being indexed. Spotlight is now useless, which makes my Mac a little bit more useless too.

Now look, bugs happen. I’m a developer and I’ve written some doozies. But that has never really been my issue with all of this - my issues are lack of control over my own device, and the complete absence of official support. Read my previous posts and tell me what sensible options remain. A visit to my nearest Apple Store where they’ll tell me to try a new user profile (done that) or reinstall (done that) or some other nonsense that will never explain the cause? No thanks.

Between all of this, an awful experience I had with HomeKit a few weeks ago (which I didn’t blog about but the outcome was the same - something wasn’t working and Apple’s “it just works” arrogance doesn’t make it possible to find out what’s going on when it does not just work), the shitshow that is “Apple Intelligence” (does anyone want that - I don’t), and the trust-destroying decision this weekend to use Apple Wallet to push a notification advertising a movie to customers, I need to look around and see what else is out there.

So I’ve ordered a 4-year old Thinkpad T490s just to see. I am under no illusion - I’ve been here before. macOS on it’s worst day is almost certainly better than Windows or Linux on their very best days, but we should poke our heads over the parapet every now and again, right? I have no reservations about the hardware: AUD$400 for a slightly used flagship laptop with 32GB of RAM, touchscreen, a plethora of modern ports, and status-lights-my-gawd-I-miss-status-lights is astonishing.

It’ll come down to the software. Stay tuned.

I don't like macOS as much as I used to

Well I’ve run out of things to try and people to ask. I have even gone as far as rebuilding my Mac from bare metal and carefully restoring files. I’ve checked permissions, I’ve checked extended attributes, I’ve looked for patterns. Apart from it being the same 20-ish image files, they have nothing in common. Yet these 20 files are causing mediaanalysisd (and in turn the mds stuff that drives Spotlight) to hammer my CPU and thrash my SSD during system idle.

I have contacted Apple, but the only path I could find to do that was a form that gave me a text box with a limit of about 500 characters. I am under no illusion - that has been yeeted into a black hole and will never be seen by a human. Certainly not one who has ever heard of mediaanlysisd.

I posted my summary and asked my questions in the Apple Support Community and got some well meaning responses, but it was waving-the-rubber-chicken stuff, and even if they had worked I still wouldn’t have a root cause.

I asked the author of the Mastodon thread I mentioned in my first post - which is the only instance of the error message that I’m interested in that can be found by Kagi or Google - if they ever found a solution, and they didn’t. It sounds like they might have had a different root problem from me anyway, but come on, macOS must have hundreds of millions of users. We are not the only people with this issue.

So now I don’t fucking know. It’s not like it’s causing any functional problems that I’m aware of. Apart from probably killing the lifespan of my SSD (it’s reading and writing tens of gigabytes an hour) but this has really triggered something in me. I am not in control of the tool I use to make my living and that is not acceptable. It has also brought to the fore the complete and absolute disinterest Apple has in me. Those folk in the Apple Support Community don’t work for Apple: Apple has outsourced “support” to their own customers at no cost to themselves, and it doesn’t work.

Somewhere inside those towering walls that were built with help from the tens of thousands of dollars I’ve spent on Apple products, there is at least one tremendously talented developer who knows exactly what my problem is and would love to help me and/or fix the underlying bug. Engineer-to-engineer. I could give them anything they asked for and try anything they wanted. But those folk will never know I exist.

Probably because some fucking middle manager has decided it’s more important to piss about with “a stunning new design” instead.

mediaanalysisd continues to piss me off

I was so confident I’d found a workaround and tamed macOS in my last post but I’m frustrated to say it is not so. Everything appeared fine for a day or two, but at the start of this week I woke my displays up and found mediaanalysisd chewing through my electricity and apparently generating nothing except huge amounts of errors in the system log. It’s been like that ever since.

I used my fs_usage trick to try and see what it’s problem is this time, and yep, it’s hitting the same few random image files hundreds of times a minute (but not files I added to Spotlight’s exclusion list last time).

I have no idea what value mediaanalysisd brings me when it is working, but disabling it requires jumping through some hoops that I’m not prepared to do on my production Mac.

I also started down the path of trying to see what all the “<private>” stuff in the macOS system log is hiding, but the steps required for that are just as awful.

I don’t feel like I own this computer anymore.

mediaanalysisd has gone rogue

So mediaanalysisd has gone rogue in my installation of macOS Sequoia 15.5 (24F74). I noticed it about a week ago, but I don’t know when it started. I’ve set my M1 MacBook Pro to not sleep when plugged in, and every time I woke the displays up I could see - thanks to iStat Menus - that something had been very consistently using about 20% of available CPU since the last time I’d used the machine. Activity Monitor made it easy to find the culprit: mediaanalysisd was showing as clocking up hundreds of hours of CPU time.

I’ve been able to resolve this by excluding the directory where I store all my development work (/Users/scott/Developer/) from being indexed by Spotlight. This is obviously not a fix, it’s a workaround for what is very definitely a bug: mediaanalysisd is throwing errors for the same handful of files repeatedly and constantly. Just random files stored in my home directory - there’s nothing wrong with them. My Photos library contains about 12,000 items and I’ve got hundreds of other images and videos strewn about my home directory, but for whatever reason it’s just the few locations mentioned below that are resulting in errors.

I will report this to Apple, but I’m not sure how, and I have no expectation of a response which makes the process feel a bit futile. But pop “mediaanalysisd” into your preferred search engine and you’ll get hundreds of hits for Reddit posts or Apple Community posts from people asking what the hell mediaanalysisd is and why it’s consuming so many system resources. I can’t find any documentation about this process, it doesn’t have a man page, and none of the errors it outputs are actionable. I am not in control of this particular corner of my Mac, and I do not like that.

The only thing I can find that looks remotely like my particular problem is from this Mastodon thread by user Glyph back in February 2025. A couple of extracts:

Okay after looking at fs_usage from this process, the stuff it is repeatedly scanning is just … some images I have in my Documents folder, and … the image resources attached to various Python installations?!!

And:

…when you deploy software to an operator, even if that operator is relatively non-technical, you MUST supply some sort of operator-facing surface that makes its behavior legible.

Nicely said. Anyway, here’s a bit more about my thing. This is after a couple of days of futzing around with different tools trying to get some actionable data. It’s also worth pointing out that the paths mentioned below haven’t changed for months, sometimes years. I didn’t suddenly add hundreds of new media files to my home directory or anything like that.

So in one Terminal window I ran sudo fs_usage mediaanalysisd | grep 'open.*Users\/scott\/'. That will start outputting all filesystem activity generated by a process called “mediaanalysisd”, filtered to just lines which contain “open” events for stuff in my home directory to reduce as much noise as possible.

In another terminal window: log stream --process mediaanalysisd. That streams anything sent to the system log by mediaanalysisd.

The numbers below were taken after running those commands and walking away from my Mac for about 3 hours.

  • log stream --process mediaanalysisd output 1,641,196 lines, 992,607 (60%) of which were errors
  • The fs_usage/grep command output 271,375 entries, but only for 675 unique files:
    • The entire content of /Users/scott/Developer/[redacted]/public/images/photos/ (320 images)
    • The entire content of /Users/scott/Developer/[redacted]/public/images/thumbnails/ (320 images)
    • The entire content of /Users/scott/Developer/[redacted]/Screenshots/ (6 images)
    • favicon-sized assets from 4 other projects in /Users/scott/Developer/

I’d have thought all the files mediaanalysisd has a problem with would have had roughly the same number of hits, but not so. There are about 15,800 lines for each of the following 17 files:

  • /Users/scott/Developer/[redacted]/core/bulma/docs/favicons/favicon-16x16.png
  • /Users/scott/Developer/[redacted]/[redacted]/static/favicon-16x16.png
  • /Users/scott/Developer/[redacted]/[redacted]/static/favicon-32x32.png
  • /Users/scott/Developer/[redacted]/core/bulma/docs/favicons/favicon-32x32.png
  • /Users/scott/Developer/[redacted]/Screenshots/SNMAINS.GIF
  • /Users/scott/Developer/[redacted]/Screenshots/SNFRONTS.GIF
  • /Users/scott/Developer/[redacted]/Screenshots/SNFULLS.GIF
  • /Users/scott/Developer/[redacted]/public/favicon-16x16.png
  • /Users/scott/Developer/[redacted]/public/images/preloader.gif
  • /Users/scott/Developer/[redacted]/public/images/default-skin.png
  • /Users/scott/Developer/[redacted]/public/favicon-32x32.png
  • /Users/scott/Developer/[redacted]/core/static/core/favicon-32x32.png
  • /Users/scott/Developer/[redacted]/core/bulma/docs/assets/images/bulma-type.png
  • /Users/scott/Developer/[redacted]/core/static/core/favicon-16x16.png
  • /Users/scott/Developer/[redacted]/core/bulma/docs/assets/images/patreon.png
  • /Users/scott/Developer/[redacted]/core/bulma/docs/assets/brand/Bulma Logo.png
  • /Users/scott/Developer/[redacted]/core/bulma/docs/assets/brand/Bulma Icon.png

And only 2-or-3 entries for each of the other files that show up. It’s interesting that the 17 files which account for almost all of the errors are all small favicon-or-logo-style things.

If I remove what are obviously identifiers from the 992,607 errors output by log stream I end up with just 15 unique errors:

  • 918,968 occurrences of “Embedding version: 0 not supported, skip embedding publishing”
  • 21,127 occurrences of “Image has invalid or too small dimensions (1x1)”
  • 21,127 occurrences of “Failed to decode image”
  • 21,127 occurrences of “Failed to load Scene Taxonomy for analysis version: 0. Unable to translate scenes.”

Most of the rest of the errors are “Preparaing to restart query” (Apple’s typo, not mine).

I assume the last three counts are all for the same problem - one issue results in three errors? That error sounds reasonable as well - if the image is 1×1 skip it. But why is mediaanalysisd revisiting the same file thousands of times an hour? Is the processing done in batches, where the whole batch is dropped if any one thing inside it fails? That could explain all the “Preparaing [sic] to restart query” lines I guess?

The top count - 918,968 occurrences of “Embedding version: 0 not supported, skip embedding publishing” - is the one I want to know more about. I have no idea what that means. It’s unlikely I’d be able to do anything about this even if I did understand the error because like I say, there’s nothing wrong with any of the problematic images and even if there was mediaanalysisd should gracefully handle the problem and not simply thrash them over and over and over. But I’m a developer and I’m curious. I want to know what’s stuck in its craw.

Also, presumably mediaanalysisd relies on Spotlight’s indexes, or maybe it just uses the same ignore-list, which is why excluding the directory at the root of all of these errors makes this go away (at the expense of making Spotlight much less useful for me)?

I’ll post a follow-up if I ever get an answer to any of the above. Don’t hold your breath.

(PS folders called “Developer” in your home directory get a nice icon in Finder, which is why I’ve called mine that.)