Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Missing permission to copy LaunchAgent #175

Open
torbenkeller opened this issue Sep 6, 2023 · 9 comments
Open

Missing permission to copy LaunchAgent #175

torbenkeller opened this issue Sep 6, 2023 · 9 comments

Comments

@torbenkeller
Copy link

torbenkeller commented Sep 6, 2023

when I want to execute the install auto sync script I always get the following output:

[23:32:31.717] Bitwarden v2[List Filter] Processing complete
[23:32:31.728] Bitwarden v2[List Filter] Passing output '--install' to Run Script
[23:32:31.922] ERROR: Bitwarden v2[Run Script] found workflow v3.0.1 at /Users/torben/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DA388574-13BA-4CE9-9B0C-D96C84AE7AC0
cp: /Users/torben/Library/LaunchAgents/com.lisowski-development.alfred.bitwarden_autosync.plist: No such file or directory
[23:32:31.939] Bitwarden v2[Run Script] Processing complete
[23:32:31.947] Bitwarden v2[Run Script] Passing output 'removing existing service
generating new service configuration
generated config with 2 timers [at 8:15 23:45 ]
/var/folders/l1/vq850vsj4cz36sh0wh_24kqr0000gn/T//com.lisowski-development.alfred.bitwarden_autosync.plist: OK
result|1|failed to copy LaunchAgent
' to Run Script
[23:32:31.993] Bitwarden v2[Run Script] Processing complete
[23:32:32.005] Bitwarden v2[Run Script] Passing output 'result|1|failed to copy LaunchAgent
' to Split Arg
[23:32:32.011] Bitwarden v2[Split Arg] Processing complete
[23:32:32.017] Bitwarden v2[Split Arg] Passing output 'result|1|failed to copy LaunchAgent
' to Conditional
[23:32:32.022] Bitwarden v2[Conditional] Processing complete
[23:32:32.026] Bitwarden v2[Conditional] Passing output 'result|1|failed to copy LaunchAgent
' to Arg and Vars
[23:32:32.031] Bitwarden v2[Arg and Vars] Processing complete
[23:32:32.035] Bitwarden v2[Arg and Vars] Passing output 'result|1|failed to copy LaunchAgent
' to Post Notification

seems like the permission to copy the created plist file into the LaunchAgent folder is missing:

if ! /bin/cp -f "${plist_tmp_path}" "${plist_path}"; then _end 1 "failed to copy LaunchAgent"; fi
luckman212 added a commit to luckman212/bw-cache-update that referenced this issue Sep 7, 2023
@luckman212
Copy link
Collaborator

luckman212 commented Sep 7, 2023

I looked into this a bit since I'm the original author of that portion of the workflow. Seems it's in need of some dusting off!

I've just posted updated versions of the bw_cache_update.sh and bw_auto_lock.sh scripts that are used for the LaunchAgents controlling autosync/autolock. Can you try downloading them:

image

...and dropping them into your workflow's folder, replacing the existing ones and give it another try?

Another thing to double check is that you've granted Full Disk Access and Accessibility permissions to Alfred:

screenshot_1YI2GXZi

screenshot_0jXiBYXg

@luckman212
Copy link
Collaborator

@blacs30

While we wait for @torbenkeller to test, I've submitted these changes as PR #176

@torbenkeller
Copy link
Author

Thank you @luckman212 for your fast response!

I replaced the files you mentioned in the workflow and still get the error. But now I also get a dialog window telling me the task has failed.

Screenshot 2023-09-07 at 21 47 45

The new log message is this:

[21:46:34.021] Bitwarden v2[List Filter] Processing complete
[21:46:34.027] Bitwarden v2[List Filter] Passing output '--install' to Run Script
[21:46:34.029] ERROR: Bitwarden v2[Run Script] Task '/Users/torben/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DA388574-13BA-4CE9-9B0C-D96C84AE7AC0/bw_auto_lock.sh' failed with reason 'launch path not accessible'
[21:46:34.030] Bitwarden v2[Run Script] Processing complete
[21:46:34.032] Bitwarden v2[Run Script] Passing output '' to Run Script
[21:46:34.053] Bitwarden v2[Run Script] Processing complete
[21:46:34.067] Bitwarden v2[Run Script] Passing output '' to Split Arg
[21:46:34.069] Bitwarden v2[Split Arg] Processing complete
[21:46:34.070] Bitwarden v2[Split Arg] Passing output '' to Conditional

I hope this helps!

@luckman212
Copy link
Collaborator

luckman212 commented Sep 7, 2023

The workflow should be automatically making those scripts +x executable, but I'll need to check on that.

For now, try opening a Terminal and pasting

cd '/Users/torben/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DA388574-13BA-4CE9-9B0C-D96C84AE7AC0'
chmod +x *.sh

@luckman212
Copy link
Collaborator

I just pushed another update to #176 with an auto-fix for the +x flag. If that gets merged it could help with this

@blacs30
Copy link
Owner

blacs30 commented Sep 9, 2023

Feel free to merge and tag. I think @luckman212 might be also able to release a new version. - After a new tag is pushed a draft release is created and it just needs to be released. I'm currently unable for the next 2 weeks to do it myself.

@luckman212
Copy link
Collaborator

@blacs30 I am happy to help, but I'm a bit uneasy about pushing a new release before reviewing the steps with you, becauce I think it involves compiling the bitwarden-alfred-workflow binary as well? This isn't urgent, let's check back on it in a couple of weeks. I merged #176 in the meantime.

@wollew
Copy link

wollew commented Nov 1, 2023

I just opened #179 because the new bw_auto_lock.sh didn't work for me any more, I think there was a typo in a variable name.

@luckman212
Copy link
Collaborator

luckman212 commented Nov 1, 2023

Thanks @wollew you're right. It wasn't technically a typo, but rather a missed instance of that bwexec variable which got renamed somewhere along the way. Good catch and sorry for the trouble.

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

No branches or pull requests

4 participants