Dynalon/Rainy

Sync failure with Tomboy 1.15.4

Closed this issue · 4 comments

twm commented

Ever since I upgraded to Ubuntu 14.04 Tomboy has failed to sync with Rainy (0.5.1). It appears to be failing with a JSON decode error. This is a log of running Tomboy and selecting "Synchronize Notes" from its system tray icon menu:

$ tomboy
[INFO 17:34:48.468] Initializing Mono.Addins
[WARN 17:34:48.566] No GUI 'su' tool found

(Tomboy:5017): GLib-CRITICAL **: Source ID 385 was not found when attempting to remove it

(Tomboy:5017): GLib-CRITICAL **: Source ID 13 was not found when attempting to remove it

(Tomboy:5017): GLib-CRITICAL **: Source ID 47 was not found when attempting to remove it

(Tomboy:5017): GLib-CRITICAL **: Source ID 11 was not found when attempting to remove it

(Tomboy:5017): GLib-CRITICAL **: Source ID 55 was not found when attempting to remove it

(Tomboy:5017): GLib-CRITICAL **: Source ID 409 was not found when attempting to remove it

(Tomboy:5017): GLib-CRITICAL **: Source ID 397 was not found when attempting to remove it
[ERROR 17:35:14.707] Synchronization failed with the following exception: Invalid syntax: Unterminated string, expected '"' termination, got 'e' at [1:2049]
  at Hyena.Json.Tokenizer.InvalidSyntax (System.String message) [0x00000] in <filename unknown>:0 
  at Hyena.Json.Tokenizer.LexString () [0x00000] in <filename unknown>:0 
  at Hyena.Json.Tokenizer.InnerScan () [0x00000] in <filename unknown>:0 
  at Hyena.Json.Tokenizer.Scan () [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.CheckScan (TokenType expected, Boolean eofok) [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.CheckScan (TokenType expected) [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.ParseObject () [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.Parse (Hyena.Json.Token token) [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.ParseArray () [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.ParseObject () [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.Parse (Hyena.Json.Token token) [0x00000] in <filename unknown>:0 
  at Hyena.Json.Deserializer.Deserialize () [0x00000] in <filename unknown>:0 
  at Tomboy.WebSync.Api.UserInfo.ParseJsonNotes (System.String jsonString, System.Nullable`1& latestSyncRevision) [0x00000] in <filename unknown>:0 
  at Tomboy.WebSync.Api.UserInfo.GetNotes (Boolean includeContent, Int32 sinceRevision, System.Nullable`1& latestSyncRevision) [0x00000] in <filename unknown>:0 
  at Tomboy.WebSync.WebSyncServer.GetNoteUpdatesSince (Int32 revision) [0x00000] in <filename unknown>:0 
  at Tomboy.Sync.SyncManager.SynchronizationThread () [0x00000] in <filename unknown>:0 

(Tomboy:5017): GLib-CRITICAL **: g_source_remove: assertion 'tag > 0' failed

Running Rainy with -vvvv doesn't show the JSON-encoded version of my notes so I'm not sure what it's failing on (but does show their complete text, which I don't want to post it here).

This failure is consistent and reproducible. I am also syncing Tomdroid 0.7.5 to Rainy's database without issue.

This looks like a duplicate of #24. This should be fixed in master. Can you reproduce this error using the nightly build or when using the public demo server (runs nightly)?

twm commented

It still fails, but in a different manner:

[ERROR 00:14:10.417] Caught exception. Message: The remote server returned an error: (500) Internal server error: Found encrypted note but using non-encryption backend that can't decrypt..
[ERROR 00:14:10.418] Stack trace for previous exception:   at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0 
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0 
[ERROR 00:14:10.419] Rest of stack trace for above exception:    at System.Environment.get_StackTrace()
   at Tomboy.WebSync.Api.OAuth.MakeWebRequest(RequestMethod method, System.String url, System.Collections.Generic.List`1 parameters, System.String postData)
   at Tomboy.WebSync.Api.OAuth.WebRequest(RequestMethod method, System.String url, System.String postData)
   at Tomboy.WebSync.Api.OAuth.Get(System.String uri, IDictionary`2 queryParameters)
   at Tomboy.WebSync.Api.UserInfo.GetNotes(Boolean includeContent, Int32 sinceRevision, Nullable`1 ByRef latestSyncRevision)
   at Tomboy.WebSync.WebSyncServer.GetNoteUpdatesSince(Int32 revision)
   at Tomboy.Sync.SyncManager.SynchronizationThread()
   at System.Threading.Thread.StartInternal()
[ERROR 00:14:10.419] Synchronization failed with the following exception: The remote server returned an error: (500) Internal server error: Found encrypted note but using non-encryption backend that can't decrypt..
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0 
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0 

As far as I know I don't have any encrypted notes. This is with Rainy nightly a3962b and the same data and settings.conf as before. There is no output in the Rainy console.

@twm ok this is a whole different issue then.

As with the nightlies, encryption can be enabled or disabled in the settings.conf. As you used the settings.conf from version 0.5.x, that field is not present in the settings.conf - so the default behaviour is assumed, which is to disable encryption (the settings.conf that ships with rainy nightly have it enabled explicitly). To fix your issue, add the UseNoteEncryption field to the settings conf or use the updated settings.conf template: https://github.com/Dynalon/Rainy/blob/5e5532dee6d3e031d3f30c4d3c46abb4e2772684/Rainy/settings.conf

(closing this issue, as the original issue is fixed - feel free to open new issue if the encrryption problem persists)

twm commented

When I add UseNoteEncryption: true it works, thanks!