Cannot create API Key - An unexpected error has occurred - 404 Not Found #879

Closed
opened 2026-02-20 08:05:51 -05:00 by deekerman · 14 comments
Owner

Originally created by @aramaki87 on GitHub (Dec 3, 2020).

Subject of the issue

I cannot create API key from Web GUI (selfhosted) "An unexpected error has occurred"

Your environment

LXC Container running BitwardenRS build from source
WEB UI is running without HTTPS, only HTTP
HAProxy on another machine doing HTTPS (Mapping 443 -> 80)
Port 3012 is also accessible

Server Installed: 1.17.0
Web Installed: 2.17.0

ufw temporarily disabled

Steps to reproduce

I click on generate API Key in the Web GUI and get "An unexpected error has occurred" message.

Syslog:

Dec 3 07:42:28 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:28.904][request][INFO] GET /api/accounts/profile
Dec 3 07:42:28 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:28.905][response][INFO] GET /api/accounts/profile (profile) => 200 OK
Dec 3 07:42:36 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:36.370][request][INFO] POST /api/accounts/api-key
Dec 3 07:42:36 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:36.370][response][INFO] 404 Not Found

Conclusion:

It looks like whatever should provide /api/accounts/api-key is not there...
Everything else is up and working. Having multiple organisations and some users accessing them. All good.

Originally created by @aramaki87 on GitHub (Dec 3, 2020). ### Subject of the issue I cannot create API key from Web GUI (selfhosted) "An unexpected error has occurred" ### Your environment LXC Container running BitwardenRS build from source WEB UI is running without HTTPS, only HTTP HAProxy on another machine doing HTTPS (Mapping 443 -> 80) Port 3012 is also accessible Server Installed: 1.17.0 Web Installed: 2.17.0 ufw temporarily disabled ### Steps to reproduce I click on generate API Key in the Web GUI and get "An unexpected error has occurred" message. ### Syslog: Dec 3 07:42:28 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:28.904][request][INFO] GET /api/accounts/profile Dec 3 07:42:28 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:28.905][response][INFO] GET /api/accounts/profile (profile) => 200 OK Dec 3 07:42:36 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:36.370][request][INFO] POST /api/accounts/api-key Dec 3 07:42:36 bitwardenRS bitwarden_rs[6248]: [2020-12-03 07:42:36.370][response][INFO] 404 Not Found ### Conclusion: It looks like whatever should provide /api/accounts/api-key is not there... Everything else is up and working. Having multiple organisations and some users accessing them. All good.
deekerman 2026-02-20 08:05:51 -05:00
Author
Owner

@BlackDex commented on GitHub (Dec 3, 2020):

May i ask which version of the web-vault you are using?
Did you build it your self? And if so did you use npm run dist? If not, you probably have the wrong vault version for bitwarden_rs.

See: https://github.com/dani-garcia/bitwarden_rs/wiki/Building-binary#install-the-web-vault
On how to build the web-vault your self.

@BlackDex commented on GitHub (Dec 3, 2020): May i ask which version of the web-vault you are using? Did you build it your self? And if so did you use `npm run dist`? If not, you probably have the wrong vault version for bitwarden_rs. See: https://github.com/dani-garcia/bitwarden_rs/wiki/Building-binary#install-the-web-vault On how to build the web-vault your self.
Author
Owner

@aramaki87 commented on GitHub (Dec 3, 2020):

Hi,

I checked the admin panel:

Server Installed Ok
1.17.0
Server Latest
1.17.0
Web Installed Update
2.17.0
Web Latest
2.16.1

I think this is the problem. I try another version and report back.

@aramaki87 commented on GitHub (Dec 3, 2020): Hi, I checked the admin panel: Server Installed Ok 1.17.0 Server Latest 1.17.0 Web Installed Update 2.17.0 Web Latest 2.16.1 I think this is the problem. I try another version and report back.
Author
Owner

@aramaki87 commented on GitHub (Dec 4, 2020):

I reinstalled everything but this time only up to version 2.16.1
I also applied the web vault patch 2.16.1.

Server Installed Ok
1.17.0
Server Latest
1.17.0
Web Installed Ok
2.16.1
Web Latest
2.16.1

Now the funny thing is I do not even see the option to generate an API Key anymore from within the web GUI. The section is just gone. Not there anymore. Do I have to enable this somehow?

@aramaki87 commented on GitHub (Dec 4, 2020): I reinstalled everything but this time only up to version 2.16.1 I also applied the web vault patch 2.16.1. Server Installed Ok 1.17.0 Server Latest 1.17.0 Web Installed Ok 2.16.1 Web Latest 2.16.1 Now the funny thing is I do not even see the option to generate an API Key anymore from within the web GUI. The section is just gone. Not there anymore. Do I have to enable this somehow?
Author
Owner

@BlackDex commented on GitHub (Dec 4, 2020):

If you are referring to the apikey for usage with the bw cli for example, that is not supported (yet). And thus hidden, and thus generates a 404.

@BlackDex commented on GitHub (Dec 4, 2020): If you are referring to the apikey for usage with the bw cli for example, that is not supported (yet). And thus hidden, and thus generates a 404.
Author
Owner

@aramaki87 commented on GitHub (Dec 4, 2020):

THIS explains everything! Alright, Thank you! Is that common knowledge or somewhere written?

Last question: Is there another way to automate/script export (to .csv) at the moment? I know that I can export the database but that is not what I am looking for.

@aramaki87 commented on GitHub (Dec 4, 2020): THIS explains everything! Alright, Thank you! Is that common knowledge or somewhere written? Last question: Is there another way to automate/script export (to .csv) at the moment? I know that I can export the database but that is not what I am looking for.
Author
Owner

