"Could not retrieve metadata" error, but only on startup

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hello Support,

I have been experiencing the error "Could not retrieve metadata" for sometime now and have found it difficult to pinpoint or even reproduce. Every file that Hazel wants to examine produces an error like below, but only when the computer is booted

Code: Select all
2022-07-26 07:15:40.892 hazelworker[753] Error while matching rule PNC Personal Checking Statement against file /Users/paul/Action/HazelAutomation: Could not retrieve metadata for file: /Users/paul/Action/HazelAutomation
2022-07-26 07:15:40.893 hazelworker[753] ###Arch: x86_64
2022-07-26 07:15:40.893 hazelworker[753] ###main load address: 0x109fc1000
2022-07-26 07:15:40.893 hazelworker[753] ###Hazel Core load address: 0x10a29c000
2022-07-26 07:15:40.893 hazelworker[753] ###Noodle load address: 0x10a5bd000
2022-07-26 07:15:40.893 hazelworker[753] ###CK load address: 0x10a17c000
2022-07-26 07:15:40.893 hazelworker[753] (
   0   CoreFoundation                      0x00007ff8169ce7b3 __exceptionPreprocess + 242
   1   libobjc.A.dylib                     0x00007ff81672ebc3 objc_exception_throw + 48
   2   HazelCore                           0x000000010a2ae443 hasNSRecords + 18615
   3   HazelCore                           0x000000010a2aa97b hasNSRecords + 3567
   4   HazelCore                           0x000000010a300ca8 _isDateValue + 27417
   5   Foundation                          0x00007ff81785e0a7 -[NSCustomPredicateOperator performPrimitiveOperationUsingObject:andObject:] + 509
   6   Foundation                          0x00007ff8177bd2f5 -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 418
   7   HazelCore                           0x000000010a2f5c88 hazelKindFromUTI + 2991
   8   HazelCore                           0x000000010a2fa4b1 _isDateValue + 802
   9   HazelCore                           0x000000010a2fa6a3 _isDateValue + 1300
   10  HazelCore                           0x000000010a2f82c3 hazelKindFromUTI + 12778
   11  HazelCore                           0x000000010a2fc594 _isDateValue + 9221
   12  HazelCore                           0x000000010a2d0e10 errorFromOSAScriptErrorDict + 90283
   13  hazelworker                         0x0000000109fc77da hazelworker + 26586
   14  hazelworker                         0x0000000109fca7e4 hazelworker + 38884
   15  hazelworker                         0x0000000109fccb3d hazelworker + 47933
   16  dyld                                0x000000011296a51e start + 462
)


Once the computer finishes booting, I go to examine things and everything works as normal. I can get metadata for the files that were previously unseeable:
Code: Select all
❯ mdls /Users/paul/Action/HazelAutomation
_kMDItemDisplayNameWithExtensions      = "HazelAutomation"
kMDItemContentCreationDate             = 2018-12-17 00:06:37 +0000
kMDItemContentCreationDate_Ranking     = 2018-12-17 00:00:00 +0000
kMDItemContentModificationDate         = 2019-10-30 13:35:11 +0000
kMDItemContentModificationDate_Ranking = 2019-10-30 00:00:00 +0000
kMDItemContentType                     = "public.folder"
kMDItemContentTypeTree                 = (
    "public.folder",
    "public.directory",
    "public.item"
)
kMDItemDateAdded                       = 2022-04-08 12:42:30 +0000
kMDItemDateAdded_Ranking               = 2022-04-08 00:00:00 +0000
kMDItemDisplayName                     = "HazelAutomation"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 2019-10-30 13:35:11 +0000
kMDItemFSCreationDate                  = 2018-12-17 00:06:37 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "HazelAutomation"
kMDItemFSNodeCount                     = 7
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 502
kMDItemFSSize                          = (null)
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2022-07-02 00:00:00 +0000
kMDItemKind                            = "Folder"
kMDItemLastUsedDate                    = 2022-07-02 13:04:06 +0000
kMDItemLastUsedDate_Ranking            = 2022-07-02 00:00:00 +0000
kMDItemUseCount                        = 2
kMDItemUsedDates                       = (
    "2022-07-01 04:00:00 +0000",
    "2022-07-02 04:00:00 +0000"
)


I have quite a number of things getting loaded during startup, maybe there is a race condition between metadata being available and Hazel initial rule execution? Any help would be appreciated!
GeekNeck
 
Posts: 27
Joined: Sat Aug 11, 2012 7:26 am

It would indicate Spotlight being slow. That said, it's weird that there would be new files to be indexed on boot up. You may want to look into why that is.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:It would indicate Spotlight being slow. That said, it's weird that there would be new files to be indexed on boot up. You may want to look into why that is.

Most of these are not new files. I've had this error show up on files that have been in that folder for months. The particular folder in the example has been there for over 3 months and many reboots.
Code: Select all
kMDItemDateAdded                       = 2022-04-08 12:42:30 +0000


Any suggestions or links for diagnosing what indexing is doing?
GeekNeck
 
Posts: 27
Joined: Sat Aug 11, 2012 7:26 am

Search around for different methods of having Spotlight rebuild your index.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support