Jump to content

Alfred can't find files in iCloud


Paul Harrison

Recommended Posts

@Paul Harrison Apple have moved it around a few times during betas, but iCloud Drive is currently in ~/Library/Mobile Documents/ - Is this in your default search scope? (it should be by default). If it is, is Spotlight finding files in iCloud Drive?

 

Try dragging one of the files which can't be found into Alfred's File Search Troubleshooting, found in Alfred's Help preferences.

 

Cheers,

Andrew

Link to comment
Share on other sites

Hi Andrew

 

Thanks for your reply.  I forgot to say that ~/Library/Mobile Documents/ is also added to the search scope.

 

All diagnostics on the file search troubleshooting are fine.

 

The file details are:

 

File: 'Toffee.pdf'
Path: '/Users/paul/Library/Mobile Documents/com~apple~CloudDocs/Documents'

 

This path is included in

 

~/Library/Mobile Documents/

 

so it should appear in search results?

 

Link to comment
Share on other sites

@Paul Harrison Are the files appearing in Spotlight's results?

 

If you open System Preferences > Apple ID > iCloud, is Optimised Storage on or off? In order for iCloud to store the actual files on your Mac (rather than storing them in the cloud and requesting them only when needed), Optimised Storage should be off.

 

Cheers,
Vero

Link to comment
Share on other sites

OK, this is now working, I simply had to switch on "Search all file types".   This is presented as a strongly discouraged option, but to me it's essential that search look at all file types.  So I own up to this one.  It's been worthwhile as I've learned more about how Alfred's search works.

Edited by Paul Harrison
Link to comment
Share on other sites

OK - here is the diagnostic for a file which is in 'iCloud Drive',  but doesn't show up in search unless "search all file types" is on.

 

Starting Diagnostics...

File: 'testmp4.mp4'
Path: '/Users/paul/Library/Mobile Documents/com~apple~CloudDocs'

-----------------------------------------------------------

Check file cache database...

File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

Alfred has permissions to read this file.

-----------------------------------------------------------

Check file is in search scope...

File exists within Alfred's default search scope

-----------------------------------------------------------

Check if volume '/' is indexed by macOS...

Indexing is enabled on this drive

-----------------------------------------------------------

Check direct file metadata...

Direct metadata available

Display Name: testmp4.mp4
 Other Names: 
Content Type: public.mpeg-4
   Last Used: 2020-09-20 20:30:09 +0000

-----------------------------------------------------------

Check mdls file metadata...

Metadata contains required items

_kMDItemDisplayNameWithExtensions      = "testmp4.mp4"
kMDItemAudioBitRate                    = 47
kMDItemAudioChannelCount               = 1
kMDItemCodecs                          = (
    "H.264",
    "MPEG-4 HE AAC"
)
kMDItemContentCreationDate             = 2020-09-20 20:29:44 +0000
kMDItemContentCreationDate_Ranking     = 2020-09-20 00:00:00 +0000
kMDItemContentModificationDate         = 2020-09-20 20:30:06 +0000
kMDItemContentModificationDate_Ranking = 2020-09-20 00:00:00 +0000
kMDItemContentType                     = "public.mpeg-4"
kMDItemContentTypeTree                 = (
    "public.mpeg-4",
    "public.movie",
    "public.audiovisual-content",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded                       = 2020-09-21 09:17:56 +0000
kMDItemDateAdded_Ranking               = 2020-09-21 00:00:00 +0000
kMDItemDisplayName                     = "testmp4.mp4"
kMDItemDocumentIdentifier              = 39300
kMDItemDurationSeconds                 = 48.179
kMDItemFSContentChangeDate             = 2020-09-20 20:30:06 +0000
kMDItemFSCreationDate                  = 2020-09-20 20:29:44 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "testmp4.mp4"
kMDItemFSNodeCount                     = (null)
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 889304
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2020-09-20 00:00:00 +0000
kMDItemKind                            = "MPEG-4 movie"
kMDItemLastUsedDate                    = 2020-09-20 20:30:09 +0000
kMDItemLastUsedDate_Ranking            = 2020-09-20 00:00:00 +0000
kMDItemLogicalSize                     = 889304
kMDItemMediaTypes                      = (
    Video,
    Sound
)
kMDItemPhysicalSize                    = 892928
kMDItemPixelHeight                     = 400
kMDItemPixelWidth                      = 224
kMDItemProfileName                     = "HD (1-1-1)"
kMDItemStreamable                      = 0
kMDItemTotalBitRate                    = 143
kMDItemUseCount                        = 3
kMDItemUsedDates                       = (
    "2020-09-19 23:00:00 +0000"
)
kMDItemVideoBitRate                    = 95

-----------------------------------------------------------

Troubleshooting passed
 

Screenshot 2020-09-29 at 15.59.08.png

Link to comment
Share on other sites

OK thanks very much. That works.  This has been a lot of learning. I understand that Alfred is all about power and flexibility, but all of this underlines to me that the search system isn't the most intuitive - and I still don't understand why I wouldn't want to "search all file types" by default.

 

 

Link to comment
Share on other sites

6 hours ago, Paul Harrison said:

I still don't understand why I wouldn't want to "search all file types" by default.

 

Because it would be slow and you would have to sift through a large number of results to find the one you're interested in. And it wouldn't work particularly well because Alfred isn't optimised to be used that way.

 

Alfred is designed around the idea of having multiple, tightly-focussed searches. You set up a custom search that only shows folders (with the keyword f, for example), and then you can go directly to the folder you’re interested in without having dozens of other types of files cluttering up the results. Or you set up a search that only looks in the directory where you keep your software licences or PDF manuals for your household devices, or your reference materials for a particular project.

 

The point is most of the time, you don’t want to search everything and see what turns up. You already have a fairly good idea of what you’re looking for and where it is. So you set up individual searches for your most common search tasks and the rest of the time, you use Alfred's open command (or Spotlight).

 

You can configure Alfred to search everything if you really want to. But you’d be throwing away most of its power and speed by doing so.

Edited by deanishe
Link to comment
Share on other sites

  • 1 year later...

Hey all, 

 

I have the same problem as OP

I've been messing around with my iCloud config since getting a new mac.

Turned the option in iCloud drive to backup 'Desktop and Documents' option on and then back off again and since then Alfred hasn't been finding my iCloud docs...

 

I turned off Optimised mac-storage due to reading an earlier comment, still no luck. 

Also rebuilt macOS metadata without luck either. 
This problem was happening on Big Sur and is still occurring on Monterey now. 

 

 

Here's a diagnostic file for a Word document that is in icloud but not appearing in Alfred search: 

 

Starting Diagnostics...

File: 'On learning (psychotherapy).docx'
Path: '/Users/samuelf/Library/Mobile Documents/com~apple~CloudDocs/Documents'

-----------------------------------------------------------

Check file cache database...

File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

Alfred has permissions to read this file.

-----------------------------------------------------------

Check if volume '/' is indexed by macOS...

Indexing is enabled on this drive

-----------------------------------------------------------

Check direct file metadata...

⚠️ Direct metadata is missing, this file is likely not indexed by macOS

Display Name: 
 Other Names: 
Content Type: 
   Last Used: 

-----------------------------------------------------------

Check mdls file metadata...

macOS metadata missing essential items

kMDItemFSContentChangeDate = (null)
kMDItemFSCreationDate      = (null)
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = (null)
kMDItemFSHasCustomIcon     = (null)
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = (null)
kMDItemFSIsStationery      = (null)
kMDItemFSLabel             = (null)
kMDItemFSName              = (null)
kMDItemFSNodeCount         = (null)
kMDItemFSOwnerGroupID      = (null)
kMDItemFSOwnerUserID       = (null)
kMDItemFSSize              = (null)
kMDItemFSTypeCode          = ""

-----------------------------------------------------------

Troubleshooting failed
 

 

Thanks in advance!

 

Sam 

Edited by Ravotten23
Link to comment
Share on other sites

@Ravotten23 As you can see from the troubleshooter, the files in question are not indexed by macOS.

 

The first steps to follow when results seem unexpected is to rebuild your Mac's metadata. It's usually because the data being provided by macOS is incorrect (even if it appears correct in the current Spotlight cache), and rebuilding ensures that all this information is refreshed by the OS.

 

Even if you believe you've already reindexed, please follow the steps below specifically (as it involves deleting a cache first and ensuring Terminal has suitable permissions).

  • First, please pop open System Preferences > Security & Privacy > Privacy > Full Disk Access and add Terminal
  • Once you've done this, go to Alfred's Advanced preferences, choose "Rebuild macOS Metadata"
  • Ensure that you check "Delete .Spotlight-V100 before reindex"
  • Follow the steps in Terminal, and keep a close eye for any error messages relating to your index.

Please let me know if there are any errors. Otherwise, if it proceeds smoothly, you may need to wait up to an hour for the reindex to complete. Once this is done, make your searches again and see if your results are more as expected.

 

If your issue persists, please provide the following information:

  • Your diagnostics file, by typing ?diagnostics into Alfred and emailing it to our info@ address, referencing this thread
  • Output from File Troubleshooting reports for the files you cannot find using Alfred to see if anything's changed.

Cheers,

Vero

Link to comment
Share on other sites

  • 2 weeks later...

Hey, 

 

The full reindexing gave me some functionality, but I'm not back to 100% like before on my previous Mac.

 

It seems that Alfred: 

1) Doesn't work for documents that are currently open anymore? As I have many documents open, it's incredibly useful to be able to search for those ones too, but now these just don't appear in the search anymore; at least my most recent documents. The older ones do still always appear in the search. 

 

2) Some docs (I believe more recent ones) are not listed in Alfred search results but when I open them (through finder) and then search for them, there they are listed again; but then they re-disappear after some time!! 
 

I wonder if it's my iCloud storage structure or what, but it's quite annoying. I save everything on Documents (iCloud) and do not have "backup documents and desktop" active. It's since I messed around with turning this on that I've had these problems but it's also a new device so not sure what's the issue... 

 

Here's an example from a file after total re-indexing as described by @Veroabove. 