@jjlin commented on GitHub (Dec 9, 2020):

The recent v2.17.1 release of the web vault properly hides the API key section.

@jjlin commented on GitHub (Dec 9, 2020): The recent [v2.17.1](https://github.com/dani-garcia/bw_web_builds/releases/tag/v2.17.1) release of the web vault properly hides the API key section.
Author
Owner

@aramaki87 commented on GitHub (Dec 10, 2020):

Alright no option to export to csv at the moment?

@aramaki87 commented on GitHub (Dec 10, 2020): Alright no option to export to csv at the moment?
Author
Owner

@BlackDex commented on GitHub (Dec 11, 2020):

@aramaki87, you can export the vault via the tools menu when logged-in. Or use the cli https://github.com/bitwarden/cli

@BlackDex commented on GitHub (Dec 11, 2020): @aramaki87, you can export the vault via the tools menu when logged-in. Or use the cli https://github.com/bitwarden/cli
Author
Owner

@BlackDex commented on GitHub (Dec 12, 2020):

I Will close this issue and make a note of this in #246 that we could try and add this feature.

@BlackDex commented on GitHub (Dec 12, 2020): I Will close this issue and make a note of this in #246 that we could try and add this feature.
Author
Owner

@aramaki87 commented on GitHub (Dec 12, 2020):

Thank you for your reply. However...

In order to use the cli I have to create an API key. The API key is entered in the cli to get access. This is not possible at the moment. As I tried to explain in this topic.
No feature request required. Just add the generate key feature again to let people create API keys again to enter them in the cli to get access to the cli features.

@aramaki87 commented on GitHub (Dec 12, 2020): Thank you for your reply. However... In order to use the cli I have to create an API key. The API key is entered in the cli to get access. This is not possible at the moment. As I tried to explain in this topic. No feature request required. Just add the generate key feature again to let people create API keys again to enter them in the cli to get access to the cli features.
Author
Owner

@jjlin commented on GitHub (Dec 12, 2020):

Read the docs at https://bitwarden.com/help/article/cli/#logging-in. The traditional login method is using your email address. API key login is a very new method that requires additional code in bitwarden_rs to generate API keys, which as we explained, is not currently implemented.

@jjlin commented on GitHub (Dec 12, 2020): Read the docs at https://bitwarden.com/help/article/cli/#logging-in. The traditional login method is using your email address. API key login is a very new method that requires additional code in bitwarden_rs to generate API keys, which as we explained, is not currently implemented.
Author
Owner

@svzi commented on GitHub (Dec 6, 2021):

First of all thanks for the great work @dani-garcia and all contributors to this awesome piece of software! 🎉

Quoting from the official Bitwarden CLI docs (https://bitwarden.com/help/article/cli/#log-in):

Logging in with the Personal API Key is recommended for automated workflows or providing access to an external application.

One year has gone by now, without any progress in this regard. The API key method isn't that "very new" anymore and, way more importantly, it's the recommended way to access the CLI for most stuff. Some software doesn't even offer to authenticate the Bitwarden CLI without an API key and that makes it useless with Vaultwarden.

I doubt the developers of that kind of software would welcome the idea to add a login method that is officially deprecated... 😞

Any update on this topic would be greatly appreciated as I wonder if there are any plans to implement the API key generation or is this feature more at the bottom of the todo list?

Best,
Sven

@svzi commented on GitHub (Dec 6, 2021): First of all thanks for the great work @dani-garcia and all contributors to this awesome piece of software! 🎉 Quoting from the official Bitwarden CLI docs (https://bitwarden.com/help/article/cli/#log-in): > Logging in with the Personal API Key is **recommended for automated workflows or providing access to an external application**. One year has gone by now, without any progress in this regard. The API key method isn't that "very new" anymore and, way more importantly, it's the recommended way to access the CLI for most stuff. Some software doesn't even offer to authenticate the Bitwarden CLI without an API key and that makes it useless with Vaultwarden. I doubt the developers of that kind of software would welcome the idea to add a login method that is officially deprecated... 😞 Any update on this topic would be greatly appreciated as I wonder if there are any plans to implement the API key generation or is this feature more at the bottom of the todo list? Best, Sven
Author
Owner

@BlackDex commented on GitHub (Dec 6, 2021):

As i mentioned above already, it is part of this ticket #246.
Until now no major contributor has started to work on it. Though i was tempted a few times, other things came in between.

As for all open items on #246, people are free and encouraged to create a well written PR to help us.

@BlackDex commented on GitHub (Dec 6, 2021): As i mentioned above already, it is part of this ticket #246. Until now no major contributor has started to work on it. Though i was tempted a few times, other things came in between. As for all open items on #246, people are free and encouraged to create a well written PR to help us.
Author
Owner

@svzi commented on GitHub (Dec 6, 2021):

I've already noticed it in #246. Just wanted to get an update on the state which you already provided. So thanks for your feedback. As I've never developed anything with Rust, I wouldn't be able to create a well written PR. Not even nearly. So I hope someone else can and will do this. Until that point I can live without it for sure. Please keep up the good work! 🙏

@svzi commented on GitHub (Dec 6, 2021): I've already noticed it in #246. Just wanted to get an update on the state which you already provided. So thanks for your feedback. As I've never developed anything with Rust, I wouldn't be able to create a well written PR. Not even nearly. So I hope someone else can and will do this. Until that point I can live without it for sure. Please keep up the good work! 🙏
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#879
No description provided.