[SOLVED] Creating with non-root user can't establish connection to the server

If I use the root user as in this docker-compose file:

version: ‘2’
services:
bitwarden:
image: bitwardenrs/server:raspberry
container_name: bitwarden
networks:
- lsio
volumes:
- /home/username/docker/bitwarden/bw-data:/data
ports:
- 8005:80
restart: unless-stopped
networks:
lsio:
external:
name: lsio

The stack successfully deploys and is in good health and I’m able to navigate to :8005 and bitwarden page shows up in the browser. However, I’m unable to create a new account. The submit button is completely non-responsive. Does nothing. Appreciate help on this one also. :slight_smile:

For security reasons as this will be an internet facing server, I want to use a non-root user. I change the docker-compose file to:

version: ‘2’
services:
bitwarden:
image: bitwardenrs/server:raspberry
user: 1001:1001
container_name: bitwarden
networks:
- lsio
volumes:
- /home/username/docker/bitwarden/bw-data:/data
ports:
- 8005:1024
environment:
- ROCKET_PORT=8080
restart: unless-stopped
networks:
lsio:
external:
name: lsio

Again, the stack creating is fine, no errors. The sqllite db and other cert files are being created under bw-data.Container is healthy.

From the logs:

[2020-07-03 19:41:40][bitwarden_rs][INFO] JWT keys don’t exist, checking if OpenSSL is available…
OpenSSL 1.1.1d 10 Sep 2019
[2020-07-03 19:41:40][bitwarden_rs][INFO] OpenSSL detected, creating keys…
Generating RSA private key, 2048 bit long modulus (2 primes)
…+++++
…+++++
e is 65537 (0x010001)
writing RSA key
writing RSA key
[2020-07-03 19:41:40][bitwarden_rs][INFO] Keys created correctly.
Running migration 20180114171611
Running migration 20180217205753
Running migration 20180427155151
Running migration 20180508161616
Running migration 20180525232323
Running migration 20180601112529
Running migration 20180711181453
Running migration 20180827172114
Running migration 20180910111213
Running migration 20180919144557
Running migration 20181127152651
Running migration 20190526216651
Running migration 20191010083032
Running migration 20191117011009
Running migration 20200313205045
Running migration 20200409235005
[2020-07-03 19:41:42][start][INFO] Rocket has launched from http://0.0.0.0:8080

The problem is now I’m unable to connect when I navigate to :8005.
Firefox can’t establish a connection to the server at 192.168.xxx.xx:8005.

You set ROCKET_PORT to 8080, which tells bitwarden_rs to listen on port 8080, but then you told Docker to connect to bitwarden_rs on port 1024. These port values have to match.

For your other issue, first open the browser developer tools (pressing F12 usually works), then try to create a new account and check the network tab for any failed requests.

Thank you! Solved the issue.