# Error when getting \`collections\` with CLI on Linux

**URL:** <https://vaultwarden.discourse.group/t/error-when-getting-collections-with-cli-on-linux/2015>\
**Category:** Uncategorized\
**Created:** [November 20, 2022, 10:35pm UTC](https://vaultwarden.discourse.group/t/error-when-getting-collections-with-cli-on-linux/2015 "2022-11-20T22:35:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juanbretti](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/juanbretti/32/959_2.png) [@juanbretti](https://vaultwarden.discourse.group/u/juanbretti)\
**Post date:** [November 20, 2022, 10:35pm UTC](https://vaultwarden.discourse.group/t/error-when-getting-collections-with-cli-on-linux/2015/1 "2022-11-20T22:35:30Z")

</div>

I am getting an error when getting the _collections_ from the **Vaultwarden** instance installed on my local server.

I am using the CLI posted at [https://bitwarden.com/help/cli/](https://bitwarden.com/help/cli/).  
If I use the Windows version, everything works.  
If I use the **Linux** version (using **Ubuntu 22.04** ), I get the following error: `[error: cannot decrypt]`

```auto
[{'object': 'collection',
  'id': '9df2xxxxxxxxxxx',
  'organizationId': '8f78xxxxxxxxxxxx',
  'name': '[error: cannot decrypt]',
  'externalId': None}]

```

In order to run the CLI, I am using **Python**.  
I am using the following process:

```auto
subprocess. Run("bw list collections", shell=True, capture_output=True, text=True, env=bw_env_session, encoding="utf-8")

```

And getting this output:

```auto
CompletedProcess(args='bw list collections', returncode=0, stdout='[{"object":"collection","id":"9df2xxxxxxxxxxx","organizationId":"8f78xxxxxxxxxxxx","name":"[error: cannot decrypt]","externalId":null}]', stderr='')

```

Following, the status of the connection, showing that the status is **unlocked**.

```auto
subprocess. Run("bw status", shell=True, capture_output=True, text=True, env=bw_env_session, encoding="utf-8")

```

Output:

```auto
CompletedProcess(args='bw status', returncode=0, stdout='{"serverUrl":"https://vault.mydomain.com","lastSync":"2022-11-20T20:38:57.580Z","userEmail":"my@mail.com","userId":"dcfxxxxx","status":"unlocked"}', stderr='')

```

Any ideas? Thanks!

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [November 20, 2022, 10:52pm UTC](https://vaultwarden.discourse.group/t/error-when-getting-collections-with-cli-on-linux/2015/2 "2022-11-20T22:52:43Z")

</div>

Probably something regarding the output.  
I think it isn’t the bw cli tool, since that should be almost identical on windows or Linux, which also leaves out the server it self, since that returns the exact same data no matter which os or client you use.

Since you are using Python, maybe using [bitwardentools · PyPI](https://pypi.org/project/bitwardentools/) is a better solution.

---

<div class="post-metadata">

**Author:** ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)\
**Post date:** [November 21, 2022, 12:01am UTC](https://vaultwarden.discourse.group/t/error-when-getting-collections-with-cli-on-linux/2015/3 "2022-11-21T00:01:00Z")

</div>

Seems to be an [issue on systems](https://github.com/bitwarden/clients/issues/2726) with **openssl-3.0** where the default config file is not really backwards compatible. Can you test with `OPENSSL_CONF=/dev/null bw list collections` if this works as a workaround?

---

<div class="post-metadata">

**Author:** ![juanbretti](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/juanbretti/32/959_2.png) [@juanbretti](https://vaultwarden.discourse.group/u/juanbretti)\
**Post date:** [November 21, 2022, 10:07am UTC](https://vaultwarden.discourse.group/t/error-when-getting-collections-with-cli-on-linux/2015/4 "2022-11-21T10:07:56Z")

</div>

@stefan0xC , thank you!  
I was not able to find the issue on GitHub before.

I notice this issue was reported several times at [Error cannot decrypt · Issue #3057 · bitwarden/clients · GitHub](https://github.com/bitwarden/clients/issues/3057) and the one you mentioned [CLI Incompatible with Ubuntu Server 22.04 · Issue #2726 · bitwarden/clients · GitHub](https://github.com/bitwarden/clients/issues/2726).

This trick `OPENSSL_CONF=/dev/null bw list collections` works for the listing, but I also having problems when `edit` and `create` when a **collection** is defined. And for these two lasts, it does not work.  
I have tried using another distro (not Ubuntu) and it works well (like in Windows).

Looks like I will have to run my **Python** code on the other distribution for now.

BTW, what I am building is a mirror from my KeePass to Vaultwarden.
