Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Installed: Unable to fetch installed version #2530

Closed
1 task done
Tracked by #2480
GieltjE opened this issue Jan 1, 2023 · 9 comments · Fixed by #2849
Closed
1 task done
Tracked by #2480

Web Installed: Unable to fetch installed version #2530

GieltjE opened this issue Jan 1, 2023 · 9 comments · Fixed by #2849
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@GieltjE
Copy link

GieltjE commented Jan 1, 2023

Steps To Reproduce

1: install on localhost using docker
2: log into the /admin panel

Expected Result

"Web Installed" displays "Unable to fetch installed version"

Actual Result

"Web Installed" displays a version or if no longer applicable.

Screenshots or Videos

image

Additional Context

No response

Githash Version

455d62e-dirty

Environment Details

  • OS: Win 11 insider
  • Env: Docker
  • Hardware: 3700X 64GB ram

Database Image

Mariadb: 10.10.2

Issue-Link

#2480

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@GieltjE GieltjE added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Jan 1, 2023
@kspearrin
Copy link
Member

Is your localhost instance available under https?

@GieltjE
Copy link
Author

GieltjE commented Jan 6, 2023

No, just a test instance

@kspearrin
Copy link
Member

kspearrin commented Jan 6, 2023

If you look at the developer console, I imagine you will see something about blocking http/s requests from a non-https source.

@GieltjE
Copy link
Author

GieltjE commented Jan 7, 2023

No, http://localhost/admin/home/getinstalledwebversion which responds with http 500 and "Unable to fetch installed version"

@GieltjE
Copy link
Author

GieltjE commented Jan 7, 2023

      => SpanId:c7c9437910026af0, TraceId:db90bc508bd7ec3167e1da8e640f937e, ParentId:0000000000000000 => ConnectionId:0HMNGJHNF5H2U => RequestPath:/admin/home/getinstalledwebversion RequestId:0HMNGJHNF5H2U:00000002 => Bit.Admin.Controllers.HomeController.GetInstalledWebVersion (Admin)
      Error encountered while sending GET request to http://localhost:80/version.json
      System.Net.Http.HttpRequestException: Address not available (localhost:80)
       ---> System.Net.Sockets.SocketException (99): Address not available
         at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
         at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
         --- End of inner exception stack trace ---
         at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
         at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
         at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         at Bit.Admin.Controllers.HomeController.GetInstalledWebVersion(CancellationToken cancellationToken) in /source/src/Admin/Controllers/HomeController.cs:line 73

http://localhost:80/version.json works fine when opened in a browser, it returns: { "version": "2022.12.0" }

@bkirkland13
Copy link

bkirkland13 commented Jan 8, 2023

I am seeing the same issue with docker image bitwarden/self-host, both on eb3e57433c7a and 8cfc531a3011. My admin dashboard looks identical to the screenshot in the original post.

Developer Tools shows this in the network tab:

image

If I open https://mydomain/admin/home/getinstalledwebversion directly, it returns "Unable to fetch installed version", with a 500 status code.

I am seeing the same error in /var/log/bitwarden/admin.log within the container. It is interesting that it's trying to access localhost:80, as the default port is 8080.

I am also able to access version.json, which responds: { "version": "2022.12.0" }

I am using SSL though Caddy as a reverse proxy. Caddy is forwarding to 8080 on the Bitwarden container.

@ghost
Copy link

ghost commented Jan 22, 2023

The problem is that globalSettings__baseServiceUri__internalVault is hard-coded to http://localhost:80 in Dockerfile.
At HomeController.cs requestUri = $"{_globalSettings.BaseServiceUri.InternalVault}/version.json" is used for GetInstalledWebVersion.

Manually setting globalSettings__baseServiceUri__internalVault with the correct port in your settings.env will fix the issue.
Maybe entrypoint.sh can be extended to set the correct port automatically.

@kspearrin
Copy link
Member

Should be fixed in the next version.

@cvondraoti
Copy link

cvondraoti commented May 15, 2024

seeing same issue with added twist on server version: using self-host:beta

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants