Syncing Mnemosyne Android App with desktop Mnemosyne first works, then fails

819 views
Skip to first unread message

guf...@gmail.com

unread,
Apr 15, 2015, 3:14:48 PM4/15/15
to mnemosyne-...@googlegroups.com
Hi Peter, hi everyone,

Thank you very much for developing Mnemosyne! I've been a daily user for 3.5 months, and within that time, Mnemosyne let me learn 350+ new words in Hebrew which changed my daily life as an expat in Israel for the better!

I took a 10-day holiday recently without laptop and wanted to continue practicing during that time. So I installed the new Mnemosyne Android app and synced my phone to the laptop. To test, I tried learning a few words on the phone and syncing it back to the laptop a couple of times. Everything worked smoothly.

But returning 10 days later, I can't sync my phone back with the laptop anymore. The laptop is running Mnemosyne 2.3.2 (downloaded and compiled on Apr 1st 2015). The phone is running the Android Mnemosyne app 1.0.1, downloaded from Google Play on Apr 1st 2015.

Here's how to trigger the problem:
. Start Mnemosyne on the laptop. Settings says the sync server is running on 10.0.0.3 port 8512.
. From the phone, I can successfully ping the laptop.
. Start Mnemosyne on the phone and start syncing
. Phone says 'Logging in...'
. Using netstat on the laptop, I see an ESTABLISHED TCP connection between the phone and the laptop on port 8512.
. After a minute or so, the phone says 'Could not connect to server!'. Netstat reports that the TCP connection is now CLOSE_WAIT.
. At that point, opening Mnemosyne's settings on the laptop freezes mnemosyne. It needs to be stopped with a kill.

To circumvent the issue, I attempted starting the sync server on the laptop without GUI:
$ mnemosyne --sync-server
Sync server listening on 10.0.0.3:8512

and then started the sync on the phone, which produced the message 'Logging in: server error' on the phone and the following error on the laptop:

Traceback (innermost last):
File "build/bdist.linux-x86_64/egg/openSM2sync/server.py", line 333, in put_login
session = self.create_session(client_info)
File "build/bdist.linux-x86_64/egg/openSM2sync/server.py", line 186, in create_session
database = self.load_database(client_info["database_name"])
File "build/bdist.linux-x86_64/egg/mnemosyne/libmnemosyne/sync_server.py", line 49, in load_database
self.database().load(database_name)
File "build/bdist.linux-x86_64/egg/mnemosyne/libmnemosyne/databases/SQLite.py", line 361, in load
raise RuntimeError, _("Unable to load file, query failed.")
RuntimeError: Unable to load file, query failed.


Starting the server by explicitly specifying the cards DB
$ mnemosyne --sync-server ~/.local/share/mnemosyne/cards.db
yielded the same error message.

Upgrading to Mnemosyne 2.3.3 on the laptop does not change the above. Logging errors with the --debug-file parameter yields an empty file.

Any idea what could cause the problem? I'm especially at loss to explain this, since I tested sync after learning a dozen of words on the phone prior to leaving for holiday, and it just worked.

Thanks again for the great work on this, and looking forward to hearing your thoughts!

Yours, Jean

Jean Hausser

unread,
Apr 15, 2015, 3:23:41 PM4/15/15
to mnemosyne-...@googlegroups.com
Here is the content of the .local/share/mnemosyne directory of the laptop, which includes the cards database (cards.db).
laptopMnemosyne.tar.gz

Peter Bienstman

unread,
Apr 16, 2015, 3:26:06 AM4/16/15
to mnemosyne-...@googlegroups.com
Hi,

I'm assuming you're not doing anything with the default.db database? I suggest copying the recent cards.db from your phone to your laptop's default.db and make sure it works there. Then, delete /sdcard/Mnemosyne on your phone, and sync again from scratch to see if that helps.

Cheers,

Peter
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/ba195def-
> 5d39-4559-af77-5682ee0eaefe%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jean Hausser

unread,
Apr 16, 2015, 4:04:15 PM4/16/15
to mnemosyne-...@googlegroups.com
Hi Peter,

Copying the cards.db from the phone to the laptop's default.db successfully recovered the learning state I had reached with the phone.
I haven't tried the second part of your suggestion, i.e. removing /mnemosyne from the phone because I have no usage from it anymore for now, being back at home with the laptop again. But let me know if it'd help you in some way, I'd be happy to try it and report on what happens then.

So many thanks for the tip and the rapid answer: you just saved me two weeks of re-catching up (300+ words!).

Yours, Jean

Peter Bienstman

unread,
Apr 17, 2015, 3:29:28 AM4/17/15
to mnemosyne-...@googlegroups.com
Hi,

Well, if it turns out there's still a bug that wasn't fixed, I'm always interested to figure this out :-)

Cheers,

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Jean Hausser
> Sent: 16 April 2015 22:04
> To: mnemosyne-...@googlegroups.com
> Subject: Re: [mnemosyne-proj-users] Syncing Mnemosyne Android App
> with desktop Mnemosyne first works, then fails
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/8c85b82f-8a90-
> 4bac-be3e-3a358e85351a%40googlegroups.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/8c85b82f-
> 8a90-4bac-be3e-
> 3a358e85351a%40googlegroups.com?utm_medium=email&utm_source=foo
> ter> .

Jean Hausser

unread,
Apr 17, 2015, 3:58:17 AM4/17/15
to mnemosyne-...@googlegroups.com
Hi Peter,

Sure, so I removed the /mnemosyne directory on the phone, and synced to the laptop. That worked.
Then I did today's 36 repetitions on the phone. In the end, I synced with the laptop again. That worked too.

So I'm not sure what the problem was in the end: I did just that before leaving for holiday (learning some words on the phone and verify that syncing back with the laptop works) and it wasn't an issue then. The problem only arose after doing the repetitions on the phone for 2 weeks and then syncing again...
Could it be something related to the database? (it used to be cards.db on the laptop, but following your suggestion, the db is now called default.db on the laptop)

Anyway, the problem is solved for now as far as I'm concerned. Next time I run into the issue, I'll make a snapshot of the mnemosyne directories both on the laptop and on the phone, that way we can maybe find the bug.

Thanks again for your help! Jean

Peter Bienstman

unread,
Apr 17, 2015, 4:00:19 AM4/17/15
to mnemosyne-...@googlegroups.com
Thanks for the feedback!

It could have been a temporary glitch in the system (perhaps your homedir is mounted on a network drive which was offline a bit?), but I'm glad it works now. Let me know if it reappears.

Cheers,

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Jean Hausser
> Sent: 17 April 2015 09:58
> To: mnemosyne-...@googlegroups.com
> Subject: Re: [mnemosyne-proj-users] Syncing Mnemosyne Android App
> with desktop Mnemosyne first works, then fails
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/645edba7-
> 3dc3-4004-a27b-1bdc1da0e233%40googlegroups.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/645edba7-
> 3dc3-4004-a27b-
> 1bdc1da0e233%40googlegroups.com?utm_medium=email&utm_source=foo
Reply all
Reply to author
Forward
0 new messages