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

Safari WebSocket connection: kNWErrorDomainPOSIX error #524

Open
bgins opened this issue Jun 2, 2023 · 3 comments
Open

Safari WebSocket connection: kNWErrorDomainPOSIX error #524

bgins opened this issue Jun 2, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@bgins
Copy link
Member

bgins commented Jun 2, 2023

Summary

Problem

Safari fails to establish a WebSocket connection with peers.

Impact

Data cannot be published or synced without a connected WebSocket.

Solution

Needs investigation.

Detail

Describe the bug

When authenticated and using a web app in macOS Safari, the console reports errors like:

WebSocket connection to 'wss://production-ipfs-cluster-us-east-1-node1.runfission.com:4003/p2p/12D3KooWNntMEXRUa2dNgkQsVgzao6zGSYxm1oAs83YtRy6uBuxv' failed: The operation couldn’t be completed. (kNWErrorDomainPOSIX error 100 - Protocol error)

To Reproduce
Steps to reproduce the behavior:

  1. Open an app in macOS Safari
  2. Open the developer tools to observe the error

Expected behavior

No error should be reported and file system operations that rely on peers should work.

Desktop (please complete the following information):

  • OS: macOS Ventura 13.3.1 (a)
  • Browser: Safari version 16.4 (18615.1.26.110.1)
@bgins bgins added the bug Something isn't working label Jun 2, 2023
@bgins
Copy link
Member Author

bgins commented Jun 2, 2023

@therealjeffg found a report that likely attributes the error to the NSURLSession WebSocket implementation in Safari: https://bugs.webkit.org/show_bug.cgi?id=228296#c18

@avivash and @bgins have confirmed that when NSURLSession Websocket is disabled, the error goes away. This feature can be turned off by unchecking NSURLSession Websocket in Develop -> Experimental Features.

@jeffgca
Copy link
Contributor

jeffgca commented Jun 13, 2023

Pushing this issue to the control pod - it's likely a server side fix

@bgins
Copy link
Member Author

bgins commented Jun 20, 2023

A bit more detail on how we may be able to mitigate this issue. From the thread above: https://bugs.webkit.org/show_bug.cgi?id=228296#c18

I've encountered this issue too with a WebSocket server using HTTP/2 + TLS 1.3. The connection succeeds at first and I'm able to send and receive some (short) WebSocket messages, but then the connection gets disconnected with the aforementioned "kNWErrorDomainPOSIX error 100 - Protocol error" error message. A longer message sent by the server seems to cause the disconnection.

The root issue is likely a Safari bug, but we may be able to work around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants