Error when file-only rule tries to evaluate a folder

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

Moderator: Mr_Noodle

Hi,

I have a folder for all my invoices called "Rechnungen" (German for invoices) and there is just one rule that should sort incoming files into subfolders based on the creation date of the file, so that I have a folder full of invoices for each year (e.g. "Rechnungen/2004", "Rechnungen/2005", etc.).

The rule itself works fine for files. But whenever Hazel is doing the initial rule processing after booting, I get these error messages in the log for each subfolder:

023-08-17 17:12:52.222 hazelworker[639] [Error] Error during rule evaluation: Received error while trying to evaluate rule Rechnungen nach Jahren sortieren on file 2004
2023-08-17 17:12:52.222 hazelworker[639] Error while matching rule Rechnungen nach Jahren sortieren against file /Users/bastian/Documents/Rechnungen/2004: Could not retrieve metadata for file: /Users/bastian/Documents/Rechnungen/2004
2023-08-17 17:12:52.222 hazelworker[639] ###Arch: x86_64
2023-08-17 17:12:52.222 hazelworker[639] ###main load address: 0x10d175000
2023-08-17 17:12:52.222 hazelworker[639] ###Hazel Core load address: 0x10d440000
2023-08-17 17:12:52.222 hazelworker[639] ###Noodle load address: 0x10d74c000
2023-08-17 17:12:52.222 hazelworker[639] ###CK load address: 0x10d332000
2023-08-17 17:12:52.222 hazelworker[639] (
0 CoreFoundation 0x00007ff813e02773 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff813b62bc3 objc_exception_throw + 48
2 HazelCore 0x000000010d4531fa hasNSRecords + 18547
3 HazelCore 0x000000010d44f783 hasNSRecords + 3580
4 HazelCore 0x000000010d4a52f8 _isDateValue + 27153
5 Foundation 0x00007ff814c8d077 -[NSCustomPredicateOperator performPrimitiveOperationUsingObject:andObject:] + 509
6 Foundation 0x00007ff814bec2c5 -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 418
7 HazelCore 0x000000010d49a411 hazelKindFromUTI + 3027
8 HazelCore 0x000000010d49ec09 _isDateValue + 802
9 HazelCore 0x000000010d49ee09 _isDateValue + 1314
10 HazelCore 0x000000010d49ca1c hazelKindFromUTI + 12766
11 HazelCore 0x000000010d4a0bec _isDateValue + 8965
12 HazelCore 0x000000010d47566a errorFromOSAScriptErrorDict + 88782
13 hazelworker 0x000000010d17bfb4 hazelworker + 28596
14 hazelworker 0x000000010d17f0d6 hazelworker + 41174
15 hazelworker 0x000000010d181551 hazelworker + 50513
16 dyld 0x000000010ed0452e start + 462
)


The rule mentioned here is named "Rechnungen nach Jahren sortieren" which basically just means "Sort invoices after years".

This is the rule definition:
If all of the following conditions are met:
• Kind is PDF
• Kind is not Folder
Do the following to the matched file or folder:
Rename with pattern "date created"_"name""extension"
Sort into subfolder with pattern "date created" (whereas here I only use the year of the file)

Initially I just had the check that the kind of file should be a Document, but I changed it to PDF and called "not a folder" — but it didn't change anything.
I already tried the search here but didn't find anything matching my error.

Is there a way of fixing this?

Best
Bastian
Bastian
 
Posts: 5
Joined: Tue Feb 02, 2010 7:26 pm

That error indicates that Hazel cannot retrieve metadata, which is generated by Spotlight. You need to make sure Spotlight is able to index those files.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks! I'll try re-indexing these in Spotlight.
I'm just wondering because in my understanding Hazel should not process the folders at all, because the rule should focus on PDF documents and not folders.

Or is it because Spotlight has a problem Hazel doesn't know if it's a file or folder and tries to find out via the non-existing meta-data?

I'll let you know if the re-indexing did work.
Bastian
 
Posts: 5
Joined: Tue Feb 02, 2010 7:26 pm

All files and folders are checked. When you filter on PDF, it still has to check against non-PDFs to know which ones are PDFs. There's no magic about which files are checked.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Yes, Spotlight was the issue here!
It took a few days to completely re-index the computer but now the errors are no longer occurring.

Thanks for the help!
Bastian
 
Posts: 5
Joined: Tue Feb 02, 2010 7:26 pm


Return to Support