Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2840

[Realm.Sync.Client.Network] Websocket Connection Fails with 308 Permanent Redirect Error

      How frequently does the bug occur?

      Always

      Description

      I'm encountering an issue with Realm Sync on React Native (react@18.2.0, react-native@0.74.2) using @realm/react@^0.8.0 where the websocket connection fails due to an unexpected HTTP response. The error log indicates that the client expects a "101 Switching Protocols" response but receives a "308 Permanent Redirect" instead. This error is also mentioned in MongoDB Developer community forum: https://www.mongodb.com/community/forums/t/realm-sync-client-network-error/285467

      Please advise on how to resolve this issue or if any additional information is needed.

      Thank you!

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      [Realm.Sync.Client.Network - error] Websocket: Expected HTTP response 101 Switching Protocols, but received:
      HTTP/1.1 308 Permanent Redirect
      cache-control: no-cache, no-store, must-revalidate
      connection: close
      content-length: 0
      date: Thu, 20 Jun 2024 15:22:40 GMT
      location: https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/realm-sync
      server: mdbws
      strict-transport-security: max-age=31536000; includeSubdomains;
      vary: Origin
      x-appservices-request-id: 667449409982441e56baf4e0
      x-frame-options: DENY
      x-xgen-up-proto: HTTP/1.1
      

      Can you reproduce the bug?

      Always

      Reproduction Steps

      1. Attempt to establish a connection using Realm Sync.
      2. Observe the error in the client logs.

      Version

      ^12.11.0

      What services are you using?

      Atlas Device Sync

      Are you using encryption?

      No

      Platform OS and version(s)

      Mac OS Sonoma 14.5 (23F79) with Simulator iPhone 15 Pro

      Cocoapods version

      1.15.2

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: