Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows related to Calendar don't work #7

Closed
xiajunwen1007 opened this issue Aug 20, 2021 · 3 comments
Closed

Workflows related to Calendar don't work #7

xiajunwen1007 opened this issue Aug 20, 2021 · 3 comments

Comments

@xiajunwen1007
Copy link

I have some events in my Calendar, but the workflow cannot show them and I cannot add new event to Calendar. There are some screenshots.
屏幕录制2021-08-20 下午8 38 27
屏幕录制2021-08-20 下午8 37 10

The workflow's behavior work like I have no such calendar called "alfred", but actually, I do have that.
image

@rknightuk
Copy link
Owner

There's a couple of things you can try here to work out what's wrong

  1. Debug in Alfred

If you open Alfred, select the workflow, then click the "debug" icon in the top right you'll get logs for the workflow.
Try and run the "Upcoming" option and then see if any errors come up there.

image

  1. Run it manually

If you open the directory the workflow is stored in terminal you can try to run it manually with .agendas events and see if you see an error there or get a permissions error.

@xiajunwen1007
Copy link
Author

xiajunwen1007 commented Aug 20, 2021

The "Upcoming" option works quite well and no error occurs. I tried the "Add new event" option, and here is the output.

[07:17:35.915] Logging Started...
[07:17:40.865] Agenda - Reminders and Calendar Events[Script Filter] Queuing argument '(null)'
[07:17:41.142] Agenda - Reminders and Calendar Events[Script Filter] Script with argv '(null)' finished
[07:17:41.146] Agenda - Reminders and Calendar Events[Script Filter] {"items":[{"title":"Today Overview","arg":"today","uid":"today","icon":{"path":"icons/overview.png"},"variables":{"todayOnly":true}},{"title":"Upcoming","arg":"upcoming","uid":"upcoming","icon":{"path":"icons/overview.png"},"variables":{"todayOnly":false}},{"title":"Reminder Lists","arg":"reminder_lists","uid":"reminder_lists","icon":{"path":"icons/list.png"}},{"title":"Create New Reminder","arg":"reminder_create","uid":"reminder_create","icon":{"path":"icons/add.png"}},{"title":"Calendars","arg":"calendar_lists","uid":"calendar_lists","icon":{"path":"icons/calendar.png"}},{"title":"Create New Event","arg":"calendar_create","uid":"calendar_create","icon":{"path":"icons/add.png"}},{"title":"Manage Settings","arg":"settings","uid":"settings","icon":{"path":"icons/settings.png"}}]}
[07:17:42.621] Agenda - Reminders and Calendar Events[Script Filter] Processing complete
[07:17:42.628] Agenda - Reminders and Calendar Events[Script Filter] Passing output 'calendar_create' to Arg and Vars
[07:17:42.629] Agenda - Reminders and Calendar Events[Arg and Vars] Processing complete
[07:17:42.630] Agenda - Reminders and Calendar Events[Arg and Vars] Passing output '' to Conditional
[07:17:42.631] Agenda - Reminders and Calendar Events[Conditional] Processing complete
[07:17:42.632] Agenda - Reminders and Calendar Events[Conditional] Passing output '' to Call External Trigger
[07:17:42.634] Agenda - Reminders and Calendar Events[External] Processing complete
[07:17:42.636] Agenda - Reminders and Calendar Events[External] Passing output '' to Keyword
[07:17:54.034] Agenda - Reminders and Calendar Events[Keyword] Processing complete
[07:17:54.036] Agenda - Reminders and Calendar Events[Keyword] Passing output 'Lunch tomorrow 12 until 2' to Conditional
[07:17:54.038] Agenda - Reminders and Calendar Events[Conditional] Processing complete
[07:17:54.040] Agenda - Reminders and Calendar Events[Conditional] Passing output 'Lunch tomorrow 12 until 2' to Run Script
[07:17:54.369] Agenda - Reminders and Calendar Events[Run Script] Processing complete
[07:17:54.381] Agenda - Reminders and Calendar Events[Run Script] Passing output '' to Conditional
[07:17:54.384] Agenda - Reminders and Calendar Events[Conditional] Processing complete
[07:17:54.386] Agenda - Reminders and Calendar Events[Conditional] Passing output '' to Run Script
[07:17:54.865] Agenda - Reminders and Calendar Events[Run Script] Processing complete
[07:17:54.880] Agenda - Reminders and Calendar Events[Run Script] Passing output 'No reminders list matching alfred
' to Post Notification 

I tried to run .agend from command line, and here is the error message

2021-08-21 07:26:07.816 agendas[9938:254515] CoreData: XPC: Unable to load metadata: Error Domain=NSCocoaErrorDomain Code=134070 "An error occurred in the persistent store." UserInfo={Problem=request failed, insufficient permission}
CoreData: error: addPersistentStoreWithType:configuration:URL:options:error: returned error NSCocoaErrorDomain (134070)
CoreData: annotation: userInfo:
CoreData: annotation: 	Problem : request failed, insufficient permission
CoreData: annotation: storeType: NSXPCStore
CoreData: annotation: configuration: (null)
CoreData: annotation: URL: file:///Users/yyg/Library/Calendars/Calendar%20Cache
CoreData: annotation: options:
CoreData: annotation: 	NSMigratePersistentStoresAutomaticallyOption : 1
CoreData: annotation: 	agentOrDaemon : 1
CoreData: annotation: 	NSInferMappingModelAutomaticallyOption : 1
CoreData: annotation: 	serviceName : com.apple.CalendarAgent.database
CoreData: annotation: 	NSPersistentHistoryTrackingKey : {
    NSPersistentHistoryTrackingEntitiesToExclude =     (
        ChangeRequest
    );
}

It seems there is a permission error. I checked wether .agend have the permission to Calendar, and the answer is no.
image

My OS version is 11.5.1, and there is no apparent way to add the permission.

I tried .agend again, then there is no error message. I give all of the permissions the .agend required at the first launch. So the error vanishes I guess.

@rknightuk
Copy link
Owner

I just released v1.0.1 thanks to @yonbergman who found the issue. New version is here https://github.com/rknightuk/alfred-workflows/tree/main/workflows/agenda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants