Closed axhamre closed 3 years ago
The popup message suggests the most common problem people have, which is with setup, regardless of the real error. I think your setup is fine, because the error is coming from a line inside the code.
Did you change the file permissions of the executable search_notes
? It's inside a directory of the same name in the workflow directory which you can access by right-clicking on the workflow in Alfred and selecting "Open in Finder".
In your terminal, can you tell me the output of
stat -x ~/Library/Group\ Containers/group.com.apple.notes/NoteStore.sqlite
And also (after cd
ing into the workflow directory)
stat -x search_notes/search_notes
I ran into the same problem after upgrading to 11.4.
From the plugin directory, I ran the search I was trying to run from Alfred, namely ./search_notes title NI
. It brought back valid search results.
{ "items": [ { "title": "NI Hiring", "subtitle": "NI Hiring", "arg": "x-coredata://34D75F64-A28E-4E94-B9EA-A44B6E3F0EB5/ICNote/p19?NI", "quicklookurl": null }, ...
So I don't think it is actually permissions issue.
(also, THANK YOU for developing this plugin. I use it every day. It's great.)
You're welcome! And thanks for confirming this is a widespread issue. The latest version I've been using has some changes in the binary and it's been working for me on 11.4, so could either of you install the attached and let me know if it works when searching through Alfred?
I tried it and still got the same error. Well, slightly different. The offset is different. (+0x644 (new) vs +0x789(old)).
The error for me is:
Also, I can confirm that I can still successfully run the script from the command line.
The perms are: -rwxr-xr-x 1 myuser staff 13478770 May 30 09:27 search_notes/search_notes
Unfortunately, I don't know where to find the "database" referenced by the error log, so I can't look up the perms on it. Either way, it's strange since the script runs fine when run as a script from the command line.
The database is here: ~/Library/Group\ Containers/group.com.apple.notes/NoteStore.sqlite
Would be good to know your permissions on that too.
ls -la ~/Library/Group\ Containers/group.com.apple.notes/NoteStore.sqlite
-rw-r--r-- 1 myuser staff 15757312 Jun 4 01:13 /Users/myuser/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite
I am able to access that sqlite file with sqlite3 and read the tables.
I compiled the project in Golang 1.16 for my M1 Mac, and Alfred still throws up this error (and only this error. not the others depicted in OP's link):
I tried replacing the search_notes binary with my own binary that simply writes "Hello World" to stderr. That binary runs fine.
Some tweaking of your search_notes, and I extracted the long SELECT query. I verified I was able to run that query successfully in sqlite3. I also verified that NewLiteDB and NewNotesDB do not generate err values.
Well, I finally figured it out. Alfred didn't have Full Disk Access checked in the Security & Privacy → Privacy pane. Once I check off Full Disk access it worked fine.
When you tested search_notes from the command line, did you have a search string? If not, the executable doesn’t really do anything. This is how to search:
./search_notes body "search string"
On Jun 4, 2021, at 6:59 AM, gitrobert42 @.***> wrote:
Some tweaking of your search_notes, and I extracted the long SELECT query. I verified I was able to run that query successfully in sqlite3. I also verified that NewLiteDB and NewNotesDB do not generate err values.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Ah, that makes sense! I will make this more explicit in the setup instructions.
Still not sure why that would have changed during the upgrade to 11.4
On Jun 4, 2021, at 8:46 AM, Sean Ballinger @.***> wrote:
When you tested search_notes from the command line, did you have a search string? If not, the executable doesn’t really do anything. This is how to search:
./search_notes body "search string"
On Jun 4, 2021, at 6:59 AM, gitrobert42 @.***> wrote:
Some tweaking of your search_notes, and I extracted the long SELECT query. I verified I was able to run that query successfully in sqlite3. I also verified that NewLiteDB and NewNotesDB do not generate err values.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
I'm not sure either. Maybe 11.4 tightened up the sandbox.
Well, I finally figured it out. Alfred didn't have Full Disk Access checked in the Security & Privacy → Privacy pane. Once I check off Full Disk access it worked fine.
This solved it for me as well, thank you!
And thank you @gitrobert42 for an amazing plugin.
Alfred does have full disk access for me, however the issue still persists.
To Reproduce
Info
Additional context Add any other context about the problem here.