This file does not appear in Alfred search as seen below; however, if I open it with Microsoft Word and then search (while it's open) I get it in the search results... For a time, at least.

 

Any help appreciated,

 

Thanks! 

 

 

 

Starting Diagnostics...

File: 'BGE.docx'
Path: '/Users/samuelferrard/Library/Mobile Documents/com~apple~CloudDocs/Documents'

-----------------------------------------------------------

Check file cache database...

File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

Alfred has permissions to read this file.

-----------------------------------------------------------

Check if volume '/' is indexed by macOS...

Indexing is enabled on this drive

-----------------------------------------------------------

Check direct file metadata...

⚠️ Direct metadata is missing, this file is likely not indexed by macOS

Display Name: 
 Other Names: 
Content Type: 
   Last Used: 

-----------------------------------------------------------

Check mdls file metadata...

macOS metadata missing essential items

kMDItemFSContentChangeDate = (null)
kMDItemFSCreationDate      = (null)
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = (null)
kMDItemFSHasCustomIcon     = (null)
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = (null)
kMDItemFSIsStationery      = (null)
kMDItemFSLabel             = (null)
kMDItemFSName              = (null)
kMDItemFSNodeCount         = (null)
kMDItemFSOwnerGroupID      = (null)
kMDItemFSOwnerUserID       = (null)
kMDItemFSSize              = (null)
kMDItemFSTypeCode          = ""

-----------------------------------------------------------

Troubleshooting failed
 

Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...
  • 2 months later...

Same issue here, but I think I found the problem! iCloud files are not located in your Home folder. So I went to Alfred Preferences -> Features -> Default Results -> Search Scope and then hit "+" to add my entire disk volume ("Macintosh HD") to the search scope. That seems to have fixed the problem of not locating files saved in iCloud.

Search Scope 2@2x.png

Search Scope 2 2@2x.png

Search Scope 3@2x.png

Link to comment
Share on other sites

  • 1 month later...

@3point Could you take a look at the troubleshooting and drag some files in to see whether they have any metadata and whether it's complete?

 

Please make sure you're using Alfred 5.0.5 first, as we've improved the File Troubleshooter output to be a little more detailed.

 

https://www.alfredapp.com/help/troubleshooting/indexing/

 

Let us know how you get on :)

Link to comment
Share on other sites

Hello @Vero , 

Thank you for your reply. I am attaching a couple of screen shots and the troubleshooting output. 

 

I have enabled full disk access but diagnostics says Alfred does not have permissions...

Thank you so much in advance! 

 

image.thumb.jpeg.09e7f7940797526c5668f2ccfa41e4e9.jpeg

 

Files in actual folder. Some are downloaded locally, some are icloud only. 

607939760_sc_UsersstillerbDocuments__sharedNewTrierNewTrier00BIOLOGY00Biologyunits01introtobiology_2022-11-08at09_05.54@2x.thumb.jpg.168a12bf461a3a3190fc0eda256f2c57.jpg

 

Alfred Browsing results: 

image.thumb.png.ae36e1a7661252df3b174d1fd6ad0498.png

 

Starting Diagnostics...

File: 'Intro to Ecology Lecture Notes 2020 pcb.pages'
Path: '/Users/stillerb/Documents/__shared New Trier/New Trier/00 BIOLOGY/00 Biology units /01 intro to biology'

-----------------------------------------------------------

Check file cache database...

 File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

 Alfred does not have permissions to read this file.

Check if Full Disk Access is granted in the macOS Security & Privacy preferences.

-----------------------------------------------------------

 Troubleshooting failed

 

Link to comment
Share on other sites

@3point Which version of macOS are you using? If you're on Ventura, did the issue start when you upgraded? And did you upgrade during the beta period or at general release?

 

First, I'd try resetting permissions:

https://www.alfredapp.com/help/getting-started/permissions/#regrant

 

It's possible that macOS's permissions data is corrupted, which isn't unheard of on major OS upgrade. Resetting should resolve that.

 

Let me know how you get on :)

Link to comment
Share on other sites

@Vero

I may have figured something out and maybe you can help me. 

It appears that Alfred can find files that are only on the iCloud drive cloud using quick file search, but it can't find the same file while browsing in Alfred. 

 

Browsing in Alfred can find downloaded files which appear to have regular names ( e.g. ~/Spinach Growth Lab.pages).

 

The iCloud only files that Alfred cannot find are not downloaded to local disk and begin with a "." in their name and end with ".icloud" (e.g. ~/.Intro to Ecology Lecture Notes 2020 pcb.pages.icloud)

 

That appears to be the main differences. Thanks for your help. 

Link to comment
Share on other sites

@3point Ah that's interesting -  Anything that begins with a . should be a hidden or temporary file, which Spotlight doesn't index.

 

If you disable Optimised Storage for iCloud (which ensures that your files are stored locally and "real" rather than just virtual references to online files), are they found?

 

On 11/8/2022 at 3:37 PM, 3point said:

My machine is managed and has a ton of security profiles installed. Perhaps that could cause the issue. 

 

It does appear that there are permissions issues. Are you able to provide Alfred with Full Disk Access in the system prefs? Or is this restricted?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...