[SOLVED] No access to admin panel - apache reverse proxy - self hosted

[SOLUTION]

i did

./bitwarden.sh stop

docker image ls

docker image rm id-for-admin id-for-mssql

./bitwarden.sh updateself

./bitwarden.sh update

now i can access the page, let’s see how this goes.

[SOLUTION]

Hi,

i’ve read through the community and seems my problem is not solvable with the hints i’ve found here.

Problem is, i can’t access the admin panel, i always get 502 Bad Gateway . It also doesn’t work if i use my.site/admin/login.

Bitwarden itself works as expected, i’m also able to enter any other link from nginx.conf (notifications/icons/events and so on) and get a blank page.

/api/version gives me a proper result.

I also do see in docker ps:

bitwarden/admin:1.41.5 “/entrypoint.sh” About an hour ago Restarting (139) 5 seconds ago

…seems it’s stuck in a loop.

I used the bitwarden.sh script to install.

Here is my proxy conf:

ServerName my.site ServerAdmin [email protected]
    ProxyPass "/" "http://127.0.0.1:8080/"
    ProxyPassReverse "/" "http://127.0.0.1:8080/"

    ErrorLog ${APACHE_LOG_DIR}/bitwarden_error.log
    CustomLog ${APACHE_LOG_DIR}/bitwarden_access.log combined

SSLCertificateFile /etc/letsencrypt/live/my.site/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my.site/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf

on port 80 i have a redirect like this:

RewriteEngine on
RewriteCond %{SERVER_NAME} =my.site
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

my config.yml (only relevant snippets):

url: https://my.site
http_port: 8080
https_port: 8443
ssl: false
ssl_managed_lets_encrypt: false

my global_overrides.en (snippet):

globalSettings__baseServiceUri__vault=https://my.site
[email protected]

and what i get in the logs under ./bwdata/logs

nginx:

2021/08/02 18:38:03 [error] 47#47: *149 connect() failed (111: Connection refused) while connecting to upstream, client: 172.21.0.1, server: my.site, request: “GET /admin/login/ HTTP/1.1”, upstream: “http://172.21.0.9:5000/admin/login/”, host: “127.0.0.1:8080”
2021/08/02 19:13:33 [error] 51#51: *129 connect() failed (113: No route to host) while connecting to upstream, client: 172.21.0.1, server: my.site, request: “GET /admin/ HTTP/1.1”, upstream: “httx://172.21.0.4:5000/admin/”, host: “127.0.0.1:8080”

(i replaced second http with httx as i’m only allowed to post 2 links in my first post)

Edit, seems not to be related to the problem at all:

Summary

admin:

2021-08-02 18:41:09.050 +00:00 [Information] Migrating database.
2021-08-02 18:41:38.616 +00:00 [Error] Database failed to migrate.
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnectionTds…ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Bit.Migrator.DbMigrator.MigrateMsSqlDatabase(Boolean enableLogging, CancellationToken cancellationToken) in /home/runner/work/server/server/util/Migrator/DbMigrator.cs:line 41
at Bit.Admin.HostedServices.DatabaseMigrationHostedService.StartAsync(CancellationToken cancellationToken) in /home/runner/work/server/server/src/Admin/HostedServices/DatabaseMigrationHostedService.cs:line 40
ClientConnectionId:00000000-0000-0000-0000-000000000000

Does anybody see the error i may have there?

Thanks for helping me :slight_smile:

Cheers elemay.