{"id":49815,"date":"2025-10-28T14:39:34","date_gmt":"2025-10-28T18:39:34","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=49815"},"modified":"2025-10-28T14:39:34","modified_gmt":"2025-10-28T18:39:34","slug":"lg-spotlight-indexing-bug","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/10\/28\/lg-spotlight-indexing-bug\/","title":{"rendered":"&ldquo;LG&rdquo; Spotlight Indexing Bug"},"content":{"rendered":"<p><a href=\"https:\/\/eclecticlight.co\/2025\/10\/23\/a-spotlight-bug-affecting-all-recent-macos-the-lg-error\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2025\/10\/23\/a-spotlight-bug-affecting-all-recent-macos-the-lg-error\/\">\n<p>There&rsquo;s a bug in Spotlight that can prevent it from indexing any of the contents of susceptible text files. This has been present since macOS 13 Ventura if not before, and is still present in Tahoe 26.0.1.<\/p>\n<p>[&#8230;]<\/p>\n<p>To demonstrate this bug, all you need is a single UTF-8 plain text file, created by TextEdit or any other app capable of saving plain text. Start the text with the two characters L and G, both in capitals.<\/p>\n<p>[&#8230;]<\/p>\n<p>This isn&rsquo;t the first bug in the RichText.mdimporter. In macOS Catalina 10.15.6, the same mdimporter (then build 319.60.100) introduced a bug that <a href=\"https:\/\/eclecticlight.co\/2021\/02\/12\/diagnosing-a-spotlight-bug-in-big-sur-failure-to-index-rtf-content\/\">broke indexing<\/a> of Rich Text (RTF) files.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/eclecticlight.co\/2025\/10\/23\/a-spotlight-bug-affecting-all-recent-macos-the-lg-error\/#comment-109197\">Drew<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2025\/10\/23\/a-spotlight-bug-affecting-all-recent-macos-the-lg-error\/#comment-109197\">\n<p>The same thing happens for &lsquo;HPA&rsquo;. I suspect this might have something to do with the magic entry for Arhangel archive data (<tt>\/usr\/share\/file\/magic\/archive<\/tt>; see also HPA archive data), or something that is trying to make an equivalent check. Notice that &lsquo;file&rsquo; reports such a text file as being &lsquo;Arhangel archive data&rsquo;.<\/p>\n<\/blockquote>\n\n<p>Like Oakley, I wouldn&rsquo;t expect this to matter. Spotlight uses the file extension to determine the UTI (and therefore the importer), rather than using &ldquo;magic&rdquo; to look at the contents of the file. But it appears the problem is occurring <em>after<\/em> that and that the importer itself is using &ldquo;magic.&rdquo;<\/p>\n\n<p><a href=\"https:\/\/eclecticlight.co\/2025\/10\/26\/last-week-on-my-mac-why-spotlight-cant-find-some-files\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2025\/10\/26\/last-week-on-my-mac-why-spotlight-cant-find-some-files\/\"><p>What happens is that saving a text file starting with forbidden characters correctly triggers Spotlight&rsquo;s indexing service. That identifies the file as having the UTI public.plain-text and hands it over for its contents to be indexed. But the indexer inspects those first few characters, decides it&rsquo;s a different type of file altogether, and promptly returns an error 4864 for an NSCoderReadCorruptError without going any further.<\/p><p>[&#8230;]<\/p><p>It turns out that files starting with the characters <code>Draw<\/code> were characteristic of a binary vector graphics format used by <a href=\"https:\/\/www.riscosopen.org\/wiki\/documentation\/show\/!Draw\">the !Draw app<\/a> for RISC OS 2 in 1989. Rather than believing the file&rsquo;s UTI for one of the most common types of files in macOS, Spotlight&rsquo;s indexer therefore decided that it was trying to import file data that must now be as rare as hens&rsquo; teeth, and wouldn&rsquo;t go any further.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/07\/21\/spotlight-indexing-running-wild\/\">Spotlight Indexing Running Wild<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/07\/18\/invasive-spotlight-indexing\/\">Invasive Spotlight Indexing<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/03\/10\/fixing-macos-big-sur-search-bugs\/\">Fixing macOS Big Sur Search Bugs<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2016\/04\/07\/ios-9-spotlight-bug-explained\/\">iOS 9 Spotlight Bug Explained<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Howard Oakley: There&rsquo;s a bug in Spotlight that can prevent it from indexing any of the contents of susceptible text files. This has been present since macOS 13 Ventura if not before, and is still present in Tahoe 26.0.1. [&#8230;] To demonstrate this bug, all you need is a single UTF-8 plain text file, created [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-10-28T18:39:37Z","apple_news_api_id":"b51f7850-6329-4612-a5d7-0ccef3c9d51b","apple_news_api_modified_at":"2025-10-28T18:39:37Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AtR94UGMpRhKl1wzO88nVGw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[131,30,2223,2385,2598,2742,1042,768],"class_list":["post-49815","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-mac","tag-macos-13-ventura","tag-macos-14-sonoma","tag-macos-15-sequoia","tag-macos-tahoe-26","tag-spotlight","tag-uniform-type-identifier"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=49815"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49815\/revisions"}],"predecessor-version":[{"id":49816,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49815\/revisions\/49816"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=49815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=49815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=49815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}