Closed Bug 1651625 Opened 5 years ago Closed 5 years ago

Websocket fails to connect to a Blazor server with Windows auth if Dev Tools is open

Categories

(Core :: Networking: WebSockets, defect, P2)

79 Branch
x86_64
Windows 10
defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: jani.lusikka, Assigned: bomsy)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

  • Install .NET Core:

dotnet --version
3.1.301

  • Create a new Blazor application:

dotnet new blazorserver --auth Windows

  • Run the "IIS Express" launch profile from Visual Studio 2019
  • Open the page in Firefox, it works fine (try eg. navigation)
  • Open Developer Tools
  • Refresh the page

Actual results:

Firefox fails to connect the websocket and thus for example navigation won't work

Expected results:

Firefox should connect the websocket and thus for example navigation should work

Additional details:

  • Closing dev tools fixes the issue and everything works again
  • The last parameter seems to be the difference between a failing and successful connection:
Success:
2020-07-09 08:50:53.180000 UTC - [Parent 9500: Main Thread]: D/nsWebSocket WebSocketChannel::OnStopRequest() 000001F91297E000 [000001F913959040 000001F913959040 0]
Fail:
2020-07-09 08:51:04.865000 UTC - [Parent 9500: Main Thread]: D/nsWebSocket WebSocketChannel::OnStopRequest() 000001F90C768000 [000001F90E65B040 000001F90E65B040 80570021]
  • Probably related to the new websocket debugger?
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64

Also, this seems to be a problem with specifically localhost. TLS won't matter. I cannot reproduce this with a proper remote like https://blazor-demo.github.io/Counter.

Err, https://blazor-demo.github.io/Counter is using Blazor WebAssembly App, not Blazor Server App.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Networking: WebSockets
Product: Firefox → Core

Nhi, can you find someone to take a look?

Flags: needinfo?(nhnguyen)

Michal, was there something with devtools and websocket recently? Or was it about a patch that is backed out?

Flags: needinfo?(michal.novotny)
Flags: needinfo?(nhnguyen)

(In reply to Dragana Damjanovic [:dragana] from comment #6)

Michal, was there something with devtools and websocket recently? Or was it about a patch that is backed out?

You probably mean bug 1621345, but it was backed out. Also if the bug would be involved, the behavior would be probably the same with devtools opened and closed. Unfortunately, I don't have Windows host, so I cannot follow STR from the description of the bug.

Honza, can you please find somebody from your team to have a look at this problem?

Jani, could you please attach full log? "timestamp,rotate:200,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5,nsWebSocket:5"

Flags: needinfo?(odvarko)
Flags: needinfo?(michal.novotny)
Flags: needinfo?(jani.lusikka)

Here's a log without Developer Tools open

Here's a log with Developer Tools open exhibiting the bug.

Flags: needinfo?(jani.lusikka)

The attached issue-1651625-fail.txt-main.3484.moz_log seems a little different from what I previously captured. It also failed a little differently:

  • Previously the page would load, but icons were broken and I couldn't navigate anywhere
  • With this log, the page didn't event load, but a white page was displayed.

This issue-1651625-fail2.txt-main.35068.moz_log attachment fails first with displaying the page. The difference between these two logs is that in the first one I had to manually type my credentials and in the second one I configured integrated Windows Authentication for the Firefox profile.

Oh, and fail2.txt used http and fail.txt https. Both seem to fail, anyway.

I did some bisecting. To me the problem seems to be this commit:
https://phabricator.services.mozilla.com/D79137

Autoland 615cd7d5434a6a4e6c325a3a07ceb437a6dbf8bf was BAD whereas a744ed2bcb3d484b3b32ad77a9d9883c206bfca4 was GOOD.

Bringing up browser console, there is a lot of messages like this:

08:50:18.547 TypeError: this.weakMap.get(...) is undefined channel-map.js:57:38
    getChannelById resource://devtools/server/actors/network-monitor/utils/channel-map.js:57
    _findOpenResponse resource://devtools/server/actors/network-monitor/network-response-listener.js:413
    onStopRequest resource://devtools/server/actors/network-monitor/network-response-listener.js:377

@bomsy: see the comment #12, this looks like related to the new "ChannelMap" introduced recently

Honza

Flags: needinfo?(odvarko) → needinfo?(hmanilla)
Assignee: nobody → hmanilla
Flags: needinfo?(hmanilla)
Severity: -- → S3
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2
Pushed by hmanilla@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ad6c0b1c8cfe Avoid error when weakmap does not contain any info for the channel r=Honza
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80

Jani,
Does this fix your issue? Would you be able to test on the latest nightly?

Thanks

Flags: needinfo?(jani.lusikka)

Hmm, interesting enough, I couldn't reproduce this anymore on my daily driver 79.0b9. Digging for the fix, it seems this commit has fixed my issue:
https://phabricator.services.mozilla.com/D83010

In other words, I cannot fully verify the fix, but at least the problem has gone away.

Flags: needinfo?(jani.lusikka)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: