12-25-2014, 12:36 PM | #1 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Set Library Information / JSON serializable error
Connecting my Nexus 7 (2012) with 3.5.9 of CC and 2.13 (64 bit) of calibre I'm getting the following error in the calibre job log for job Set Library Information
Spoiler:
and the device disconnects. Two additional jobs seem to run properly; Get list of books on device and Send metadata to device. CC log file sent to you. |
12-25-2014, 12:56 PM | #2 |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Something strange here. I don't see why there should be any datetime values there.
Could you post the metadata_db_prefs_backup.json file? It is saving the metadata for all your columns, and I want to see what that is. If you prefer, you can send it to cc_debug_logs at charles dot haleys dot org. |
Advert | |
|
12-25-2014, 02:33 PM | #3 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
eMail sent
|
12-26-2014, 04:48 AM | #4 |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
This is interesting.
Calibre contains a dictionary "field_metadata" that contains descriptions of every field (column) in the library. It is supposed to contain only metadata, not values of the fields. Unfortunately the description of the field #kobolastread has had a value inserted, which is never supposed to happen. You can see this by looking at the field metadata section of metadata_db_prefs_backup.json. I don't know how one goes about inserting a value into field_metadata. The only way I can find to do it is something like: Code:
fm = field_metadata.get('#kobolastread') fm['#value#'] = something Code:
{ "__class__": "datetime.datetime", "__value__": "2014-12-22T23:47:57+00:00" } Code:
fm = field_metadata.get('kobolastread') json_encoded = JsonCodec().encode_book_metadata(book) fm['#value'#] = json_encoded['#kobolastread']['#value#'] |
12-26-2014, 07:27 AM | #5 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Restarted calibre.
Did a connect as wireless device from cc. Worked perfectly! Deleted some books from the tablet and disconnected. Then connected Kobo Glo. Transferred some books and disconnected. Reconnected cc as wireless device. Same error occurred. |
Advert | |
|
12-26-2014, 08:02 AM | #6 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
I sense there is some problem with davidfor's Kobo Utilities and it's function for retrieving and storing last read data from Kobo.
I initially tried disabling that function (I should note I am using a beta version of his driver that supports multiple Kobo devices), then connecting my Glo, followed by cc. All worked properly. Next I enabled that function, and much to my surprise it continued to work properly. Thinking it over I realized that none of the books on the Kobo had been read since the last connection was made. I flipped the pages in a book and then tried again. SUCCESS (or do I mean FAILURE). The error reoccurred. As one final test I restarted calibre, attached the Glo, then CC. This again worked properly since there were no reading stats changed. |
12-26-2014, 08:14 AM | #7 | |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
As you have a work-around and as you and davidfor work together frequently, I will put this on a back burner until you tell me that it cannot be fixed in any other way. BTW: I was the original implementer of the field_metadata stuff. Feel free to ask questions or discuss alternatives. |
|
12-26-2014, 08:33 AM | #8 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Thanks Will let you know what we find. At least it's reproducible at will which is normally the first step in tracking down bugs!
|
12-29-2014, 09:34 AM | #9 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
OK. Have given David a range of logs; both with his beta version of the utilities and the production version. Glad to say the error happens with either version.
|
12-29-2014, 03:53 PM | #10 |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I implemented a workaround that is now in source. It will be in the next calibre release. I can't guarantee it really prevents the exception because I can't repeat it, but I think it will.
|
12-29-2014, 04:57 PM | #11 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
I just tried downloading the current source (and yes.. I verified that the change you made https://github.com/cbhaley/calibre/c...8b10cc1a37213d was in the driver) and repeated tests while running from source.
Still receive the same error. Spoiler:
I also did verify that the version info displayed was [2.14]*[64bit]. |
12-30-2014, 02:04 AM | #12 | |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Did you forget to restart calibre after pulling the changes? |
|
12-30-2014, 07:58 AM | #13 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Consider it user error... I had miss set CALIBRE_DEVELOP_FROM; I forgot to add the src directory to the end of the variable's value.
|
12-30-2014, 08:55 AM | #14 |
Grand Sorcerer
Posts: 12,217
Karma: 74000000
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Also, davidfor has tracked down the problem and fixed the plugin (at least the beta version of it).
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving Calibre Library from Windows 7 to Windows 8 - json code issue | DramaQueenLucy | Devices | 14 | 11-12-2013 11:47 AM |
conversion error, how to set selct_form | lrui | Recipes | 8 | 08-22-2012 09:11 AM |
Could not set data error message | thetimewarp | Calibre | 1 | 08-02-2012 09:15 PM |
Error in the WiFi information on the 711 Page | AthenaAtDelphi | Amazon Kindle | 8 | 10-11-2010 10:00 PM |
Adding additional information to the Library view | Gadget Guy | Calibre | 3 | 04-23-2010 03:37 PM |