mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #389] Docker: Internal server error when accessing /admin #225
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#225
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Flameborn on GitHub (Feb 9, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/389
Hello,
I am getting a HTTP 500 server error when accessing https://bw.domain.tld/admin, or the custom port on http://localhost:4000/admin via the latest docker image.
The ADMIN_TOKEN environment variable is configured.
My log:
Feb 09 20:26:34 sapphire systemd-docker[9754]: [2019-02-09 20:26:34][rocket::rocket][INFO] GET /admin:
Feb 09 20:26:34 sapphire systemd-docker[9754]: [2019-02-09 20:26:34][][INFO] Matched: GET /<p..> [10] (web_files)
Feb 09 20:26:34 sapphire systemd-docker[9754]: [2019-02-09 20:26:34][][ERROR] Response was a non-
ResponderErr: Os { code: 2, kind: NotFound, message: "Nosuch file or directory" }.
Feb 09 20:26:34 sapphire systemd-docker[9754]: [2019-02-09 20:26:34][][INFO] Outcome: Failure
Feb 09 20:26:34 sapphire systemd-docker[9754]: [2019-02-09 20:26:34][][WARN] Responding with 500 Internal Server Error catcher.
Feb 09 20:26:34 sapphire systemd-docker[9754]: [2019-02-09 20:26:34][_][INFO] Response succeeded.
@dani-garcia commented on GitHub (Feb 10, 2019):
Can you check the logs when you start the server? You should get something like this:
It should be just slightly before the unofficial bitwarden warning.
If you get that in the logs, and the admin panel still gives that error it probably means that the ADMIN_TOKEN couldn't be found.
@Flameborn commented on GitHub (Feb 10, 2019):
After mounting the /api/ endpoints, I see:
Feb 10 14:14:32 sapphire systemd-docker[2731]: [2019-02-10 14:14:32][rocket::rocket][INFO] Mounting /admin:
There are no other admin-related mounts, the next line is an entry about mounting /identity.
@dani-garcia commented on GitHub (Feb 10, 2019):
That means that the admin_token wasn't detected, so the admin routes weren't mounted. Can you double check that you are setting the variable correctly? The docker steps are explained here: https://github.com/dani-garcia/bitwarden_rs/wiki/Enabling-admin-page
@Flameborn commented on GitHub (Feb 10, 2019):
I have a SystemD unit, which uses systemd-docker, the environment variables are set like this:
[Service]
TimeoutStartSec=0
Environment=SIGNUPS_ALLOWED=false ADMIN_TOKEN=RANDOM_STRING ...
The admin token has uppercase and lowercase letters, plus numbers only.
@dani-garcia commented on GitHub (Feb 10, 2019):
Can you check that the SIGNUPS_ALLOWED actually works? Our wiki recommends setting the
EnvironmentFile, but I don't know a lot about systemd to actually now if that makes a difference.You could also try to set both variables in different lines:
[Service]
TimeoutStartSec=0
Environment=SIGNUPS_ALLOWED=false
Environment=ADMIN_TOKEN=RANDOM_STRING
I think there is a possibility that systemd is interpreting everything after the first
=like the value of the first variable.@Flameborn commented on GitHub (Feb 10, 2019):
According to this, the Environment directive allows a list of variable assignments, separated by spaces.
I've modified my unit file to have separate Environment directives, unfortunately, still no go.
systemctl show bitwarden prints a truncated line of environment variables, similarly to the way I had originally defined in the unit file.
@Flameborn commented on GitHub (Feb 10, 2019):
Found the issue.
According to the wiki, the --env directive can be omitted, however, this is only true if the environment variables are specified as arguments to the run command. As this was not the case for me, since I had the directives in the unit file, along with specified -e directives as well, adding --env passed them along, as it is documented [here](https://github.com/ibuildthecloud/systemd-docker]