Closed Bug 618340 Opened 9 years ago Closed 9 years ago

Crypto error on CollectionKeys.updateContents() appears as network problem

Categories

(Firefox :: Sync, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- final+

People

(Reporter: sdwilsh, Assigned: rnewman)

References

Details

Attachments

(1 file)

Whenever I click Sync Now after updating to the latest nightly [], I get an error that says "Sync encountered an error while connecting: Failed to connect to the server. Please try again".

about:sync-log only contains entries from 2010-10-18, which seems wrong and not useful to debug this.  Maybe someone else seeing this will have a more useful log.
blocking2.0: --- → ?
Forgot to put by build id in comment 0: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101210 Firefox/4.0b8pre
Ooof.  I turned on logging (services.sync.log.appender.debugLog.enabled), restarted my browser, and it all magically worked.  I know beltzner was also seeing this, so not going to close this as WORKSFORME just yet...
Smells like a dupe of bug 618290
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 618290
Re-opening for now, since I don't want to assume that it's the same thing as Fennec.

I'm seeing the exact same behaviour that sdwilsh did, and enabling logging and restarting fixed it. So I think the issue is that after I added my phone, I needed to restart my desktop ... which is odd.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
(In reply to comment #5)
> I'm seeing the exact same behaviour that sdwilsh did, and enabling logging and
> restarting fixed it. So I think the issue is that after I added my phone, I
> needed to restart my desktop ... which is odd.
My desktop build wouldn't work even when I hadn't added my phone.

Also, turning off logging, and restarting still lets me connect.
Same issue. Restart fixed it, as far as I can tell. Have not added a device to sync recently.
So, from the log in the Fennec bug, it looks like there was a DNS glitch that made auth.services.mozilla.com unreachable.  NS_ERROR_UNKNOWN_HOST is the error we're getting.

I'm following up with Ops, but is there anyone still encountering this error?  (If someone runs into someone on IRC who has this, please get them in touch with me!)
Attached image screenshot
I just ran into this while trying to reproduce and debug bug 618068. I was messing around in the crypto code and it was producing errors (due to broken debug code). But instead of showing a general error, the notification shown in the bar in the browser indicated network problems.

So perhaps the thing Beltzner and sdwilsh were seeing were in fact crypto problems appearing as network problems.
I can reproduce this reliably now by having WeaveCrypto.decrypt() throw.

I'm changing the scope of this bug to cover only the misrepresentation of the crypto bug as a network problem. There's still a crypto bug somewhere, possibly related to bug 618068. bsmith and I are investigating.
Component: Operations → Firefox Sync: Backend
OS: Windows 7 → All
QA Contact: operations → sync-backend
Hardware: x86 → All
Summary: Sync says it encountered an error while connecting → Crypto error on CollectionKeys.updateContents() appears as network problem
Just about the best fix I can do without generating new strings is:


diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js
index 4e9f0a4..6ae2663 100644
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -764,9 +764,11 @@ WeaveSvc.prototype = {
               Status.login = LOGIN_FAILED_INVALID_PASSPHRASE;
               Status.sync = CREDENTIALS_CHANGED;
             }
-            else
-              // Assume that every other failure is network-related.
-              Status.login = LOGIN_FAILED_NETWORK_ERROR;
+            else {
+              // In the absence of further disambiguation or more precise
+              // failure constants, just report failure.
+              Status.login = LOGIN_FAILED;
+            }
             return false;
           }
         }


This makes the error in this case:


  Sync encountered an error while connecting: Unknown error. Please try again.


We don't have any constants or strings for "there was a problem with your keys", or "our crypto engine reported a failure".

Of course, the earlier parts of that function will do the right thing for server error codes.

Can you think of a better solution, Philipp? I don't know the characteristics of the errors thrown here nearly so well as you do.
Component: Firefox Sync: Backend → Operations
OS: All → Windows 7
Hardware: All → x86
Of course, this exposes our broad definition of "login" to the world -- "isLoggedIn" means "successfully connected to the server, set up a meta record, and updated our local keys".

(There are only two "phases" in the error constants: login and sync.)
(In reply to comment #11)
> Just about the best fix I can do without generating new strings is:

r=me
Per IRC approval, message improvement landed:

http://hg.mozilla.org/services/fx-sync/rev/b7610c2f8703

Will file a new bug to improve error reporting for unusual conditions.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Assignee: nobody → rnewman
Component: Operations → Firefox Sync: Backend
OS: Windows 7 → All
Hardware: x86 → All
blocking2.0: ? → final+
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.