Closed mamama1 closed 4 years ago
FTR I did bitwarden.sh start and it magically seems to work again. That's not very trustworthy... This fragile contruction is supposed to be my holy grail of passwords...?!?
root@files:/home/bitwarden# ./bitwarden.sh start
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V V / (_| | | | (_| | __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
Open source password management solutions
Copyright 2015-2020, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden
===================================================
Docker version 19.03.12, build 48a66213fe
docker-compose version 1.25.0, build unknown
Stopping bitwarden-nginx ... done
Stopping bitwarden-portal ... done
Stopping bitwarden-admin ... done
Stopping bitwarden-notifications ... done
Stopping bitwarden-web ... done
Stopping bitwarden-api ... done
Stopping bitwarden-sso ... done
Stopping bitwarden-identity ... done
Stopping bitwarden-mssql ... done
Stopping bitwarden-attachments ... done
Stopping bitwarden-icons ... done
Stopping bitwarden-events ... done
Removing bitwarden-nginx ... done
Removing bitwarden-portal ... done
Removing bitwarden-admin ... done
Removing bitwarden-notifications ... done
Removing bitwarden-web ... done
Removing bitwarden-api ... done
Removing bitwarden-sso ... done
Removing bitwarden-identity ... done
Removing bitwarden-mssql ... done
Removing bitwarden-attachments ... done
Removing bitwarden-icons ... done
Removing bitwarden-events ... done
Removing network docker_default
Removing network docker_public
Pulling mssql ... done
Pulling web ... done
Pulling attachments ... done
Pulling api ... done
Pulling identity ... done
Pulling sso ... done
Pulling admin ... done
Pulling portal ... done
Pulling icons ... done
Pulling notifications ... done
Pulling events ... done
Pulling nginx ... done
Creating network "docker_default" with the default driver
Creating network "docker_public" with the default driver
Creating bitwarden-identity ... done
Creating bitwarden-icons ... done
Creating bitwarden-sso ... done
Creating bitwarden-notifications ... done
Creating bitwarden-events ... done
Creating bitwarden-web ... done
Creating bitwarden-mssql ... done
Creating bitwarden-attachments ... done
Creating bitwarden-api ... done
Creating bitwarden-admin ... done
Creating bitwarden-portal ... done
Creating bitwarden-nginx ... done
1.37.0: Pulling from bitwarden/setup
Digest: sha256:d53aa2bc97c9bfdb5609cf9ec7cbee8cfedac536a7b101e039db2e0d733c60e0
Status: Image is up to date for bitwarden/setup:1.37.0
docker.io/bitwarden/setup:1.37.0
Bitwarden is up and running!
===================================================
visit https://pw.ne-mail.net
to update, run `./bitwarden.sh updateself` and then `./bitwarden.sh update`
Can you post the output of: docker logs watchtower
?
Thanks!
Hi,
sure:
root@files:/home/ncadmin# docker logs watchtower
time="2020-08-15T16:50:42Z" level=info msg="Starting Watchtower and scheduling first run: 2020-08-15 17:50:42 +0000 UTC m=+3601.139143957"
time="2020-08-15T16:51:39Z" level=info msg="Waiting for running update to be finished..."
time="2020-08-15T16:52:29Z" level=info msg="Starting Watchtower and scheduling first run: 2020-08-15 17:52:29 +0000 UTC m=+3605.797470197"
time="2020-08-15T20:40:08Z" level=info msg="Waiting for running update to be finished..."
time="2020-08-15T20:40:48Z" level=info msg="Starting Watchtower and scheduling first run: 2020-08-15 21:40:48 +0000 UTC m=+3600.606668103"
time="2020-08-15T21:13:50Z" level=info msg="Waiting for running update to be finished..."
time="2020-08-15T21:14:30Z" level=info msg="Starting Watchtower and scheduling first run: 2020-08-15 22:14:30 +0000 UTC m=+3600.594082839"
time="2020-08-15T21:18:22Z" level=info msg="Waiting for running update to be finished..."
time="2020-08-15T21:19:00Z" level=info msg="Starting Watchtower and scheduling first run: 2020-08-15 22:19:00 +0000 UTC m=+3601.125400803"
time="2020-08-15T22:30:00Z" level=info msg="Waiting for running update to be finished..."
time="2020-08-15T22:30:40Z" level=info msg="Starting Watchtower and scheduling first run: 2020-08-15 23:30:40 +0000 UTC m=+3601.182699474"
time="2020-08-17T17:40:35Z" level=info msg="Waiting for running update to be finished..."
time="2020-08-17T17:41:12Z" level=info msg="Starting Watchtower and scheduling first run: 2020-08-17 18:41:12 +0000 UTC m=+3600.774780731"
time="2020-08-18T14:42:10Z" level=info msg="Unable to update container /bitwarden-api. Proceeding to next."
time="2020-08-18T14:43:02Z" level=info msg="Unable to update container /bitwarden-mssql. Proceeding to next."
time="2020-08-18T14:43:23Z" level=info msg="Unable to update container /bitwarden-notifications. Proceeding to next."
time="2020-08-18T15:41:27Z" level=info msg="Unable to update container /bitwarden-nginx. Proceeding to next."
time="2020-08-18T15:41:27Z" level=info msg="Unable to update container /bitwarden-admin. Proceeding to next."
time="2020-08-30T01:42:28Z" level=info msg="Unable to update container /bitwarden-api. Proceeding to next."
time="2020-08-30T01:43:14Z" level=info msg="Unable to update container /bitwarden-mssql. Proceeding to next."
time="2020-08-30T01:43:58Z" level=info msg="Unable to update container /bitwarden-web. Proceeding to next."
time="2020-08-30T11:41:22Z" level=info msg="Unable to update container /bitwarden-nginx. Proceeding to next."
time="2020-08-30T11:42:26Z" level=info msg="Unable to update container /bitwarden-api. Proceeding to next."
time="2020-08-30T11:42:56Z" level=info msg="Unable to update container /bitwarden-events. Proceeding to next."
time="2020-08-30T11:43:17Z" level=info msg="Unable to update container /bitwarden-mssql. Proceeding to next."
time="2020-08-30T11:43:28Z" level=info msg="Unable to update container /bitwarden-notifications. Proceeding to next."
time="2020-08-30T11:44:04Z" level=info msg="Unable to update container /bitwarden-identity. Proceeding to next."
time="2020-08-30T11:44:31Z" level=info msg="Unable to update container /bitwarden-icons. Proceeding to next."
time="2020-08-30T11:45:18Z" level=info msg="Unable to update container /fts_esror. Proceeding to next."
time="2020-09-05T20:32:40Z" level=info msg="Waiting for running update to be finished..."
time="2020-09-05T20:33:17Z" level=info msg="Starting Watchtower and scheduling first run: 2020-09-05 21:33:17 +0000 UTC m=+3601.127151641"
time="2020-09-11T15:23:27Z" level=info msg="Waiting for running update to be finished..."
time="2020-09-11T17:37:14Z" level=info msg="Starting Watchtower and scheduling first run: 2020-09-11 18:37:14 +0000 UTC m=+3600.622623014"
time="2020-09-11T20:39:41Z" level=info msg="Waiting for running update to be finished..."
time="2020-09-11T22:23:19Z" level=info msg="Starting Watchtower and scheduling first run: 2020-09-11 23:23:19 +0000 UTC m=+3601.050064849"
time="2020-09-14T19:39:52Z" level=info msg="Waiting for running update to be finished..."
time="2020-09-14T19:40:17Z" level=info msg="Starting Watchtower and scheduling first run: 2020-09-14 20:40:17 +0000 UTC m=+3600.818904536"
OK, so probably watchtower is to blame for this. Not sure though as it always worked for me.
I will add a fix which excludes it from updating Bitwarden anyway. Better safe than sorry.
Maybe you could try this?
The original command for starting watchtower is this:
docker run -d --restart=unless-stopped --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower "$CmdDocker"
.
This is the actual code.
I don't want to merge something that is broken and I'm not 100% sure on how to exclude only Bitwarden.
No response yet @mamama1, Keen to help out here? :)
btw @mamama1 have you seen this? https://github.com/nextcloud/vm/blob/9361b3a2970bc19a2141a21b24f4a5b36073ade1/apps/tmbitwarden.sh#L325-L329
@szaimen that's unrelated.
What we need to figure out here is to disable Watchtower for Bitwarden, and allow everything else.
Preferably also disable Bitwarden for current users.
Note to self: https://github.com/containrrr/watchtower/issues/169
We might just run watchtower once when the update script is run:
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--run-once \
collabora onlyoffice fts
Preferably with a check if those dockers are installed.
I'll prepare a PR soon.
While we're at it, maybe we can add notify_admin_gui
as well. :thinking:
docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ --run-once \ collabora onlyoffice fts
Can we add bitwarden_rs to this command, too? https://github.com/nextcloud/vm/blob/9361b3a2970bc19a2141a21b24f4a5b36073ade1/apps/bitwarden-rs.sh#L196
Is Bitwarden RS just one container?
Is Bitwarden RS just one container?
Yes
@szaimen Could you please list the names of all dockers we are using in the VM?
Prepping a PR now.
I think it should be: code, $fts_es_name, onlyoffice, bitwarden_rs
@mamama1 This is now fixed. Please run the update script:
sudo bash /var/scripts/update.sh
Report back if there's still issues.
Hi
sorry for not coming back to you earlier - busy times...
bitwarden seems to be gone for good now. my appliances assumably did the scheduled update on sunday(?).
root@files:/home/bitwarden# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d648be10c8fe ark74/nc_fts "/tini -- /usr/local…" 5 weeks ago Up 16 minutes 127.0.0.1:9200->9200/tcp, 127.0.0.1:9300->9300/tcp fts_esror
root@files:/home/bitwarden# ./bitwarden.sh start
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V V / (_| | | | (_| | __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
Open source password management solutions
Copyright 2015-2020, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden
===================================================
Docker version 19.03.13, build 4484c46d9d
docker-compose version 1.25.0, build unknown
ERROR: 2 matches found based on name: network docker_default is ambiguous
at first the containers were not showing again when i typed docker ps so i did bitwarden.sh start again and then it threw errors at me. then i ran the update script and now I'm where I am.
sql backups are there, under /home/bitwarden/bwdata/mssql/backups.
I got an email from another user with the same issue as you, he ran the update and everything as fine.
Try to remove the network and start with ./bitwarden.sh start
again.
jeez, that was a trip.
bitwarden started when I first docker network rm'd the duplicate networks but then my db was gone/empty. I recall the update script telling me that it had deleted the bitwarden mssql docker volume (yay), so I had to restore it from the last backup file:
docker exec -it bitwarden-mssql /bin/bash
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD}
ALTER DATABASE vault
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
RESTORE DATABASE vault FROM DISK = '/etc/bitwarden/mssql/backups/vault_FULL_20200919_000000.BAK' WITH REPLACE
GO
ALTER DATABASE vault
SET ONLINE
Thanks anyway for your help.
So, if I understood correctly, the regular weekly update script now won't touch bitwarden anymore? How is bitwarden supposed to be updated now to get patches and security fixes? Just by running /home/bitwarden/bitwarden.sh update?
Great that it works again!
So, if I understood correctly, the regular weekly update script now won't touch bitwarden anymore? How is bitwarden supposed to be updated now to get patches and security fixes? Just by running /home/bitwarden/bitwarden.sh update?
Have you seen this? https://github.com/nextcloud/vm/blob/master/nextcloud_update.sh#L536-L569
nope didn't see that. cool bananas, so let's hope bitwarden will survive the next update cycle this time xD thanks!
JESUS! again, my bitwarden containers are gone. wth???
root@files:/home/ncadmin# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d648be10c8fe ark74/nc_fts "/tini -- /usr/local…" 4 months ago Up 7 minutes 127.0.0.1:9200->9200/tcp, 127.0.0.1:9300->9300/tcp fts_esror
@mamama1 Is this after running the latest script? We don't run watchtower automatically anymore, and we don't upgrade bitwarden in the update script.
Though, in old versions that might still be the case.
idk, isn't the script updating itself as well? how do I update the script, if not?
thanks!
What I meant was if you were using the latest Bitwarden script? We did a major refactor some time back.
@enoch85 yeah I understood that but i have to say, i dont know! do you mean bitwarden.sh?
shouldn't it be updated by some mechanism if you make changes which you want to have deployed to users?
-rwxrw-r-- 1 bitwarden bitwarden 3.3K Nov 21 18:18 bitwarden.sh
#!/usr/bin/env bash
set -e
cat << "EOF"
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V V / (_| | | | (_| | __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
EOF
cat << EOF
Open source password management solutions
Copyright 2015-$(date +'%Y'), 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden
===================================================
EOF
docker --version
docker-compose --version
echo ""
# Setup
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPT_NAME=`basename "$0"`
SCRIPT_PATH="$DIR/$SCRIPT_NAME"
OUTPUT="$DIR/bwdata"
if [ $# -eq 2 ]
then
OUTPUT=$2
fi
SCRIPTS_DIR="$OUTPUT/scripts"
GITHUB_BASE_URL="https://raw.githubusercontent.com/bitwarden/server/master"
COREVERSION="1.38.1"
WEBVERSION="2.17.0"
# Functions
function downloadSelf() {
if curl -s -w "http_code %{http_code}" -o $SCRIPT_PATH.1 $GITHUB_BASE_URL/scripts/bitwarden.sh | grep -q "^http_code 20[0-9]"
then
mv $SCRIPT_PATH.1 $SCRIPT_PATH
chmod u+x $SCRIPT_PATH
else
rm -f $SCRIPT_PATH.1
fi
}
function downloadRunFile() {
if [ ! -d "$SCRIPTS_DIR" ]
then
mkdir $SCRIPTS_DIR
fi
curl -s -o $SCRIPTS_DIR/run.sh $GITHUB_BASE_URL/scripts/run.sh
chmod u+x $SCRIPTS_DIR/run.sh
rm -f $SCRIPTS_DIR/install.sh
}
function checkOutputDirExists() {
if [ ! -d "$OUTPUT" ]
then
echo "Cannot find a Bitwarden installation at $OUTPUT."
exit 1
fi
}
function checkOutputDirNotExists() {
if [ -d "$OUTPUT/docker" ]
then
echo "Looks like Bitwarden is already installed at $OUTPUT."
exit 1
fi
}
function listCommands() {
cat << EOT
Available commands:
install
start
restart
stop
update
updatedb
updaterun
updateself
updateconf
renewcert
rebuild
help
See more at https://help.bitwarden.com/article/install-on-premise/#script-commands
EOT
}
# Commands
if [ "$1" == "install" ]
then
checkOutputDirNotExists
mkdir -p $OUTPUT
downloadRunFile
$SCRIPTS_DIR/run.sh install $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "start" -o "$1" == "restart" ]
then
checkOutputDirExists
$SCRIPTS_DIR/run.sh restart $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "update" ]
then
checkOutputDirExists
downloadRunFile
$SCRIPTS_DIR/run.sh update $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "rebuild" ]
then
checkOutputDirExists
$SCRIPTS_DIR/run.sh rebuild $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "updateconf" ]
then
checkOutputDirExists
$SCRIPTS_DIR/run.sh updateconf $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "updatedb" ]
then
checkOutputDirExists
$SCRIPTS_DIR/run.sh updatedb $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "stop" ]
then
checkOutputDirExists
$SCRIPTS_DIR/run.sh stop $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "renewcert" ]
then
checkOutputDirExists
$SCRIPTS_DIR/run.sh renewcert $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "updaterun" ]
then
checkOutputDirExists
downloadRunFile
elif [ "$1" == "updateself" ]
then
downloadSelf && echo "Updated self." && exit
elif [ "$1" == "help" ]
then
listCommands
else
echo "No command found."
echo
listCommands
fi
thanks
shouldn't it be updated by some mechanism if you make changes which you want to have deployed to users?
nooffense #justasking
No offense taken! :+1:
Well, since Bitwarden is very sensitive we decided not to upgrade it automatically in the later versions of the scripts. That would include the update script (which is always the latest one yes).
I actually have no idea why this happens... Sorry! All I can say is that mine have been stable for the past ~1.5 years.
Hi
I have been using my nextcloud VM for some time now and suddenly Bitwarden stopped working (503 Service Unavailable). So I went for checking the docker containers and boom, nothing there. That happened before but back then, a reboot solved it. Now there are no bitwarden containers, even after a reboot of the VM.
not sure, whether the /dev/loop* stuff is supposed to be full according to df -h and whether that has anything to do with bitwarden containers not being there anymore.
The VM has not been altered in any way, please advise how I can get Bitwarden back working.
BTW, /home/bitwarden/bwdata/mssql/data is empty, however /home/bitwarden/bwdata/mssql/backup has files in it: