Bug report

64 views
Skip to first unread message

David Bailey

unread,
Sep 28, 2015, 5:10:18 PM9/28/15
to mnemosyne-proj-users
Hi, just posting here with a detailed version of the bug report that I gave on the app review.

The bug occurs when I add new cards and learn them from the desktop app, then sync from the Android app. Might be worth noting that I usually don't have any unreviewed cards before adding new cards.

When I try to sync first, it'll give an error saying that the sync failed on both the phone and computer. Once this is dismissed and I sync again, the app asks if I'd like to fetch the remote version (i.e. computer copy) or cancel the sync. After refetching the whole database/media, the sync successfully completes.

I've attached screenshots from the app of the error occurring. At the end of the Python traceback, there was a UnicodeEncodeError -- I'm studying Japanese flashcards, not sure if this is part of the cause of the error.

Also, I have a feeling that if I added new words on the desktop app, then synced before learning them, learnt them on the computer and synced again, then the error wouldn't occur. (i.e. same but sync before learning cards)

Desktop app information (output of pacman -Qi mnemosyne) -- I installed from the Arch User Repository:

Name           : mnemosyne
Version        : 2.3.3-1
Description    : A flash-card tool with a sophisticated card review algorithm
Architecture   : x86_64
URL            : http://www.mnemosyne-proj.org
Licences       : GPL
Groups         : None
Provides       : None
Depends On     : python2-pyqt4  python2-matplotlib  python2-cherrypy
                 python2-webob
Optional Deps  : texlive-core: support for mathematical formulae in cards
Required By    : None
Optional For   : None
Conflicts With : mnemosyne-bzr
Replaces       : None
Installed Size :   3.52 MiB
Packager       : David Bailey <david....@archlinux.net>
Build Date     : Tue 25 Aug 2015 11:01:39 BST
Install Date   : Tue 25 Aug 2015 11:01:52 BST
Install Reason : Explicitly installed
Install Script : Yes
Validated By   : None

Android app information (screenshot from Solid Explorer's application manager):



Hope this can help you to fix the problem!
David
Screenshot_2015-09-28-19-19-32.png
Screenshot_2015-09-28-19-19-51.png
Screenshot_2015-09-28-19-19-55.png
Screenshot_2015-09-28-19-19-58.png
Screenshot_2015-09-28-19-20-18.png
Screenshot_2015-09-28-19-20-34.png

Peter Bienstman

unread,
Sep 29, 2015, 2:08:55 PM9/29/15
to mnemosyne-...@googlegroups.com

Hi,

 

Please delete /sdcard/Mnemosyne on your phone, and then upgrade both the client and the server to 2.3.4 RC1:

 

https://groups.google.com/forum/#!topic/mnemosyne-proj-users/9DP5Lj6zPE4

 

Also make sure that during the sync you stay in Wifi coverage.

 

Let me know if the problem still occurs, and if it e.g. also occurs on a dummy sync, i.e. pressing sync even though there are no changes to sync.

 

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-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/e19d2913-cf92-415c-9f39-0e341773b0b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Bailey

unread,
Oct 8, 2015, 3:12:27 AM10/8/15
to mnemosyne-proj-users
Sorry for the late response, I thought I had email notifications turned on but apparently not.

Anyway, with version 2.3.4 this problem is fixed (thanks!). However, now I've encountered a new, unrelated bug with the desktop client only -- audio won't play. When the name of the audio file is ascii-only (e.g. hola.mp3), the audio just fails to play but with no error shown. However, with utf-8 file names an error is shown:

Traceback (innermost last):

File "/usr/lib/python2.7/site-packages/mnemosyne/pyqt_ui/add_cards_dlg.py", line 155, in preview

dlg = PreviewCardsDlg(self.component_manager, cards, tag_text, self)

File "/usr/lib/python2.7/site-packages/mnemosyne/pyqt_ui/preview_cards_dlg.py", line 44, in __init__

self.update_dialog()

File "/usr/lib/python2.7/site-packages/mnemosyne/pyqt_ui/preview_cards_dlg.py", line 74, in update_dialog

self.set_answer(card.answer())

File "/usr/lib/python2.7/site-packages/mnemosyne/libmnemosyne/card.py", line 96, in answer

(self, render_chain, **render_args)

File "/usr/lib/python2.7/site-packages/mnemosyne/libmnemosyne/card_type.py", line 75, in render_answer

render_answer(card, **render_args)

File "/usr/lib/python2.7/site-packages/mnemosyne/libmnemosyne/render_chain.py", line 142, in render_answer

return self._render(card, fact_keys, decorators, **render_args)

File "/usr/lib/python2.7/site-packages/mnemosyne/libmnemosyne/render_chain.py", line 153, in _render

card, fact_key, **render_args)

File "/usr/lib/python2.7/site-packages/mnemosyne/pyqt_ui/mplayer_audio.py", line 48, in run

copy(sound_file.replace("file:///", ""), new_name)

File "/usr/lib/python2.7/site-packages/mnemosyne/libmnemosyne/utils.py", line 85, in copy

copyfile(src, dst)

File "/usr/lib/python2.7/site-packages/mnemosyne/libmnemosyne/utils.py", line 61, in copyfile

fsrc = open(src, 'rb')

IOError: [Errno 2] No such file or directory: u'home/david/.local/share/mnemosyne/default.db_media/\u8003\u3048\u308b.mp3'


Don't know why the error dialog only appears when the filename contains utf-8 characters. Anyway I think the problem is simply a missing slash -- i.e. u'home/david/.local/share/mnemosyne/default.db_media/\u8003\u3048\u308b.mp3' should be u'/home/david/.local/share/mnemosyne/default.db_media/\u8003\u3048\u308b.mp3'. I tested this calling open() in a python2 shell (without attempting to play the files) and it seemed to work, but without the leading slash it gave an error like this.


I don't have any cards with another type of media (e.g. images) but I suspect that these won't work on the desktop client either (unless the code handling audio is significantly different to the code handling images). The problem doesn't apply to the Android app, which still plays audio fine.

To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-users+unsub...@googlegroups.com.

Peter Bienstman

unread,
Oct 8, 2015, 10:41:38 AM10/8/15
to mnemosyne-...@googlegroups.com

Peter Bienstman

unread,
Oct 8, 2015, 11:21:10 AM10/8/15
to mnemosyne-...@googlegroups.com

Hi,

 

Also have a look at the info and patch suggestion I posted here:

 

https://groups.google.com/forum/#!topic/mnemosyne-proj-devel/2V00PMCQKXo

 

Cheers,

 

Peter

David Bailey

unread,
Oct 8, 2015, 12:48:02 PM10/8/15
to mnemosyne-proj-users
Hello again,

First thing, I tried adding an image card before patching; with and without unicode, there were no errors and the image was displayed properly.

Secondly, the patch fixed the error but I'm still not getting any sound -- mplayer is (and already was) installed and in my path. I tested mplayer from the command line and there were no problems, so something's wrong with the Python library you're using or Mnemosyne's own code.

BTW to fix the unicode audio bug you can probably just change "file:///" to "file://" in the replace function call, instead of commenting out the whole block of code. The problem was that the leading slash was missing, after all!

Also, I found yet another bug where Mnemosyne crashes after running 'compact' from the menu. Command line output:

QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::installEventFilter(): Cannot filter events for objects in a different thread.
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
  Major opcode: 1 (X_CreateWindow)
  Resource id:  0x260002f
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
  Extension:    139 (RENDER)
  Minor opcode: 4 (RenderCreatePicture)
  Resource id:  0x2600030
python2: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.

Peter Bienstman

unread,
Oct 9, 2015, 7:20:57 AM10/9/15
to mnemosyne-...@googlegroups.com

Hi,

 

If you replace review_wdgt.py with the attached file, it will print out the command it uses to start mplayer, which would be useful debug information.

 

Meanwhile, I will also try to get access to a linux machine, so that I can more easily debug this.

 

As for commenting out the whole block, it’s possible that we no longer need it, so deleting everything  would be a better option.

 

I will also look into the compacting bug.

 

Cheers,

 

Peter

 

From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-...@googlegroups.com] On Behalf Of David Bailey


Sent: 08 October 2015 18:48
To: mnemosyne-proj-users <mnemosyne-...@googlegroups.com>

Subject: [mnemosyne-proj-users] Re: Bug report

 

Hello again,

 

First thing, I tried adding an image card before patching; with and without unicode, there were no errors and the image was displayed properly.

 

Secondly, the patch fixed the error but I'm still not getting any sound -- mplayer is (and already was) installed and in my path. I tested mplayer from the command line and there were no problems, so something's wrong with the Python library you're using or Mnemosyne's own code.

 

BTW to fix the unicode audio bug you can probably just change "file:///" to "file://" in the replace function call, instead of commenting out the whole block of code. The problem was that the leading slash was missing, after all!

 

Also, I found yet another bug where Mnemosyne crashes after running 'compact' from the menu. Command line output:

 

QObject::setParent: Cannot set parent, new parent is in a different thread

QObject::installEventFilter(): Cannot filter events for objects in a different thread.

X Error: BadIDChoice (invalid resource ID chosen for this connection) 14

  Major opcode: 1 (X_CreateWindow)

  Resource id:  0x260002f

X Error: BadIDChoice (invalid resource ID chosen for this connection) 14

  Extension:    139 (RENDER)

  Minor opcode: 4 (RenderCreatePicture)

  Resource id:  0x2600030

python2: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.

.

review_wdgt.py

David Bailey

unread,
Oct 9, 2015, 11:58:22 AM10/9/15
to mnemosyne-proj-users
$ mplayer -slave -ao -quiet "file:///home/david/.local/share/mnemosyne/default.db_media/考える.mp3" -ss 0 -endpos 999699
...
No such audio driver '-quiet'
...

Problem is that you have '-ao' without specifying an audio driver afterwards, so it thinks the name of the audio driver is '-quiet'. To fix, '-ao' just needs to be removed from the command.

$ mplayer -h
...
 
-ao <drv>        select audio output driver ('-ao help' for a list)
...

BTW, I have a DigitalOcean server running CentOS 7; if you want, I could install a VNC server and desktop environment for you to connect to. It would probably be better to just dual boot Windows with Linux though if possible -- I'd suggest you try Linux Mint if you're unfamiliar with Linux.

Peter Bienstman

unread,
Oct 9, 2015, 12:43:13 PM10/9/15
to mnemosyne-...@googlegroups.com

Thanks for debugging this! The attached file should solve this.

 

I’ll be bringing out a RC for a new version in the next week or so.

 

Cheers,

 

Peter

 

From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-...@googlegroups.com] On Behalf Of David Bailey
Sent: 09 October 2015 17:58
To: mnemosyne-proj-users <mnemosyne-...@googlegroups.com>
Subject: [mnemosyne-proj-users] Re: Bug report

 

$ mplayer -slave -ao -quiet "file:///home/david/.local/share/mnemosyne/default.db_media/考える.mp3" -ss 0 -endpos 999699

...

--

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-...@googlegroups.com.

review_wdgt.py
Reply all
Reply to author
Forward
0 new messages