bitwarden-alfred-workflow
bitwarden-alfred-workflow copied to clipboard
error when logging in
Dude this workflow is fucking amazing! Thank you for sharing it. Do you have a donation link?
I am getting the following error when trying to login:
[09:16:46.948] ERROR: Bitwarden v2[Run Script] 🍺
09:16:20 workflow.go:328: -------- Bitwarden v2/2.4.7 (AwGo/0.27.1) --------
09:16:20 main.go:162: &main.options{Search:false, Config:false, SetConfigs:false, Auth:false, OnOffConfigs:false, AuthConfig:false, Lock:false, Icons:false, Folder:false, Unlock:false, Login:true, Logout:false, Sync:false, Open:false, GetItem:false, Force:false, Totp:false, Last:false, Background:false, Id:"", Query:"", Attachment:"", Output:""}
09:16:20 main.go:164: args=[]string{"-login"} => []string{}
09:16:20 main.go:165: (main.config) {
AutoFetchIconCacheAge: (int) 1440,
AutoFetchIconMaxCacheAge: (time.Duration) 24h0m0s,
BwconfKeyword: (string) (len=9) ".bwconfig",
BwauthKeyword: (string) (len=7) ".bwauth",
BwKeyword: (string) (len=3) ".bw",
BwfKeyword: (string) (len=4) ".bwf",
BwExec: (string) (len=2) "bw",
BwDataPath: (string) "",
Debug: (bool) false,
Email: (string) (len=17) "bj***@gmail.com",
EmailMaxWait: (int) 15,
EmptyDetailResults: (bool) false,
IconCacheAge: (int) 43200,
IconCacheEnabled: (bool) true,
IconMaxCacheAge: (time.Duration) 720h0m0s,
MaxResults: (int) 1000,
Mod1: (string) (len=3) "alt",
Mod1Action: (string) (len=13) "username,code",
Mod2: (string) (len=5) "shift",
Mod2Action: (string) (len=3) "url",
Mod3: (string) (len=4) "ctrl",
Mod3Action: (string) (len=4) "totp",
Mod4: (string) (len=7) "cmd,opt",
Mod4Action: (string) (len=4) "more",
Mod5: (string) (len=9) "cmd,shift",
Mod5Action: (string) (len=5) "webui",
NoModAction: (string) (len=13) "password,card",
OpenLoginUrl: (bool) true,
OutputFolder: (string) (len=23) "/Users/Bryan/Downloads/",
Path: (string) (len=128) "/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/usr/sbin:/Users/Bryan/.nvm/versions/node/v16.14.0/bin",
ReorderingDisabled: (bool) true,
Server: (string) "",
Sfa: (bool) true,
SfaMode: (int) 0,
SkipTypes: (string) "",
TitleWithUser: (bool) true,
TitleWithUrls: (bool) false,
UseApikey: (bool) false,
WebUiURL: (string) (len=27) "https://vault.bitwarden.com"
}
09:16:46 workflow.go:343: ------------------ FATAL ERROR -------------------
09:16:46 workflow.go:344: runtime error: slice bounds out of range [:2] with length 0 : goroutine 1 [running]:
runtime/debug.Stack()
/Users/runner/hostedtoolcache/go/1.18.7/x64/src/runtime/debug/stack.go:24 +0x65
github.com/deanishe/awgo.(*Workflow).Run.func2()
/Users/runner/go/pkg/mod/github.com/deanishe/[email protected]/workflow.go:344 +0xd9
panic({0x149c760, 0xc000028348})
/Users/runner/hostedtoolcache/go/1.18.7/x64/src/runtime/panic.go:838 +0x207
main.runLogin()
/Users/runner/work/bitwarden-alfred-workflow/bitwarden-alfred-workflow/src/bitwarden.go:548 +0x1309
main.run()
/Users/runner/work/bitwarden-alfred-workflow/bitwarden-alfred-workflow/src/main.go:256 +0x92a
github.com/deanishe/awgo.(*Workflow).Run(0xc0000a0fc0, 0x15079c8)
/Users/runner/go/pkg/mod/github.com/deanishe/[email protected]/workflow.go:358 +0x2e8
main.main()
/Users/runner/work/bitwarden-alfred-workflow/bitwarden-alfred-workflow/src/main.go:290 +0x27
09:16:46 workflow.go:345: ---------------- END STACK TRACE -----------------
09:16:46 workflow.go:376: [ERROR] runtime error: slice bounds out of range [:2] with length 0
09:16:46 workflow.go:379: Get help at https://github.com/blacs30/bitwarden-alfred-workflow/issues
09:16:46 workflow.go:402: ----------------- 26.439953673s ------------------
[09:16:46.974] Bitwarden v2[Run Script] Processing complete
[09:16:46.976] Bitwarden v2[Run Script] Passing output 'runtime error: slice bounds out of range [:2] with length 0' to Conditional
[09:16:46.977] Bitwarden v2[Conditional] Processing complete
[09:16:46.978] Bitwarden v2[Conditional] Passing output 'runtime error: slice bounds out of range [:2] with length 0' to Post Notification
Thanks for the kind words. Currently I don't have a donation address.
Are you a long term user of Bitwarden? You might wanna try this rotation of the encryption key, so far that has helped those kind of issues: https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key
It will log you out of every device though.
Thanks for the kind words. Currently I don't have a donation address.
I see. Well, if you change your mind I would love to support your efforts.
Are you a long term user of Bitwarden? You might wanna try this rotation of the encryption key, so far that has helped those kind of issues: https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key
reset and same error
It will log you out of every device though.
I tried to login using the cli in term and it prompted me for my API client secret. I am wondering if the workflow app isn't handling this scenario. I am still testing but I think logging in via the cli in term fixed the workflow app.
i tried to do an unlock and got this error:
[09:11:40.497] Bitwarden v2[Script Filter] Processing complete
[09:11:40.498] Bitwarden v2[Script Filter] Passing output '' to Conditional
[09:11:40.500] Bitwarden v2[Conditional] Processing complete
[09:11:40.501] Bitwarden v2[Conditional] Passing output '' to Hide Alfred
[09:11:40.502] Bitwarden v2[Hide Alfred] Processing complete
[09:11:40.503] Bitwarden v2[Hide Alfred] Passing output '' to Run Script
[09:11:45.646] ERROR: Bitwarden v2[Run Script] 🍺
09:11:40 workflow.go:328: -------- Bitwarden v2/2.4.7 (AwGo/0.27.1) --------
09:11:40 main.go:162: &main.options{Search:false, Config:false, SetConfigs:false, Auth:false, OnOffConfigs:false, AuthConfig:false, Lock:false, Icons:false, Folder:false, Unlock:true, Login:false, Logout:false, Sync:false, Open:false, GetItem:false, Force:false, Totp:false, Last:false, Background:false, Id:"", Query:"", Attachment:"", Output:""}
09:11:40 main.go:164: args=[]string{"-unlock"} => []string{}
09:11:40 main.go:165: (main.config) {
AutoFetchIconCacheAge: (int) 1440,
AutoFetchIconMaxCacheAge: (time.Duration) 24h0m0s,
BwconfKeyword: (string) (len=9) ".bwconfig",
BwauthKeyword: (string) (len=7) ".bwauth",
BwKeyword: (string) (len=3) ".bw",
BwfKeyword: (string) (len=4) ".bwf",
BwExec: (string) (len=2) "bw",
BwDataPath: (string) "",
Debug: (bool) false,
Email: (string) (len=17) "b**@gmail.com",
EmailMaxWait: (int) 15,
EmptyDetailResults: (bool) false,
IconCacheAge: (int) 43200,
IconCacheEnabled: (bool) true,
IconMaxCacheAge: (time.Duration) 720h0m0s,
MaxResults: (int) 1000,
Mod1: (string) (len=3) "alt",
Mod1Action: (string) (len=13) "username,code",
Mod2: (string) (len=5) "shift",
Mod2Action: (string) (len=3) "url",
Mod3: (string) (len=4) "ctrl",
Mod3Action: (string) (len=4) "totp",
Mod4: (string) (len=7) "cmd,opt",
Mod4Action: (string) (len=4) "more",
Mod5: (string) (len=9) "cmd,shift",
Mod5Action: (string) (len=5) "webui",
NoModAction: (string) (len=13) "password,card",
OpenLoginUrl: (bool) true,
OutputFolder: (string) (len=23) "/Users/Bryan/Downloads/",
Path: (string) (len=128) "/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/usr/sbin:/Users/Bryan/.nvm/versions/node/v16.14.0/bin",
ReorderingDisabled: (bool) true,
Server: (string) "",
Sfa: (bool) true,
SfaMode: (int) 0,
SkipTypes: (string) "",
TitleWithUser: (bool) true,
TitleWithUrls: (bool) false,
UseApikey: (bool) false,
WebUiURL: (string) (len=27) "https://vault.bitwarden.com"
}
09:11:45 utils.go:32: [ERROR] ==> [(node:99944) ExperimentalWarning: The fs.promises API is experimental Invalid master password.]
09:11:45 utils.go:44: [ERROR] ==> Exit code 1. Unlocking Bitwarden failed. Err: (node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password.
09:11:45 workflow.go:376: [ERROR] Unlocking Bitwarden failed. Error:
(node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password.
09:11:45 workflow.go:379: Get help at https://github.com/blacs30/bitwarden-alfred-workflow/issues
09:11:45 workflow.go:402: ------------------ 5.108140232s ------------------
[09:11:45.656] Bitwarden v2[Run Script] Processing complete
[09:11:45.657] Bitwarden v2[Run Script] Passing output 'Unlocking Bitwarden failed. Error:
(node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password.' to Conditional
[09:11:45.658] Bitwarden v2[Conditional] Processing complete
[09:11:45.659] Bitwarden v2[Conditional] Passing output 'Unlocking Bitwarden failed. Error:
(node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password.' to Post Notification
On a side note, I am not seeing any of these errors except for when I open the debug window in the workflow.
Thanks for the logs. This one now shows little bit more.
09:11:45 utils.go:32: [ERROR] ==> [(node:99944) ExperimentalWarning: The fs.promises API is experimental Invalid master password.]
09:11:45 utils.go:44: [ERROR] ==> Exit code 1. Unlocking Bitwarden failed. Err: (node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password.
09:11:45 workflow.go:376: [ERROR] Unlocking Bitwarden failed. Error:
(node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password.
I see that you've set the path and probably you are not using plain brew to install node (and/or bitwarden) Either way it's a new error for me.
Which version of the Bitwarden CLI and Node do you run? If I google just for this error ExperimentalWarning: The fs.promises API is experimental
then this seems to be related to an older node version. Maybe try upgrading/installing a second version and update the path config in the workflow.
Regarding the Bitwarden workflow login you can set in the config .bwconf
that you want to enable API Key as login method. It doesn't detect that automatically.
Internally the workflow is still using the bw cli command. My dream is to one day use the API directly and also to have better automated testing against a vaultwarden instance.
Anyway back tot he issue. Let me know if anything of the above helped.
Thanks for the logs. This one now shows little bit more.
09:11:45 utils.go:32: [ERROR] ==> [(node:99944) ExperimentalWarning: The fs.promises API is experimental Invalid master password.] 09:11:45 utils.go:44: [ERROR] ==> Exit code 1. Unlocking Bitwarden failed. Err: (node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password. 09:11:45 workflow.go:376: [ERROR] Unlocking Bitwarden failed. Error: (node:99944) ExperimentalWarning: The fs.promises API is experimentalInvalid master password.
I see that you've set the path and probably you are not using plain brew to install node (and/or bitwarden) Either way it's a new error for me.
Correct. I use nvm.
Which version of the Bitwarden CLI and Node do you run?
bw --version 2022.11.0
node --version v19.3.0
If I google just for this error
ExperimentalWarning: The fs.promises API is experimental
then this seems to be related to an older node version. Maybe try upgrading/installing a second version and update the path config in the workflow.
Done. However, I am getting the same errors.
Regarding the Bitwarden workflow login you can set in the config
.bwconf
that you want to enable API Key as login method. It doesn't detect that automatically.
Seems like the login issue may be related to the error above. I think I am able to login but when I sync folders I have no secrets(passwords) in the folders. When I do a list search manually in terminal I can see that there are passwords and everything seems to work just not syncing in the workflow.
Internally the workflow is still using the bw cli command. My dream is to one day use the API directly and also to have better automated testing against a vaultwarden instance.
That would be pretty sweet. Though if the cli is fast and reliable it should be good right?
Anyway back tot he issue. Let me know if anything of the above helped. Yeah I updated node, npm and bw. I was definitely using an older version of node and npm. Seems to have the same syncing issue as before though.
Do you really still have the same error with node:99944) ExperimentalWarning: The fs.promises API is experimental
?
Could you check the path of the binaries of bw
and node
(with the correct version) and update the path variable of the Alfred Workflow accordingly?
Thanks