Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-07-2014, 02:54 PM   #1
rd4407
Junior Member
rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.
 
Posts: 4
Karma: 9768
Join Date: Dec 2013
Device: none
Trying to set a custom tag got error message in 2.2

In versions prior to 2.2, I was able to set a custom column tag via its drop down selection.

Now I get an error message:

calibre, version 2.2.0
ERROR: Failed to set data: Could not set data, click Show Details to see why.

Traceback (most recent call last):
File "site-packages\calibre\gui2\library\models.py", line 1031, in setData
File "site-packages\calibre\gui2\library\models.py", line 1057, in _set_data
File "site-packages\calibre\gui2\library\models.py", line 1023, in set_custom_column_data
File "site-packages\calibre\db\legacy.py", line 653, in set_custom
File "site-packages\calibre\db\cache.py", line 1024, in set_field
File "site-packages\calibre\db\write.py", line 513, in set_books
File "site-packages\calibre\db\write.py", line 523, in set_books_for_enum
File "site-packages\calibre\db\write.py", line 290, in many_one
File "site-packages\calibre\db\write.py", line 246, in get_db_id
File "site-packages\calibre\db\backend.py", line 793, in execute
File "c:\cygwin64\home\kovid\sw\build\apsw-3.8.2-r1\src\cursor.c", line 231, in resetcursor
ConstraintError: ConstraintError: UNIQUE constraint failed: custom_column_4.value

Is there anything I need to do to, or is this a bug?

Edited: This problem affects the last item only, which I rarely use, so I don't know how long the problem may have been there.

Last edited by rd4407; 09-07-2014 at 05:25 PM.
rd4407 is offline   Reply With Quote
Old 09-07-2014, 04:45 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by rd4407 View Post
In versions prior to 2.2, I was able to set a custom tag via its drop down selection.

Now I get an error message:

Spoiler:
calibre, version 2.2.0
ERROR: Failed to set data: Could not set data, click Show Details to see why.

Traceback (most recent call last):
File "site-packages\calibre\gui2\library\models.py", line 1031, in setData
File "site-packages\calibre\gui2\library\models.py", line 1057, in _set_data
File "site-packages\calibre\gui2\library\models.py", line 1023, in set_custom_column_data
File "site-packages\calibre\db\legacy.py", line 653, in set_custom
File "site-packages\calibre\db\cache.py", line 1024, in set_field
File "site-packages\calibre\db\write.py", line 513, in set_books
File "site-packages\calibre\db\write.py", line 523, in set_books_for_enum
File "site-packages\calibre\db\write.py", line 290, in many_one
File "site-packages\calibre\db\write.py", line 246, in get_db_id
File "site-packages\calibre\db\backend.py", line 793, in execute
File "c:\cygwin64\home\kovid\sw\build\apsw-3.8.2-r1\src\cursor.c", line 231, in resetcursor
ConstraintError: ConstraintError: UNIQUE constraint failed: custom_column_4.value

Is there anything I need to do to, or is this a bug?
@rd4407 - do you mean a custom column as per attachment

The one you see is working for me.

BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	185
Size:	37.2 KB
ID:	128043  

Last edited by BetterRed; 09-07-2014 at 04:49 PM.
BetterRed is offline   Reply With Quote
Advert
Old 09-07-2014, 05:10 PM   #3
rd4407
Junior Member
rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.
 
Posts: 4
Karma: 9768
Join Date: Dec 2013
Device: none
Yes, a custom column, that I set up a long time ago.

Now, with 2.2., I can get as far as selecting the item from the drop down, but it doesn't take, giving me an error message instead.

But, testing again, I noticed that it is the last item in the list that gives the error.
Other values don't give the error. I rarely use the last item, so I really don't know how far back this problem may've gone.

So I guess a temporary workaround is to put a dummy item at the end, to allow the real item to be used.

Last edited by rd4407; 09-07-2014 at 05:18 PM.
rd4407 is offline   Reply With Quote
Old 09-07-2014, 05:54 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by rd4407 View Post
Yes, a custom column, that I set up a long time ago.

Now, with 2.2., I can get as far as selecting the item from the drop down, but it doesn't take, giving me an error message instead.

