clients
clients copied to clipboard
An error based on 2022.8.0 version - Cannot read properties of null (reading 'toLowerCase')
Steps To Reproduce
I noticed it by using BW plugin for ansible on get_entry() call.
Expected Result
No error messages
Actual Result
An error comes:
failed: [odoonode] (item={'src': u'/home/test/workdir/tmpHdEDid/deployment_staging/templates/etc/odoo/odoo.conf', 'group': u'test', 'uid': 1000, 'state': 'file', 'gid': 1000, 'mode': '0644', 'mtime': 1660045875.8906062, 'owner': 'test', 'path': u'etc/odoo/odoo.conf', 'size': 9535, 'root': u'/home/test/workdir/tmpHdEDid/deployment_staging/templates/', 'ctime': 1660045875.8906062}) => {\"changed\": false, \"item\": {\"ctime\": 1660045875.8906062, \"gid\": 1000, \"group\": \"test\", \"mode\": \"0644\", \"mtime\": 1660045875.8906062, \"owner\": \"test\", \"path\": \"etc/odoo/odoo.conf\", \"root\": \"/home/test/workdir/tmpHdEDid/deployment_staging/templates/\", \"size\": 9535, \"src\": \"/home/test/workdir/tmpHdEDid/deployment_staging/templates/etc/odoo/odoo.conf\", \"state\": \"file\", \"uid\": 1000}, \"msg\": \"AnsibleError: An unhandled exception occurred while templating '{{ lookup('bitwarden', 'deeper_server_' + env, field='sentry_dsn', custom_field=true)}}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'bitwarden'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Unknown failure in 'bw' command: /snapshot/clients/apps/cli/build/bw.js:23363\
c.login.uris.some((loginUri) => loginUri.uri.toLowerCase().indexOf(query) > -1)) {\
^\
\
TypeError: Cannot read properties of null (reading 'toLowerCase')\
at /snapshot/clients/apps/cli/build/bw.js:23363:62\
at Array.some (<anonymous>)\
at /snapshot/clients/apps/cli/build/bw.js:23363:30\
at Array.filter (<anonymous>)\
at SearchService.searchCiphersBasic (/snapshot/clients/apps/cli/build/bw.js:23348:24)\
at GetCommand.<anonymous> (/snapshot/clients/apps/cli/build/bw.js:34454:46)\
at Generator.next (<anonymous>)\
at fulfilled (/snapshot/clients/apps/cli/build/bw.js:34356:58)\
\"}
Screenshots or Videos
No response
Additional Context
No response
Operating System
Linux
Operating System Version
Ubuntu 16.04.7 LTS
Shell
Bash
Build Version
2022.8.0
Same for me
Workaround ubuntu :
sudo snap revert bw
to revert to 2022.6.2
I get this when I run bw get password on every password I've tried, if that helps with reproducing the issue.
Workaround ubuntu :
sudo snap revert bwto revert to 2022.6.2
I already did this. But it would be nice to have the latest version as well.
I've seen this as well on Win10
Get attachments doesn't work for linux cli in 2022.8.0 as well
same error on Mac 12.5, bitwarden-cli installed using brew
Same on Ubuntu 22.04. Reverting to release 1.22.0 fixes the issue.
same here for bw list items --search ... and bw get item ...
Ubuntu: 20.04.4 LTS
Facing the same error when using bw get ....
Version: 2022.8.0
Manjaro 5.18.17-1
Hi all, apologies for the inconveniences caused. The team is currently looking into this and will get it fixed soon. Thank you for your patience!
This is due to missing out on some null checking on item URIs saved to your vault. I just opened a PR for a fix, but in the mean time, we can find the offending vault item and remove the unused URI value.
Please open up your data.json file (I can tell you where that is if you tell me your operating system: windows, mac, or linux). Don't change any values in there, but search for "uri": null and note down the ID of the offending item(s). They will look like this
"b60aaa5b-f88c-4cde-8beb-aedd01367ac4": {
"id": "b60aaa5b-f88c-4cde-8beb-aedd01367ac4",
"organizationId": null,
"folderId": null,
"edit": true,
"viewPassword": true,
"organizationUseTotp": false,
"favorite": false,
"revisionDate": "2022-08-16T11:33:27.6433333Z",
"type": 1,
"name": "2.8GPeSwM1EvYnDfgltjcEBQ==|/OqqqJ0YTec6nf4cNTW1VA==|zcySfvHLPJAZHhhaayYdYDVHCruFzZSSPYLTp/xWTAU=",
"notes": null,
"collectionIds": [],
"deletedDate": null,
"reprompt": 0,
"login": {
"username": "2.CUtAn57dgktcnFBSZwjD8g==|jLMoJx8I3NLcMCEV/5Gb7w==|A5Zt6VtCD+qaEe0EQyGN5cHaLKDpHAQA0nhMk5IGigA=",
"password": "2.DUR1HIC57CUanx0NYfAeAQ==|FHDJmqozIdkaewqzg2OD3Q==|NMFF5o4VMOu2fHuSxksrqRDCcjv6ncV+Y67on5YiAWs=",
"passwordRevisionDate": null,
"totp": null,
"autofillOnPageLoad": null,
"uris": [
{
"match": null,
"uri": null
}
]
}
}
The top value, b60aaa5b-f88c-4cde-8beb-aedd01367ac4, is the ID you can use to grab this item in the CLI. It should still work since this method short circuits the search that is failing. Once you have your decrypted item, update it to remove the URI in any client you would like.
After updating the items with a null URI and a fresh bw sync, your vault search should work fine.
To reiterate, this is definitely a bug, and is going to be fixed. This is a stop-gap to help you out in the mean time.
This is still a thing I think
❯ bw --version
2022.8.0
❯ bw get item ssh_config
/opt/homebrew/Cellar/bitwarden-cli/2022.8.0/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:23363
c.login.uris.some((loginUri) => loginUri.uri.toLowerCase().indexOf(query) > -1)) {
^
TypeError: Cannot read properties of null (reading 'toLowerCase')
at /opt/homebrew/Cellar/bitwarden-cli/2022.8.0/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:23363:62
at Array.some (<anonymous>)
at /opt/homebrew/Cellar/bitwarden-cli/2022.8.0/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:23363:30
at Array.filter (<anonymous>)
at SearchService.searchCiphersBasic (/opt/homebrew/Cellar/bitwarden-cli/2022.8.0/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:23348:24)
at GetCommand.<anonymous> (/opt/homebrew/Cellar/bitwarden-cli/2022.8.0/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:34454:46)
at Generator.next (<anonymous>)
at fulfilled (/opt/homebrew/Cellar/bitwarden-cli/2022.8.0/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:34356:58)
Edit: I see that no new version has been cut since this has been merged hence why upstream formulae was not updated.
Can you consider making a hotfix with this fix instead of waiting until the next main release?
This basically breaks the enitre program and its already fixed so this fix should be realeased asap IMO.
please fix this is screwing my work flow, I use CLI for everything specially to pipe output to other programs
I have identified the items that appear to have the "null" properties as suggested, however, after doing so I cannot actually perform a perform a sync because I get the same error. Please release a hotfix for this ASAP. I will downgrade to the previous version.

Anyone eager to get this fix before a release is cut can download the CI build from here.
Fix ASAP please, huge problem.
Bumping this. It's been a couple months now since this has been broken and fixed. Given that it's a 1 line patch, is there any way it can be cherry picked and released?