xbrowsersync / app

xBrowserSync browser extensions / mobile app
GNU General Public License v3.0
1.46k stars 97 forks source link

Can't sync - Connection to service lost #180

Closed fbsd44 closed 4 years ago

fbsd44 commented 4 years ago

Describe the issue you are experiencing Synced first computer to service. When I attempt to connect second computer, I get an error that the connection to the service is lost. The logs the notwork is offline, but the network is fine. (the first computer is using the same network)

How can the issue be reproduced? Steps to reproduce the behavior:

  1. Click on XBrowserSync icon
  2. Enter sync ID and password and click on sync
  3. Agree to delete all local bookmarks
  4. See error.

Desktop browser Please complete the following information for all affected desktop browsers:

Download the Application log from the Settings panel and paste the contents here.


2020-04-27 02:37:29.210 [trace] Installed v1.5.2
2020-04-27 02:37:29.226 [trace] Starting up
2020-04-27 02:37:29.259 [trace] {"checkForAppUpdates":true,"displayHelp":true,"displayPermissions":true,"syncBookmarksToolbar":true,"appVersion":"1.5.2","platform":{"name":"chrome","version":"81.0.4044","mobile":false,"os":"FreeBSD amd64"}}
2020-04-27 02:37:36.523 [warn]  API request failed: network offline
2020-04-27 02:37:44.993 [trace] Optional permissions not granted
2020-04-27 02:37:49.345 [warn]  API request failed: network offline
2020-04-27 02:38:32.443 [warn]  API request failed: network offline
2020-04-27 02:38:32.562 [warn]  API request failed: network offline
2020-04-27 02:38:51.754 [warn]  API request failed: network offline
2020-04-27 02:38:51.843 [warn]  API request failed: network offline
2020-04-27 02:39:10.362 [warn]  API request failed: network offline
2020-04-27 02:39:10.480 [warn]  API request failed: network offline
2020-04-27 02:39:20.562 [warn]  API request failed: network offline
2020-04-27 02:39:52.619 [warn]  API request failed: network offline
2020-04-27 02:39:52.756 [warn]  API request failed: network offline
2020-04-27 02:39:57.417 [warn]  API request failed: network offline
nero120 commented 4 years ago

@fbsd44 since I don't have easy access to a freebsd box I need more info to figure out what's going on here, can you do the following please:

  1. Browse to chrome://extensions
  2. Toggle the "Developer mode" switch to enabled
  3. Under xBrowserSync in the list of extensions, click on background.html where it says "Inspect views"
  4. The console tab should be visible in the DevTools window, clear the current entries (Ctrl+L), then open the xBrowserSync extension and attempt to sync
  5. Paste the contents of the console in this thread

Also, you need to do the same for the extension window itself (it has a different console context to the background page):

  1. Open the xBrowserSync extension, right click anywhere in the extension window and click on "Inspect"
  2. Select the console tab in DevTools, then attempt to sync
  3. Paste the contents of the console in this thread

Finally, could you please run the following commands in the console and paste the output here, it would help me:

JSON.stringify(window.navigator.connection)
JSON.stringify(window.navigator.onLine)

Thanks!

fbsd44 commented 4 years ago

There was no console output when I clicked on background.html and attempted to sync. When I inspected the extension window, I got this: DevTools failed to load SourceMap: Could not load content for chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/purify.min.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME app.min.js:1494 API request failed: network offline logToConsole @ app.min.js:1494 logWarning @ app.min.js:1506 (anonymous) @ app.min.js:1947 q @ app.min.js:142 checkNetworkIsOnline @ app.min.js:1943 checkServiceStatus @ app.min.js:1789 startSyncing @ app.min.js:5977 (anonymous) @ app.min.js:267 e @ app.min.js:198 $eval @ app.min.js:154 $apply @ app.min.js:154 (anonymous) @ app.min.js:198 sg @ app.min.js:40 d @ app.min.js:40

The JSON output: JSON.stringify(window.navigator.connection) "{}" JSON.stringify(window.navigator.onLine) "false" Since it is calling java, thought this might help: java -version openjdk version "1.8.0_242" OpenJDK Runtime Environment (build 1.8.0_242-b07) OpenJDK 64-Bit Server VM (build 25.242-b07, mixed mode)

Are there any particular services that are called? (e.g. dbus)

Thank you. I very much appreciate your time!

nero120 commented 4 years ago
JSON.stringify(window.navigator.connection)
"{}"
JSON.stringify(window.navigator.onLine)
"false"

Well that's the issue, the browser is reporting that no network is connected (window.navigator.onLine = false). From MDN Web Docs:

In Chrome and Safari, if the browser is not able to connect to a local area network (LAN) or a router, it is offline; all other conditions return true.

I know it's a stupid question, but you are connected to the internet aren't you? If so then this is something particular to the freebsd build of chromium, and sadly nothing I can do to affect.

I'm going to close this, but if you'd like to pursue it further you could try asking about it with someone on the FreeBSD/Chromium Team.

nsiti commented 3 years ago

Hi, I'm having a similar issue on one of my computers running Windows 10 (all have the same setup).

Browser ungoogled Chromium: Version 91.0.4472.77 (Official Build, ungoogled-chromium) (64-bit)

Extension background console tab output:

background.min.js:2007 Error: [10001] HttpRequestFailed at background.min.js:2389 at background.min.js:140 at m.$digest (background.min.js:151) at m.$apply (background.min.js:155) at k (background.min.js:106) at v (background.min.js:111) at XMLHttpRequest.y.onerror (background.min.js:112) logToConsole @ background.min.js:2007 background.min.js:2021 Connection to API failed, retrying check for sync updates momentarily api.xbrowsersync.org/bookmarks/08f85384f4db4cd8b7077e78a873cbaa/lastUpdated:1 Failed to load resource: net::ERR_TOO_MANY_REDIRECTS background.min.js:2007 Error: [10001] HttpRequestFailed at background.min.js:2389 at background.min.js:140 at m.$digest (background.min.js:151) at m.$apply (background.min.js:155) at k (background.min.js:106) at v (background.min.js:111) at XMLHttpRequest.y.onerror (background.min.js:112) logToConsole @ background.min.js:2007 api.xbrowsersync.org/bookmarks/08f85384f4db4cd8b7077e78a873cbaa/lastUpdated:1 Failed to load resource: net::ERR_TOO_MANY_REDIRECTS DevTools failed to load source map: Could not load content for chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/browser-detect.umd.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

Extension window console tab output:

DevTools failed to load source map: Could not load content for chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/purify.min.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

Console commands: JSON.stringify(window.navigator.connection) "{}"

JSON.stringify(window.navigator.onLine) "true"

Any help would be appreciated, thank you.

nero120 commented 3 years ago

@nsiti can you upload your app log please?

nsiti commented 3 years ago

Here is the log file

xbs_log_20210602091255.txt

nero120 commented 3 years ago

@nsiti from your log it appears you installed the extension, managed to sync to your existing Sync ID and then after that all attempts to sync failed due to network errors. Can you try on standard Google Chrome and see if you can replicate the issue?

nsiti commented 3 years ago

Hi, and thanks for your reply. Syncing works fine with standard Google Chrome.

I was however mistaken when I said that my other computers, with the same setup, are syncing fine. I have two computers in my office environment and neither are syncing. I'll check my home computer when I get home, to see if it's syncing.

As you mentioned, I confirm that local changes are propagating to xbrowsersync, but those changes are not being synced. I don't have any issues with the network, but it's a possibility to investigate. Alternatively, it could be some incompatibility with degoogled chromium.

I'm using the following browser: https://github.com/macchrome/winchrome/ which is being updated via: https://github.com/iklevente/ChromiumForWindows

nero120 commented 3 years ago

Alternatively, it could be some incompatibility with degoogled chromium.

That was my initial suspicion, since all the errors in your log were network errors rather than code errors. If I get some time I'll install that browser and try it myself.

You could also try installing the latest pre-release and see if this version works (just don't sync to your existing sync id, create a new one for testing).

nsiti commented 3 years ago

Hi, the pre-release is syncing (no errors in the log and no warning flag from the app in windows). How would you recommend I proceed from here? Install the pre-release extension across all my devices and update manually until there is a full release? Thanks again.

nero120 commented 3 years ago

@nsiti that's great news! Ok first make sure you have a back up of your sync data using v1.5.2 just to be safe, then install the pre-release across your devices. Once v1.6.0 is released (should be very soon, into final testing now after forever!) you can re-install v1.6.0 over those pre-releases and re-sync to your data which should work as normal at that point.

nsiti commented 3 years ago

Will do. Thanks for your assistance, much appreciated.