But, testing again, I noticed that it is the last item in the list that gives the error.
Other values don't give the error. I rarely use the last item, so I really don't know how far back this problem may've gone.

So I guess a temporary workaround is to put a dummy item at the end, to allow the real item to be used.
@rd4407 - Can you confirm the Column Type is: Comma separated text, like tags, shown in the tag browser. I may be testing the wrong column type.

The word 'tag' has many meanings in calibre - in the context of the Tag browser everything's a Tag, in the editor one of these <xxx> is a tag

As you say, a value of 'zzzzzzzzzzzzzzz' will work around the problem.

BR
BetterRed is offline   Reply With Quote
Old 09-07-2014, 05:58 PM   #5
rd4407
Junior Member
rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.
 
Posts: 4
Karma: 9768
Join Date: Dec 2013
Device: none
Column type: Text, but with a fixed set of permitted values
rd4407 is offline   Reply With Quote
Advert
Old 09-07-2014, 06:28 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by rd4407 View Post
Column type: Text, but with a fixed set of permitted values
@rd4407 I can't reproduce the error here with that column type.

The definitions and values are held in the database, maybe they've become 'corrupt' in some way. After backing-up the database library you could try doing a Library Maintenance->Restore Database.

BR

Last edited by BetterRed; 09-07-2014 at 07:30 PM. Reason: typo
BetterRed is offline   Reply With Quote
Old 09-07-2014, 11:13 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It would help if you attached the metadata.db file from your calibre library folder.
kovidgoyal is offline   Reply With Quote
Old 09-09-2014, 05:19 PM   #8
rd4407
Junior Member
rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.rd4407 knows what is on the back of the AURYN.
 
Posts: 4
Karma: 9768
Join Date: Dec 2013
Device: none
Now, a couple of days later, I replaced the last "dummy" entry with a new real item, and selecting the last item worked.
rd4407 is offline   Reply With Quote
Old 09-09-2014, 09:19 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by rd4407 View Post
Now, a couple of days later, I replaced the last "dummy" entry with a new real item, and selecting the last item worked.
@rd4407 - I venture to suggest that adding that dummy value caused calibre to rewrite your custom column to its Preferences custom-columns table row in metadata.db, and in so doing it 'fixed' the 'corrupt' value. I think its a BLOB hence , hard to debug unless your name is Kovid Goyal

Thanks for letting us know the problem is solved.

BR

Last edited by BetterRed; 09-10-2014 at 04:42 AM. Reason: fix errors as per chaley's following post
BetterRed is offline   Reply With Quote
Old 09-10-2014, 04:13 AM   #10
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,445
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
I think its a BLOB, hence hard to debug unless your name is Kovid Goyal
For future reference, custom column definitions are in plain text in the "custom_columns" table. For columns with fixed values, the list of values is the "display" column along with some other stuff. The same information is in the "field_metadata" row in the preferences table and in metadata_db_prefs_backup.json.
chaley is offline   Reply With Quote
Old 09-10-2014, 04:39 AM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
For future reference, custom column definitions are in plain text in the "custom_columns" table. For columns with fixed values, the list of values is the "display" column along with some other stuff. The same information is in the "field_metadata" row in the preferences table and in metadata_db_prefs_backup.json.
For no good reason I was thinking conversion-options table - as always it pays to check before sticking head above parapet - they do both begin with 'c'

BR

Last edited by BetterRed; 09-10-2014 at 04:44 AM.
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KindleGen error message: E1003 Unknown error in class String. Doitsu Kindle Formats 1 06-25-2014 12:29 PM
Assigning shortcut to custom tag? khahoon Library Management 3 05-20-2013 06:11 PM
Could not set data error message thetimewarp Calibre 1 08-02-2012 09:15 PM
TAG - A Techno Thriller set in the near future simonroyle Self-Promotions by Authors and Publishers 160 06-15-2012 12:17 AM
error message: ERROR ITMS-4099: "Invalid ISBN: [#] at Book (MZItmspBookPac NewDay ePub 3 10-07-2010 01:47 PM


All times are GMT -4. The time now is 09:47 AM.


MobileRead.com is a privately owned, operated and funded community.